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