GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSPosHit.h
Go to the documentation of this file.
1 /*
2  * GGSPosHit.h
3  *
4  * Created on: 2010-10-17
5  * Authors: Franz Longo , Elena Vannuccini
6  */
7 
10 #ifndef GGSPOSHIT_H
11 #define GGSPOSHIT_H
12 
13 #include "G4VHit.hh"
14 #include "G4THitsCollection.hh"
15 #include "G4Allocator.hh"
16 #include "G4ThreeVector.hh"
17 #include "G4VPhysicalVolume.hh"
18 #include "G4Step.hh"
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
21 
31 class GGSPosHit: public G4VHit {
32 public:
33 
35  GGSPosHit();
36 
38  ~GGSPosHit();
39 
44  GGSPosHit(const GGSPosHit& right);
45 
51  const GGSPosHit& operator=(const GGSPosHit& right);
52 
58  bool operator==(const GGSPosHit& right) const;
59 
67  inline void* operator new(size_t size);
68 
76  inline void operator delete(void*);
77 
82  inline void SetEnergyDeposit(G4double eDep) {
83  _eDep = eDep;
84  }
85 
90  inline void SetTime(G4double time) {
91  _time = time;
92  }
93 
98  inline void SetPathLength(G4double path) {
99  _pathLength = path;
100  }
101 
108  inline void SetStartPoint(G4ThreeVector pos) {
109  _startPoint = pos;
110  }
111 
119  inline void SetEndPoint(G4ThreeVector pos) {
120  _endPoint = pos;
121  }
122 
129  inline void SetStartMomentum(G4ThreeVector mom) {
130  _startMomentum = mom;
131  }
132 
137  inline void SetStartEnergy(G4double e) {
138  _startEnergy = e;
139  }
140 
145  inline G4double GetEnergyDeposit() const {
146  return _eDep;
147  }
148 
153  inline G4double GetTime() const {
154  return _time;
155  }
156 
161  inline G4double GetPathLength() const {
162  return _pathLength;
163  }
164 
171  inline G4ThreeVector GetStartPoint() const {
172  return _startPoint;
173  }
174 
181  inline G4ThreeVector GetEndPoint() const {
182  return _endPoint;
183  }
184 
191  inline G4ThreeVector GetStartMomentum() const {
192  return _startMomentum;
193  }
194 
199  inline G4double GetStartEnergy() const {
200  return _startEnergy;
201  }
202 
207  virtual void SetStep(const G4Step &step);
208 
209 protected:
210 
211  G4double _eDep; // Energy deposited
212  G4double _time; // Time of the hit
213  G4double _pathLength; // PathLength of the Hit
214  G4ThreeVector _startPoint; // Step start point Point
215  G4ThreeVector _endPoint; // Step end point
216  G4ThreeVector _startMomentum; // Momentum at step start
217  G4double _startEnergy; // Energy at step start
218 
219 };
220 
221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
223 typedef G4THitsCollection<GGSPosHit> GGSPosHitsCollection;
224 
226 extern G4Allocator<GGSPosHit> GGSPosHitAllocator;
227 
228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
229 
230 inline void* GGSPosHit::operator new(size_t) {
231  void* aHit;
232  aHit = (void*) GGSPosHitAllocator.MallocSingle();
233  return aHit;
234 }
235 
236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
237 
238 inline void GGSPosHit::operator delete(void* aHit) {
239  GGSPosHitAllocator.FreeSingle((GGSPosHit*) aHit);
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
243 
244 #include "utils/GGSFactory.h"
245 
248 
249 #define RegisterPosHit(className) \
250  GGSPosHit* className##Builder(){ \
251  return new className(); \
252  }\
253  class className##Proxy{ \
254  public: \
255  className##Proxy(){ \
256  GGSPosHitFactory::GetInstance().RegisterBuilder(#className, className##Builder); \
257  } \
258  };\
259  className##Proxy proxyFor##className
260 #endif /* GGSPOSHIT_H */
261 
G4THitsCollection< GGSPosHit > GGSPosHitsCollection
Alias for G4 template hits collection for GGSPosHit.
Definition: GGSPosHit.h:223
G4double GetPathLength() const
Path length getter.
Definition: GGSPosHit.h:161
void SetStartEnergy(G4double e)
Start energy setter.
Definition: GGSPosHit.h:137
GGSPosHit()
Constructor.
Definition: GGSPosHit.cpp:12
bool operator==(const GGSPosHit &right) const
Comparison operator.
Definition: GGSPosHit.cpp:53
G4double GetStartEnergy() const
Start energy getter.
Definition: GGSPosHit.h:199
~GGSPosHit()
Destructor.
Definition: GGSPosHit.cpp:20
const GGSPosHit & operator=(const GGSPosHit &right)
Assignment operator.
Definition: GGSPosHit.cpp:38
G4ThreeVector GetStartPoint() const
Start point getter.
Definition: GGSPosHit.h:171
G4ThreeVector GetStartMomentum() const
Momentum getter.
Definition: GGSPosHit.h:191
Definition of GGS Position Hit.
Definition: GGSPosHit.h:31
void SetEnergyDeposit(G4double eDep)
Energy deposit setter.
Definition: GGSPosHit.h:82
virtual void SetStep(const G4Step &step)
Definition: GGSPosHit.cpp:65
Template factory class.
Definition: GGSFactory.h:30
G4double GetEnergyDeposit() const
Energy release getter.
Definition: GGSPosHit.h:145
G4ThreeVector GetEndPoint() const
End point getter.
Definition: GGSPosHit.h:181
void SetStartPoint(G4ThreeVector pos)
Start point setter.
Definition: GGSPosHit.h:108
void SetEndPoint(G4ThreeVector pos)
End point setter.
Definition: GGSPosHit.h:119
void SetPathLength(G4double path)
Path length setter.
Definition: GGSPosHit.h:98
G4Allocator< GGSPosHit > GGSPosHitAllocator
Alias for G4 template memory allocator for GGSPosHit.
Definition: GGSPosHit.cpp:7
void SetTime(G4double time)
Time setter.
Definition: GGSPosHit.h:90
void SetStartMomentum(G4ThreeVector mom)
Start momentum setter.
Definition: GGSPosHit.h:129
G4double GetTime() const
Time getter.
Definition: GGSPosHit.h:153