GGS(GenericGEANT4Simulation)Software  2.7.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 "G4Allocator.hh"
14 #include "G4Step.hh"
15 #include "G4THitsCollection.hh"
16 #include "G4ThreeVector.hh"
17 #include "G4VHit.hh"
18 #include "G4VPhysicalVolume.hh"
19 
20 #include "utils/GGSMiscUtils.h"
21 
22 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
23 
33 class GGSPosHit : public G4VHit {
34 public:
36  GGSPosHit();
37 
39  ~GGSPosHit();
40 
45  GGSPosHit(const GGSPosHit &right);
46 
52  const GGSPosHit &operator=(const GGSPosHit &right);
53 
59  bool operator==(const GGSPosHit &right) const;
60 
68  inline void *operator new(size_t size);
69 
77  inline void operator delete(void *);
78 
83  inline void SetEnergyDeposit(G4double eDep) { _eDep = eDep; }
84 
89  inline void SetTime(G4double time) { _time = time; }
90 
95  inline void SetPathLength(G4double path) { _pathLength = path; }
96 
103  inline void SetStartPoint(G4ThreeVector pos) { _startPoint = pos; }
104 
112  inline void SetEndPoint(G4ThreeVector pos) { _endPoint = pos; }
113 
120  inline void SetStartMomentum(G4ThreeVector mom) { _startMomentum = mom; }
121 
126  inline void SetStartEnergy(G4double e) { _startEnergy = e; }
127 
132  inline G4double GetEnergyDeposit() const { return _eDep; }
133 
138  inline G4double GetTime() const { return _time; }
139 
144  inline G4double GetPathLength() const { return _pathLength; }
145 
152  inline G4ThreeVector GetStartPoint() const { return _startPoint; }
153 
160  inline G4ThreeVector GetEndPoint() const { return _endPoint; }
161 
168  inline G4ThreeVector GetStartMomentum() const { return _startMomentum; }
169 
174  inline G4double GetStartEnergy() const { return _startEnergy; }
175 
180  virtual void SetStep(const G4Step &step);
181 
182 protected:
183  G4double _eDep; // Energy deposited
184  G4double _time; // Time of the hit
185  G4double _pathLength; // PathLength of the Hit
186  G4ThreeVector _startPoint; // Step start point Point
187  G4ThreeVector _endPoint; // Step end point
188  G4ThreeVector _startMomentum; // Momentum at step start
189  G4double _startEnergy; // Energy at step start
190 };
191 
192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
194 typedef G4THitsCollection<GGSPosHit> GGSPosHitsCollection;
195 
197 extern G4Allocator<GGSPosHit> GGSPosHitAllocator;
198 
199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
200 
201 inline void *GGSPosHit::operator new(size_t) {
202  void *aHit;
203  aHit = (void *)GGSPosHitAllocator.MallocSingle();
204  return aHit;
205 }
206 
207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
208 
209 inline void GGSPosHit::operator delete(void *aHit) { GGSPosHitAllocator.FreeSingle((GGSPosHit *)aHit); }
210 
211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
212 
213 #include "utils/GGSFactory.h"
214 
217 
218 #define RegisterPosHit(className) \
219  GGSPosHit *className##Builder() { return new className(); } \
220  class className##Proxy { \
221  public: \
222  className##Proxy() { GGSPosHitFactory::GetInstance().RegisterBuilder(#className, className##Builder); } \
223  }; \
224  className##Proxy proxyFor##className
225 #endif /* GGSPOSHIT_H */
G4THitsCollection< GGSPosHit > GGSPosHitsCollection
Alias for G4 template hits collection for GGSPosHit.
Definition: GGSPosHit.h:194
G4double GetPathLength() const
Path length getter.
Definition: GGSPosHit.h:144
void SetStartEnergy(G4double e)
Start energy setter.
Definition: GGSPosHit.h:126
GGSPosHit()
Constructor.
Definition: GGSPosHit.cpp:12
bool operator==(const GGSPosHit &right) const
Comparison operator.
Definition: GGSPosHit.cpp:49
G4double GetStartEnergy() const
Start energy getter.
Definition: GGSPosHit.h:174
~GGSPosHit()
Destructor.
Definition: GGSPosHit.cpp:18
const GGSPosHit & operator=(const GGSPosHit &right)
Assignment operator.
Definition: GGSPosHit.cpp:34
G4ThreeVector GetStartPoint() const
Start point getter.
Definition: GGSPosHit.h:152
G4ThreeVector GetStartMomentum() const
Momentum getter.
Definition: GGSPosHit.h:168
Definition of GGS Position Hit.
Definition: GGSPosHit.h:33
void SetEnergyDeposit(G4double eDep)
Energy deposit setter.
Definition: GGSPosHit.h:83
virtual void SetStep(const G4Step &step)
Definition: GGSPosHit.cpp:60
Template factory class.
Definition: GGSFactory.h:29
G4double GetEnergyDeposit() const
Energy release getter.
Definition: GGSPosHit.h:132
G4ThreeVector GetEndPoint() const
End point getter.
Definition: GGSPosHit.h:160
void SetStartPoint(G4ThreeVector pos)
Start point setter.
Definition: GGSPosHit.h:103
void SetEndPoint(G4ThreeVector pos)
End point setter.
Definition: GGSPosHit.h:112
void SetPathLength(G4double path)
Path length setter.
Definition: GGSPosHit.h:95
G4Allocator< GGSPosHit > GGSPosHitAllocator
Alias for G4 template memory allocator for GGSPosHit.
Definition: GGSPosHit.cpp:7
void SetTime(G4double time)
Time setter.
Definition: GGSPosHit.h:89
void SetStartMomentum(G4ThreeVector mom)
Start momentum setter.
Definition: GGSPosHit.h:120
G4double GetTime() const
Time getter.
Definition: GGSPosHit.h:138