QwGeant4
QweakSimLeadGlass_DetectorHit.hh
Go to the documentation of this file.
1 
2 // QweakSimLeadGlass_DetectorHit.hh
3 // Fang Guo
4 // 2012/07/31
5 
6 /////// --------------------------------------------------------------------
7 
8 #ifndef QweakSimLeadGlass_DetectorHit_h
9 #define QweakSimLeadGlass_DetectorHit_h 1
10 
11 //--- user includes
12 #include "QweakSimHit.hh"
13 
14 
15 
16 /////// --------------------------------------------------------------------
17 
18 class QweakSimLeadGlass_DetectorHit : public G4VHit
19 {
20 
21 public:
22 
23  //--- Constructor
25  QweakSimLeadGlass_DetectorHit(G4int detector_id);
26 
27  //--- Destructor
29 
30  //--- Copy Constructor
32 
33  //--- Assignment Operator
35 
36  int operator==(const QweakSimLeadGlass_DetectorHit &right) const;
37 
38  inline void *operator new(size_t);
39  inline void operator delete(void *aHit);
40 
41  inline float x();
42  inline float y();
43 
44  //--- methods
45  virtual void Draw();
46  virtual void Print();
47 
48 private:
49 
50  G4int detectorID;
51 
53 
54  G4double trackID;
55 
56  G4String particleName;
57  G4int particleType;
58 
59  G4double time;
60 
61  G4int hasBeenHit;
63  G4int nbOfHits;
64 
65  //G4int secondaryElectronCount;
66 
67  G4ThreeVector worldPos;
68  G4ThreeVector localPos;
69  G4ThreeVector localExitPos;
70  G4ThreeVector originVertexPosition;
71 
72  G4ThreeVector worldMomentum;
73  G4ThreeVector localMomentum;
74  G4ThreeVector currentMomentumDirection;
76 
77  //--- calculated in Event Action
78  //G4double originVertexThetaAngle;
79  //G4double originVertexPhiAngle;
80 
83 
86 
87  //G4double primaryQ2;
88  //G4double crossSection;
89  //G4double crossSectionWeight;
90 
91  //--- calculated in Event Action
92  //G4double globalThetaAngle;
93  //G4double globalPhiAngle;
94 
95  //--- LeadGlass deposited energy
97 
98 
99  G4ThreeVector cellPos;
100  G4RotationMatrix cellRot;
101  const G4LogicalVolume* pLogV;
102 
103 
104 public:
105 
106  //----------------- PrimaryEventNumber
107 
108  inline void StorePrimaryEventNumber(G4int pen) { primaryEventNumber = pen; }
109  inline G4int GetPrimaryEventNumber() const {return primaryEventNumber;}
110 
111  //----------------- TrackID
112 
113  inline void StoreTrackID(G4double tid) { trackID = tid; }
114  inline G4double GetTrackID() const {return trackID;}
115 
116  //----------------- PrarticleName & ParticleType
117 
118  inline void StoreParticleName(G4String pn) {particleName = pn;}
119  inline G4String GetParticleName() const {return particleName;}
120 
121  inline void StoreParticleType(G4int pt) {particleType = pt;}
122  inline G4int GetParticleType() const {return particleType;}
123 
124  //----------------- GlobalTimeOfHit
125 
126  inline void StoreGlobalTime(G4double t) { time = t; }
127  inline G4double GetGlobalTime() const {return time;}
128 
129  //----------------- HasBeenHit & EdgeEventFlag & NbOfHits
130 
131  inline void StoreHasBeenHit(G4int n) { hasBeenHit = n; }
132  inline G4int GetHasBeenHit() const {return hasBeenHit;}
133 
134  inline void StoreEdgeEventFlag(G4int flag) { edgeEventFlag = flag; }
135  inline G4int GetEdgeEventFlag() const {return edgeEventFlag;}
136 
137  inline void StoreNbOfHits(G4int nd) { nbOfHits = nd; }
138  inline G4int GetNbOfHits() const {return nbOfHits;}
139 
140  //----------------- Position
141 
142  //--- GlobalPosition
143  inline void StoreWorldPosition(G4ThreeVector xyz) { worldPos = xyz; }
144  inline G4ThreeVector GetWorldPosition() const {return worldPos;}
145 
146  //--- LocalPosition
147  inline void StoreLocalPosition(G4ThreeVector xyz) { localPos = xyz; }
148  inline G4ThreeVector GetLocalPosition() const {return localPos;}
149 
150  //--- LoclaExitPosition
151  inline void StoreLocalExitPosition(G4ThreeVector xyz) { localExitPos = xyz; }
152  inline G4ThreeVector GetLocalExitPosition() const {return localExitPos;}
153 
154  //--- OriginVertexPosition
155  inline void StoreOriginVertexPosition(G4ThreeVector oxyz) { originVertexPosition = oxyz; }
156  inline G4ThreeVector GetOriginVertexPosition() const {return originVertexPosition;}
157 
158  //----------------- Momentum
159 
160  //--- GlobalMomentum
161  inline void StoreWorldMomentum(G4ThreeVector gpxyz) { worldMomentum = gpxyz; }
162  inline G4ThreeVector GetWorldMomentum() const {return worldMomentum;}
163 
164  //--- LocalMomentum
165  inline void StoreLocalMomentum(G4ThreeVector lpxyz) { localMomentum = lpxyz; }
166  inline G4ThreeVector GetLocalMomentum() const {return localMomentum;}
167 
168  //--- LocalVertexMomentumDirection
169  inline void StoreMomentumDirection(G4ThreeVector pxyz) { currentMomentumDirection = pxyz; }
170  inline G4ThreeVector GetMomentumDirection() const {return currentMomentumDirection;}
171 
172  //--- OriginVertexMomentumDirection
173  inline void StoreOriginVertexMomentumDirection(G4ThreeVector opxyz) { originVertexMomentumDirection = opxyz; }
175 
176  //---------------- OriginVertexThetaAngle & PhiAngle
177 
178  //inline void StoreOriginVertexThetaAngle(G4double thetag) { originVertexThetaAngle = thetag; }
179  //inline G4double GetOriginVertexThetaAngle() const {return originVertexThetaAngle;}
180 
181  //inline void StoreOriginVertexPhiAngle(G4double phiag) { originVertexPhiAngle = phiag; }
182  //inline G4double GetOriginVertexPhiAngle() const {return originVertexPhiAngle;}
183 
184  //---------------- OriginVertexKineticEnergy & TotalEnergy
185 
186  inline void StoreOriginVertexKineticEnergy(G4double oekin) { originVertexKineticEnergy = oekin; }
187  inline G4double GetOriginVertexKineticEnergy() const {return originVertexKineticEnergy;}
188 
189  inline void StoreOriginVertexTotalEnergy(G4double oetot) { originVertexTotalEnergy = oetot; }
190  inline G4double GetOriginVertexTotalEnergy() const {return originVertexTotalEnergy;}
191 
192  //---------------- LocalVertexKineticEnergy & TotalEnergy
193 
194  inline void StoreKineticEnergy(G4double ekin) { currentKineticEnergy = ekin; }
195  inline G4double GetKineticEnergy() const {return currentKineticEnergy;}
196 
197  inline void StoreTotalEnergy(G4double etot) { currentTotalEnergy = etot; }
198  inline G4double GetTotalEnergy() const {return currentTotalEnergy;}
199 
200  //----------------
201 
202  //inline void StorePrimaryQ2(G4double q2) { primaryQ2 = q2; }
203  //inline G4double GetPrimaryQ2() const {return primaryQ2;}
204 
205  //inline void StoreCrossSection(G4double cs) { crossSection = cs; }
206  //inline G4double GetCrossSection() const {return crossSection;}
207 
208  //inline void StoreCrossSectionWeight(G4double csw) { crossSectionWeight = csw; }
209  //inline G4double GetCrossSectionWeight() const {return crossSectionWeight;}
210 
211  //---------------- LocalThetaAngle & PhiAngle
212 
213  //inline void StoreGlobalThetaAngle(G4double gthetag) { globalThetaAngle = gthetag; }
214  //inline G4double GetGlobalThetaAngle() const {return globalThetaAngle;}
215 
216  //inline void StoreGlobalPhiAngle(G4double gphiag) { globalPhiAngle = gphiag; }
217  //inline G4double GetGlobalPhiAngle() const {return globalPhiAngle;}
218 
219  //--------------- LeadGlass deposited energy
220 
221  inline void StoreHitDepositedEnergy(G4double dpeg) { depositedEnergyHit = dpeg; }
222  inline G4double GetHitDepositedEnergy() const {return depositedEnergyHit;}
223 
224 
225  //---
226  inline void StoreCellPosition(G4ThreeVector xyz) { cellPos = xyz; }
227  inline G4ThreeVector GetCellPosition() const {return cellPos;}
228 
229  inline void StoreCellRotation(G4RotationMatrix rmat) { cellRot = rmat; }
230  inline G4RotationMatrix GetCellRotation() const {return cellRot;}
231 
232  inline void StoreLogVolume(G4LogicalVolume* val) { pLogV = val; }
233  inline const G4LogicalVolume* GetLogVolume() const {return pLogV;}
234 
235 
236 };
237 
238 
239 
240 /////// --------------------------------------------------------------------
241 
242 typedef G4THitsCollection<QweakSimLeadGlass_DetectorHit> QweakSimLeadGlass_DetectorHitsCollection;
243 
244 extern G4Allocator<QweakSimLeadGlass_DetectorHit> QweakSimLeadGlass_DetectorHitAllocator;
245 
246 
247 
248 /////// --------------------------------------------------------------------
249 
250 inline void* QweakSimLeadGlass_DetectorHit::operator new(size_t)
251 {
252  void* aHit;
253  aHit = (void*) QweakSimLeadGlass_DetectorHitAllocator.MallocSingle();
254  return aHit;
255 }
256 
257 
258 
259 /////// --------------------------------------------------------------------
260 
261 inline void QweakSimLeadGlass_DetectorHit::operator delete(void* aHit)
262 {
264 }
265 
266 
267 
268 /////// --------------------------------------------------------------------
269 
270 #endif
271 
272 /////// --------------------------------------------------------------------
273 
void StoreOriginVertexPosition(G4ThreeVector oxyz)
int operator==(const QweakSimLeadGlass_DetectorHit &right) const
G4ThreeVector GetOriginVertexMomentumDirection() const
void StoreOriginVertexMomentumDirection(G4ThreeVector opxyz)
G4THitsCollection< QweakSimLeadGlass_DetectorHit > QweakSimLeadGlass_DetectorHitsCollection
const G4LogicalVolume * GetLogVolume() const
const QweakSimLeadGlass_DetectorHit & operator=(const QweakSimLeadGlass_DetectorHit &right)
void StoreCellRotation(G4RotationMatrix rmat)
G4Allocator< QweakSimLeadGlass_DetectorHit > QweakSimLeadGlass_DetectorHitAllocator