ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSciGeantHit.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 ActarSimSciGeantHit_h
11 #define ActarSimSciGeantHit_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 ActarSimSciGeantHit : public G4VHit {
20 private:
21  G4double edep; ///< Energy deposited in the step
22 
23  G4ThreeVector pos; ///< PostStep position of the step
24  G4ThreeVector prePos; ///< PreStep position of the step
25  G4ThreeVector localPos; ///< Local (for the given detName and detID) coordinates of interaction (postStep)
26  G4ThreeVector localPrePos;///< Local (for the given detName and detID) coordinates of interaction (preStep)
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; ///< Particle trackID
36  G4int parentID; ///< Particle parent track ID
37 
38  G4int particleID; ///< Particle trackID
39  G4double particleCharge; ///< Particle charge
40  G4double particleMass; ///< Particle mass
41 
42 public:
47  G4int operator==(const ActarSimSciGeantHit&) 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 typedef G4THitsCollection<ActarSimSciGeantHit> ActarSimSciGeantHitsCollection;
100 
101 extern G4Allocator<ActarSimSciGeantHit> ActarSimSciGeantHitAllocator;
102 
103 inline void* ActarSimSciGeantHit::operator new(size_t) {
104  void *aHit;
105  aHit = (void *) ActarSimSciGeantHitAllocator.MallocSingle();
106  return aHit;
107 }
108 
109 inline void ActarSimSciGeantHit::operator delete(void *aHit) {
111 }
112 #endif
G4ThreeVector localPrePos
Local (for the given detName and detID) coordinates of interaction (preStep)
void SetLocalPrePos(G4ThreeVector xyz)
G4double particleMass
Particle mass.
G4ThreeVector prePos
PreStep position of the step.
G4ThreeVector GetLocalPos()
G4int operator==(const ActarSimSciGeantHit &) const
Operator ==.
void SetParticleCharge(G4double charge)
G4String detName
Name of the volume where the interaction takes place.
void Draw()
Draws the Hit. A clear red point on the Hit position.
G4double particleCharge
Particle charge.
G4THitsCollection< ActarSimSciGeantHit > ActarSimSciGeantHitsCollection
void SetPreDetName(G4String Name)
void SetToF(G4double Time)
void Print()
Prints full information about the calGeantHit.
G4Allocator< ActarSimSciGeantHit > ActarSimSciGeantHitAllocator
void SetParentID(G4int id)
G4int detID
ID (copy) of the detector where the interaction takes place.
void SetPrePos(G4ThreeVector xyz)
G4ThreeVector pos
PostStep position of the step.
void SetPos(G4ThreeVector xyz)
void SetTrackID(G4int track)
void SetParticleMass(G4double mass)
void SetDetName(G4String Name)
G4int parentID
Particle parent track ID.
void SetLocalPos(G4ThreeVector xyz)
G4double toF
ToF of the interaction (postStep)
G4ThreeVector localPos
Local (for the given detName and detID) coordinates of interaction (postStep)
G4String postDetName
Name of the volume at the previous step.
const ActarSimSciGeantHit & operator=(const ActarSimSciGeantHit &)
Operator =.
void SetParticleID(G4int ID)
G4int particleID
Particle trackID.
G4ThreeVector GetLocalPrePos()
ActarSimSciGeantHit()
Constructor. Makes nothing.
void SetEdep(G4double de)
G4ThreeVector GetPrePos()
G4String preDetName
Name of the volume at the following step.
G4int trackID
Particle trackID.
G4double edep
Energy deposited in the step.
void SetPostDetName(G4String Name)
~ActarSimSciGeantHit()
Destructor. Makes nothing.