QwGeant4
QweakSimTarget_DetectorHit.hh
Go to the documentation of this file.
1 
2 // QweakSimTarget_DetectorHit.hh
3 // Wouter Deconinck
4 // 2014-10-07
5 
6 /////// --------------------------------------------------------------------
7 
8 #ifndef QweakSimTarget_DetectorHit_h
9 #define QweakSimTarget_DetectorHit_h 1
10 
11 //--- user includes
12 #include "QweakSimHit.hh"
13 
14 /////// --------------------------------------------------------------------
15 
16 class QweakSimTarget_DetectorHit : public G4VHit
17 {
18 
19 public:
20 
21  //--- Constructor
23 
24  //--- Destructor
26 
27  //--- Copy Constructor
29 
30  //--- Assignment Operator
32 
33  int operator==(const QweakSimTarget_DetectorHit &right) const;
34 
35  inline void *operator new(size_t);
36  inline void operator delete(void *aHit);
37 
38  inline float x();
39  inline float y();
40 
41  //--- methods
42  virtual void Draw();
43  virtual void Print();
44 
45 private:
46 
47  G4int detectorID;
48 
50 
51  G4double trackID;
52 
53  G4String particleName;
54  G4int particleType;
55 
56  G4double time;
57 
58  G4int hasBeenHit;
60  G4int nbOfHits;
61 
62  G4ThreeVector worldPos;
63  G4ThreeVector localPos;
64  G4ThreeVector localExitPos;
65  G4ThreeVector originVertexPosition;
66 
67  G4ThreeVector worldMomentum;
68  G4ThreeVector localMomentum;
69  G4ThreeVector currentMomentumDirection;
71 
74 
77 
78  //--- Target deposited energy
79  G4double depositedEnergy;
80 
81  G4ThreeVector cellPos;
82  G4RotationMatrix cellRot;
83  const G4LogicalVolume* pLogV;
84 
85 
86 public:
87 
88  //----------------- PrimaryEventNumber
89 
90  inline void StorePrimaryEventNumber(G4int pen) { primaryEventNumber = pen; }
91  inline G4int GetPrimaryEventNumber() const {return primaryEventNumber;}
92 
93  //----------------- TrackID
94 
95  inline void StoreTrackID(G4double tid) { trackID = tid; }
96  inline G4double GetTrackID() const {return trackID;}
97 
98  //----------------- PrarticleName & ParticleType
99 
100  inline void StoreParticleName(G4String pn) {particleName = pn;}
101  inline G4String GetParticleName() const {return particleName;}
102 
103  inline void StoreParticleType(G4int pt) {particleType = pt;}
104  inline G4int GetParticleType() const {return particleType;}
105 
106  //----------------- GlobalTimeOfHit
107 
108  inline void StoreGlobalTime(G4double t) { time = t; }
109  inline G4double GetGlobalTime() const {return time;}
110 
111  //----------------- HasBeenHit & EdgeEventFlag & NbOfHits
112 
113  inline void StoreHasBeenHit(G4int n) { hasBeenHit = n; }
114  inline G4int GetHasBeenHit() const {return hasBeenHit;}
115 
116  inline void StoreEdgeEventFlag(G4int flag) { edgeEventFlag = flag; }
117  inline G4int GetEdgeEventFlag() const {return edgeEventFlag;}
118 
119  inline void StoreNbOfHits(G4int nd) { nbOfHits = nd; }
120  inline G4int GetNbOfHits() const {return nbOfHits;}
121 
122  //----------------- Position
123 
124  //--- GlobalPosition
125  inline void StoreWorldPosition(G4ThreeVector xyz) { worldPos = xyz; }
126  inline G4ThreeVector GetWorldPosition() const {return worldPos;}
127 
128  //--- LocalPosition
129  inline void StoreLocalPosition(G4ThreeVector xyz) { localPos = xyz; }
130  inline G4ThreeVector GetLocalPosition() const {return localPos;}
131 
132  //--- LoclaExitPosition
133  inline void StoreLocalExitPosition(G4ThreeVector xyz) { localExitPos = xyz; }
134  inline G4ThreeVector GetLocalExitPosition() const {return localExitPos;}
135 
136  //--- OriginVertexPosition
137  inline void StoreOriginVertexPosition(G4ThreeVector oxyz) { originVertexPosition = oxyz; }
138  inline G4ThreeVector GetOriginVertexPosition() const {return originVertexPosition;}
139 
140  //----------------- Momentum
141 
142  //--- GlobalMomentum
143  inline void StoreWorldMomentum(G4ThreeVector gpxyz) { worldMomentum = gpxyz; }
144  inline G4ThreeVector GetWorldMomentum() const {return worldMomentum;}
145 
146  //--- LocalMomentum
147  inline void StoreLocalMomentum(G4ThreeVector lpxyz) { localMomentum = lpxyz; }
148  inline G4ThreeVector GetLocalMomentum() const {return localMomentum;}
149 
150  //--- LocalVertexMomentumDirection
151  inline void StoreMomentumDirection(G4ThreeVector pxyz) { currentMomentumDirection = pxyz; }
152  inline G4ThreeVector GetMomentumDirection() const {return currentMomentumDirection;}
153 
154  //--- OriginVertexMomentumDirection
155  inline void StoreOriginVertexMomentumDirection(G4ThreeVector opxyz) { originVertexMomentumDirection = opxyz; }
157 
158  //---------------- OriginVertexKineticEnergy & TotalEnergy
159 
160  inline void StoreOriginVertexKineticEnergy(G4double oekin) { originVertexKineticEnergy = oekin; }
161  inline G4double GetOriginVertexKineticEnergy() const {return originVertexKineticEnergy;}
162 
163  inline void StoreOriginVertexTotalEnergy(G4double oetot) { originVertexTotalEnergy = oetot; }
164  inline G4double GetOriginVertexTotalEnergy() const {return originVertexTotalEnergy;}
165 
166  //---------------- LocalVertexKineticEnergy & TotalEnergy
167 
168  inline void StoreKineticEnergy(G4double ekin) { currentKineticEnergy = ekin; }
169  inline G4double GetKineticEnergy() const {return currentKineticEnergy;}
170 
171  inline void StoreTotalEnergy(G4double etot) { currentTotalEnergy = etot; }
172  inline G4double GetTotalEnergy() const {return currentTotalEnergy;}
173 
174  //--------------- Target deposited energy
175 
176  inline void StoreDepositedEnergy(G4double dpeg) {depositedEnergy = dpeg;}
177  inline void AddDepositedEnergy(G4double dpeg) {depositedEnergy += dpeg;}
178  inline G4double GetHitDepositedEnergy() const {return depositedEnergy;}
179 
180 
181  //---
182  inline void StoreCellPosition(G4ThreeVector xyz) { cellPos = xyz; }
183  inline G4ThreeVector GetCellPosition() const {return cellPos;}
184 
185  inline void StoreCellRotation(G4RotationMatrix rmat) { cellRot = rmat; }
186  inline G4RotationMatrix GetCellRotation() const {return cellRot;}
187 
188  inline void StoreLogVolume(G4LogicalVolume* val) { pLogV = val; }
189  inline const G4LogicalVolume* GetLogVolume() const {return pLogV;}
190 
191 };
192 
193 /////// --------------------------------------------------------------------
194 
195 typedef G4THitsCollection<QweakSimTarget_DetectorHit> QweakSimTarget_DetectorHitsCollection;
196 
197 extern G4Allocator<QweakSimTarget_DetectorHit> QweakSimTarget_DetectorHitAllocator;
198 
199 /////// --------------------------------------------------------------------
200 
201 inline void* QweakSimTarget_DetectorHit::operator new(size_t)
202 {
203  void* aHit;
204  aHit = (void*) QweakSimTarget_DetectorHitAllocator.MallocSingle();
205  return aHit;
206 }
207 
208 /////// --------------------------------------------------------------------
209 
210 inline void QweakSimTarget_DetectorHit::operator delete(void* aHit)
211 {
213 }
214 
215 /////// --------------------------------------------------------------------
216 
217 #endif
218 
219 /////// --------------------------------------------------------------------
const G4LogicalVolume * GetLogVolume() const
void StoreLogVolume(G4LogicalVolume *val)
G4RotationMatrix GetCellRotation() const
void StoreCellPosition(G4ThreeVector xyz)
void StoreWorldMomentum(G4ThreeVector gpxyz)
G4ThreeVector GetLocalExitPosition() const
void StoreLocalMomentum(G4ThreeVector lpxyz)
G4ThreeVector GetMomentumDirection() const
void StoreOriginVertexMomentumDirection(G4ThreeVector opxyz)
void StoreOriginVertexPosition(G4ThreeVector oxyz)
G4THitsCollection< QweakSimTarget_DetectorHit > QweakSimTarget_DetectorHitsCollection
G4ThreeVector GetOriginVertexPosition() const
int operator==(const QweakSimTarget_DetectorHit &right) const
void StoreMomentumDirection(G4ThreeVector pxyz)
void StoreOriginVertexKineticEnergy(G4double oekin)
G4ThreeVector GetOriginVertexMomentumDirection() const
void StoreOriginVertexTotalEnergy(G4double oetot)
G4Allocator< QweakSimTarget_DetectorHit > QweakSimTarget_DetectorHitAllocator
void StoreLocalPosition(G4ThreeVector xyz)
const QweakSimTarget_DetectorHit & operator=(const QweakSimTarget_DetectorHit &right)
void StoreLocalExitPosition(G4ThreeVector xyz)
void StoreWorldPosition(G4ThreeVector xyz)
void StoreCellRotation(G4RotationMatrix rmat)