ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimPlaGeantHit.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 ActarSimPlaGeantHit_h
11 #define ActarSimPlaGeantHit_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 ActarSimPlaGeantHit : public G4VHit {
20 private:
21  G4double edep; ///< Energy deposited in the step
22  G4double eBeforePla; ///< Energy before entering plastic
23  G4double eAfterPla; ///< Energy when exiting plastic
24 
25  G4ThreeVector pos; ///< PostStep position of the step
26  G4ThreeVector prePos; ///< PreStep position of the step
27  G4ThreeVector localPos; ///< Local (for the given detName and detID) coordinates of interaction (postStep)
28  G4ThreeVector localPrePos;///< Local (for the given detName and detID) coordinates of interaction (postStep)
29 
30  G4String detName; ///< Name of the volume where the interaction takes place
31  G4String postDetName;///< Name of the volume at the previous step
32  G4String preDetName; ///< Name of the volume at the following step
33  G4int detID; ///< ID (copy) of the detector where the interaction takes place
34 
35  G4double toF; ///< ToF of the interaction (postStep)
36 
37  G4int trackID; ///< Track ID
38  G4int parentID; ///< Parent ID
39 
40  G4int particleID; ///< Particle ID
41  G4double particleCharge; ///< Particle charge
42  G4double particleMass; ///< Particle mass
43 
44 public:
49  G4int operator==(const ActarSimPlaGeantHit&) const;
50 
51  inline void* operator new(size_t);
52  inline void operator delete(void*);
53 
54  void Draw();
55  void Print();
56  void PrinttoFile();
57 
58  void SetEdep(G4double de){ edep = de; }
59  void SetEBeforeSil(G4double eb){eBeforePla = eb;}
60  void SetEAfterSil(G4double ea){eAfterPla = ea;}
61 
62  void SetPos(G4ThreeVector xyz){ pos = xyz; }
63  void SetPrePos(G4ThreeVector xyz){ prePos = xyz; }
64  void SetLocalPos(G4ThreeVector xyz){ localPos = xyz; }
65  void SetLocalPrePos(G4ThreeVector xyz){ localPrePos = xyz; }
66 
67  void SetDetName(G4String Name){ detName = Name; }
68  void SetPreDetName(G4String Name){ preDetName = Name; }
69  void SetPostDetName(G4String Name){ postDetName = Name; }
70  void SetDetID(G4int id){ detID = id; }
71 
72  void SetToF(G4double Time){ toF = Time; }
73 
74  void SetTrackID(G4int track){ trackID = track; }
75  void SetParentID(G4int id){ parentID = id; }
76 
77  void SetParticleID(G4int ID){ particleID = ID; }
78  void SetParticleCharge(G4double charge){ particleCharge = charge; }
79  void SetParticleMass(G4double mass){particleMass = mass;}
80 
81  G4double GetEdep(){ return edep; }
82  G4double GetEBeforePla(){return eBeforePla;}
83  G4double GetEAfterPla(){return eAfterPla;}
84 
85  G4ThreeVector GetPos(){ return pos; }
86  G4ThreeVector GetPrePos(){ return prePos; }
87  G4ThreeVector GetLocalPos(){ return localPos; }
88  G4ThreeVector GetLocalPrePos(){ return localPrePos; }
89 
90  G4String GetDetName(){ return detName; }
91  G4String GetPreDetName(){ return preDetName; }
92  G4String GetPostDetName(){ return postDetName; }
93  G4int GetDetID(){ return detID; }
94 
95  G4double GetToF(){ return toF; }
96 
97  G4int GetTrackID(){ return trackID; }
98  G4int GetParentID(){ return parentID; }
99 
100  G4int GetParticleID(){ return particleID; }
101  G4double GetParticleCharge(){ return particleCharge; }
102  G4double GetParticleMass(){return particleMass;}
103 };
104 
105 typedef G4THitsCollection<ActarSimPlaGeantHit> ActarSimPlaGeantHitsCollection;
106 
107 extern G4Allocator<ActarSimPlaGeantHit> ActarSimPlaGeantHitAllocator;
108 
109 inline void* ActarSimPlaGeantHit::operator new(size_t) {
110  void *aHit;
111  aHit = (void *) ActarSimPlaGeantHitAllocator.MallocSingle();
112  return aHit;
113 }
114 
115 inline void ActarSimPlaGeantHit::operator delete(void *aHit) {
117 }
118 #endif
G4ThreeVector GetPrePos()
G4ThreeVector GetLocalPos()
G4THitsCollection< ActarSimPlaGeantHit > ActarSimPlaGeantHitsCollection
void Print()
Prints full information about the calGeantHit.
void SetPrePos(G4ThreeVector xyz)
void SetLocalPrePos(G4ThreeVector xyz)
void SetToF(G4double Time)
G4ThreeVector localPrePos
Local (for the given detName and detID) coordinates of interaction (postStep)
void SetPostDetName(G4String Name)
G4double eBeforePla
Energy before entering plastic.
void SetLocalPos(G4ThreeVector xyz)
G4ThreeVector pos
PostStep position of the step.
void SetDetName(G4String Name)
void SetEBeforeSil(G4double eb)
void SetPos(G4ThreeVector xyz)
G4String detName
Name of the volume where the interaction takes place.
G4Allocator< ActarSimPlaGeantHit > ActarSimPlaGeantHitAllocator
G4ThreeVector localPos
Local (for the given detName and detID) coordinates of interaction (postStep)
G4ThreeVector prePos
PreStep position of the step.
void SetEdep(G4double de)
G4int detID
ID (copy) of the detector where the interaction takes place.
G4double particleCharge
Particle charge.
void SetParentID(G4int id)
void SetParticleID(G4int ID)
const ActarSimPlaGeantHit & operator=(const ActarSimPlaGeantHit &)
Operator =.
ActarSimPlaGeantHit()
Constructor.
void Draw()
Draws the Hit. A clear red point on the Hit position.
G4double toF
ToF of the interaction (postStep)
G4int parentID
Parent ID.
~ActarSimPlaGeantHit()
Destructor.
G4double particleMass
Particle mass.
G4int operator==(const ActarSimPlaGeantHit &) const
Operator ==.
void SetEAfterSil(G4double ea)
G4int particleID
Particle ID.
G4String preDetName
Name of the volume at the following step.
void SetParticleMass(G4double mass)
G4String postDetName
Name of the volume at the previous step.
G4double edep
Energy deposited in the step.
void SetPreDetName(G4String Name)
G4ThreeVector GetLocalPrePos()
void SetParticleCharge(G4double charge)
void SetTrackID(G4int track)
G4double eAfterPla
Energy when exiting plastic.