ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSciRingGeantHit.hh
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 04/2008
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 
10 #ifndef ActarSimSciRingGeantHit_h
11 #define ActarSimSciRingGeantHit_h 1
12 
13 #include "G4VHit.hh"
14 #include "G4THitsCollection.hh"
15 #include "G4Allocator.hh"
16 #include "G4ThreeVector.hh"
17 #include "G4Step.hh"
18 
19 class ActarSimSciRingGeantHit : public G4VHit {
20 private:
21  G4double edep; ///< Energy deposited in the step
22 
23  G4ThreeVector pos; ///< Position of the start of the step
24  G4ThreeVector prePos; ///< Position of the end of the step
25  G4ThreeVector localPos; ///< LLcal (for the given detName and detID) coordinates of interaction (postStep)
26  G4ThreeVector localPrePos; ///< Local (for the given detName and detID) coordinates of interaction (postStep)
27 
28  G4String detName; ///< Name of the volume where the interaction takes place
29  G4String postDetName; ///< Name of the volume at the previous step
30  G4String preDetName; ///< Name of the volume at the following step
31  G4int detID; ///< ID (copy) of the detector where the interaction takes place
32 
33  G4double toF; ///< ToF of the interaction (postStep)
34 
35  G4int trackID; ///< TrackID of the particle
36  G4int parentID; ///< Particle parent ID
37 
38  G4int particleID; ///< Particle ID
39  G4double particleCharge; ///< Particle charge
40  G4double particleMass; ///< Particle mass
41 
42 public:
47  G4int operator==(const ActarSimSciRingGeantHit&) const;
48 
49  inline void* operator new(size_t);
50  inline void operator delete(void*);
51 
52  void Draw();
53  void Print();
54  void PrinttoFile();
55 
56  void SetEdep(G4double de){ edep = de; }
57 
58  void SetPos(G4ThreeVector xyz){ pos = xyz; }
59  void SetPrePos(G4ThreeVector xyz){ prePos = xyz; }
60  void SetLocalPos(G4ThreeVector xyz){ localPos = xyz; }
61  void SetLocalPrePos(G4ThreeVector xyz){ localPrePos = xyz; }
62 
63  void SetDetName(G4String Name){ detName = Name; }
64  void SetPreDetName(G4String Name){ preDetName = Name; }
65  void SetPostDetName(G4String Name){ postDetName = Name; }
66  void SetDetID(G4int id){ detID = id; }
67 
68  void SetToF(G4double Time){ toF = Time; }
69 
70  void SetTrackID(G4int track){ trackID = track; }
71  void SetParentID(G4int id){ parentID = id; }
72 
73  void SetParticleID(G4int ID){ particleID = ID; }
74  void SetParticleCharge(G4double charge){ particleCharge = charge; }
75  void SetParticleMass(G4double mass){particleMass = mass;}
76 
77  G4double GetEdep(){ return edep; }
78 
79  G4ThreeVector GetPos(){ return pos; }
80  G4ThreeVector GetPrePos(){ return prePos; }
81  G4ThreeVector GetLocalPos(){ return localPos; }
82  G4ThreeVector GetLocalPrePos(){ return localPrePos; }
83 
84  G4String GetDetName(){ return detName; }
85  G4String GetPreDetName(){ return preDetName; }
86  G4String GetPostDetName(){ return postDetName; }
87  G4int GetDetID(){ return detID; }
88 
89  G4double GetToF(){ return toF; }
90 
91  G4int GetTrackID(){ return trackID; }
92  G4int GetParentID(){ return parentID; }
93 
94  G4int GetParticleID(){ return particleID; }
95  G4double GetParticleCharge(){ return particleCharge; }
96  G4double GetParticleMass(){return particleMass;}
97 
98 };
99 
100 typedef G4THitsCollection<ActarSimSciRingGeantHit> ActarSimSciRingGeantHitsCollection;
101 
102 extern G4Allocator<ActarSimSciRingGeantHit> ActarSimSciRingGeantHitAllocator;
103 
104 inline void* ActarSimSciRingGeantHit::operator new(size_t) {
105  void *aHit;
106  aHit = (void *) ActarSimSciRingGeantHitAllocator.MallocSingle();
107  return aHit;
108 }
109 
110 inline void ActarSimSciRingGeantHit::operator delete(void *aHit) {
112 }
113 #endif
G4ThreeVector prePos
Position of the end of the step.
void SetLocalPrePos(G4ThreeVector xyz)
void SetPrePos(G4ThreeVector xyz)
ActarSimSciRingGeantHit()
Constructor. Makes nothing.
void Draw()
Draws the Hit. A clear red point on the Hit position.
G4ThreeVector pos
Position of the start of the step.
G4String preDetName
Name of the volume at the following step.
void SetPos(G4ThreeVector xyz)
G4int detID
ID (copy) of the detector where the interaction takes place.
G4double edep
Energy deposited in the step.
G4int trackID
TrackID of the particle.
void SetParticleCharge(G4double charge)
void SetPostDetName(G4String Name)
G4THitsCollection< ActarSimSciRingGeantHit > ActarSimSciRingGeantHitsCollection
G4String detName
Name of the volume where the interaction takes place.
void Print()
Prints full information about the calGeantHit.
G4int parentID
Particle parent ID.
G4String postDetName
Name of the volume at the previous step.
void SetLocalPos(G4ThreeVector xyz)
G4ThreeVector localPrePos
Local (for the given detName and detID) coordinates of interaction (postStep)
void SetParticleMass(G4double mass)
void SetPreDetName(G4String Name)
G4Allocator< ActarSimSciRingGeantHit > ActarSimSciRingGeantHitAllocator
G4ThreeVector localPos
LLcal (for the given detName and detID) coordinates of interaction (postStep)
G4double particleMass
Particle mass.
~ActarSimSciRingGeantHit()
Destructor. Makes nothing.
const ActarSimSciRingGeantHit & operator=(const ActarSimSciRingGeantHit &)
Operator =.
G4double toF
ToF of the interaction (postStep)
G4double particleCharge
Particle charge.
G4int operator==(const ActarSimSciRingGeantHit &) const
Operator ==.