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