GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTHits.h
Go to the documentation of this file.
1 /*
2  * GGSTHits.h
3  *
4  * Created on: 17 Aug 2011
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSTHITS_H_
11 #define GGSTHITS_H_
12 
13 #include "TString.h"
14 #include "TClonesArray.h"
15 #include "TArrayF.h"
16 
17 class GGSTHitsReader;
18 class GGSHitsAction;
19 class GGSPosHit;
20 class GGSPartHit;
21 class GGSIntHit;
22 
23 // Utility for suppressing compiler warnings about unused variables.
24 template<class T> void IGNORE(const T&) {
25 }
26 
34 class GGSTPosHit: public TObject {
35 
36 public:
37  Float_t eDep;
38  Float_t time;
39  Float_t pathLength;
40  Float_t startPoint[3];
41  Float_t endPoint[3];
42  Float_t startMomentum[3];
43  Float_t startEnergy;
44 
46  GGSTPosHit();
47 
49  const GGSTPosHit& operator=(const GGSTPosHit&);
50 
57  void Clear(Option_t *);
58 
67  virtual void UserConversion(const GGSPosHit &posHit) {
68  IGNORE(posHit);
69  }
70 
71 ClassDef(GGSTPosHit,2)
72 
73 };
74 
82 class GGSTPartHit: public TObject {
83 
84 public:
85  Float_t eDep;
86  Float_t time;
87  Float_t pathLength;
88  Float_t entrancePoint[3];
89  Float_t exitPoint[3];
90  Float_t entranceMomentum[3];
91  Float_t entranceEnergy;
92  Int_t trackID;
93  Int_t parentID;
94  Int_t particlePdg;
95 
97  GGSTPartHit();
98 
100  ~GGSTPartHit();
101 
102  /* @brief Assignment operator. */
103  //const GGSTPartHit& operator=(const GGSTPartHit&); // Commented: see .cpp
110  void Clear(Option_t *);
111 
120  virtual void UserConversion(const GGSPartHit &partHit) {
121  IGNORE(partHit);
122  }
123 
125  void DumpHit();
126 
131  Int_t GetNPosHits();
132 
138  GGSTPosHit *GetPosHit(unsigned int iHit);
139 
140 private:
141  friend class GGSHitsAction; // Friend class to fill private properties during MC simulation
142  friend class GGSTHitsReader; // Friend class to fill transient private properties while reading the hit
143  TClonesArray *_posHits;
144  UInt_t _posHitIndex;
145 
146 ClassDef(GGSTPartHit,3)
147 
148 };
149 
151 #include "montecarlo/dataobjs/GGSTHitVolInfo.h"
152 
160 class GGSTIntHit: public TObject {
161 
162 public:
164  Float_t eDep;
165  TArrayF eDepTimeBin;
166  Float_t time;
167 
169  GGSTIntHit();
170 
172  ~GGSTIntHit();
173 
174  /* @brief Assignment operator. */
175  //const GGSTIntHit& operator=(const GGSTIntHit&); // Commented: see .cpp
182  void Clear(Option_t *);
183 
192  virtual void UserConversion(const GGSIntHit &intHit) {
193  IGNORE(intHit);
194  }
195 
200  const TString& GetDetectorName() {
201  static const TString nullString("");
202  if (_hitDetInfo)
203  return _hitDetInfo->detectorName;
204  else
205  return nullString;
206  }
207 
214  const TArrayF& GetTimeBins() {
215  return *_timeBins;
216  }
217 
222  const TString& GetVolumeName() {
223  static const TString nullString("");
224  if (_hitVolInfo)
225  return _hitVolInfo->volumeName;
226  else
227  return nullString;
228  }
229 
234  const Float_t *GetVolumePosition() {
235  if (_hitVolInfo)
236  return _hitVolInfo->volumePos;
237  else
238  return NULL;
239  }
240 
245  Int_t GetVolumeID() {
246  if (_hitVolInfo)
247  return _hitVolInfo->id;
248  else
249  return -1;
250  }
251 
256  Int_t GetNPartHits();
257 
263  GGSTPartHit *GetPartHit(unsigned int iHit);
264 
265 private:
266 
267  friend class GGSHitsAction; // Friend class to fill private properties during MC simulation
268  friend class GGSTHitsReader; // Friend class to fill transient private properties while reading the hit
269  UInt_t _volumeIndex;
270  TClonesArray *_partHits;
271  GGSTHitDetInfo *_hitDetInfo;
272  GGSTHitVolInfo *_hitVolInfo;
273  TArrayF *_timeBins;
274 
275 ClassDef(GGSTIntHit,2)
276 
277 };
278 
279 #endif /* GGSTHITS_H_ */
Float_t volumePos[3]
Position of the touchable in world volume coordinates [cm].
GGSTPartHit()
Constructor.
Definition: GGSTHits.cpp:72
Float_t startMomentum[3]
Start momentum.
Definition: GGSTHits.h:42
Float_t eDep
Total deposited energy.
Definition: GGSTHits.h:37
~GGSTIntHit()
Destructor.
Definition: GGSTHits.cpp:199
Int_t id
ID of the volume.
Class for reading output of GGSHitsAction.
Float_t time
Time of the hit.
Definition: GGSTHits.h:38
virtual void UserConversion(const GGSPosHit &posHit)
Hook for user-defined conversion.
Definition: GGSTHits.h:67
const TArrayF & GetTimeBins()
Retrieves the time bins for the hit.
Definition: GGSTHits.h:214
Class to store detector informations.
GGSTIntHit()
Constructor.
Definition: GGSTHits.cpp:193
const Float_t * GetVolumePosition()
Retrieves the position of the volume associated to the hit.
Definition: GGSTHits.h:234
void DumpHit()
Prints members values on standard output.
Definition: GGSTHits.cpp:146
void Clear(Option_t *)
Resets data members.
Definition: GGSTHits.cpp:31
GGSTPosHit * GetPosHit(unsigned int iHit)
Get the specified position hit.
Definition: GGSTHits.cpp:175
Float_t pathLength
Path length of the hit.
Definition: GGSTHits.h:39
Int_t GetVolumeID()
Retrieves the ID of the volume associated to the hit.
Definition: GGSTHits.h:245
Float_t eDep
Deposited energy (transient).
Definition: GGSTHits.h:164
Float_t startEnergy
Start kinetic energy.
Definition: GGSTHits.h:43
Float_t entranceEnergy
Entrance kinetic energy.
Definition: GGSTHits.h:91
Float_t entrancePoint[3]
Entrance point.
Definition: GGSTHits.h:88
Float_t time
Time of the hit.
Definition: GGSTHits.h:86
Float_t pathLength
Path length of the hit.
Definition: GGSTHits.h:87
Class to store G4 particle hits.
Definition: GGSTHits.h:82
Int_t trackID
GEANT4 track ID.
Definition: GGSTHits.h:92
void Clear(Option_t *)
Resets data members.
Definition: GGSTHits.cpp:91
virtual void UserConversion(const GGSIntHit &intHit)
Hook for user-defined conversion.
Definition: GGSTHits.h:192
Definition of GGS Particle Hit.
Definition: GGSPartHit.h:35
Definition of GGS Position Hit.
Definition: GGSPosHit.h:31
~GGSTPartHit()
Destructor.
Definition: GGSTHits.cpp:83
Float_t time
Time of the hit (in ns).
Definition: GGSTHits.h:166
Float_t eDep
Deposited energy.
Definition: GGSTHits.h:85
void Clear(Option_t *)
Resets data members.
Definition: GGSTHits.cpp:207
const GGSTPosHit & operator=(const GGSTPosHit &)
Assignment operator.
Definition: GGSTHits.cpp:43
Int_t GetNPartHits()
Gets the number of particle hits.
Definition: GGSTHits.cpp:239
Class to store G4 position hits.
Definition: GGSTHits.h:34
TArrayF eDepTimeBin
Energy deposit in each time bin.
Definition: GGSTHits.h:165
virtual void UserConversion(const GGSPartHit &partHit)
Hook for user-defined conversion.
Definition: GGSTHits.h:120
Class to store G4 position hits.
Definition: GGSTHits.h:160
const TString & GetDetectorName()
Retrieves the name of the detector associated to the hit.
Definition: GGSTHits.h:200
An action which saves hits in sensitive volumes on ROOT file.
Definition: GGSHitsAction.h:63
Int_t particlePdg
Particle PDG ID.
Definition: GGSTHits.h:94
TString volumeName
Name of the physical volume.
Definition of GGS Integrated Hit.
Definition: GGSIntHit.h:31
const TString & GetVolumeName()
Retrieves the name of the volume associated to the hit.
Definition: GGSTHits.h:222
Float_t startPoint[3]
Start point.
Definition: GGSTHits.h:40
GGSTPosHit()
Constructor.
Definition: GGSTHits.cpp:21
Float_t exitPoint[3]
Exit point.
Definition: GGSTHits.h:89
GGSTHitVolInfo.h GGSTHitVolInfo class declaration.
TString detectorName
Name of detector associated to integrated hits.
Int_t GetNPosHits()
Gets the number of position hits.
Definition: GGSTHits.cpp:166
Int_t parentID
GEANT4 parent ID.
Definition: GGSTHits.h:93
Float_t entranceMomentum[3]
Entrance momentum.
Definition: GGSTHits.h:90
GGSTPartHit * GetPartHit(unsigned int iHit)
Get the specified particle hit.
Definition: GGSTHits.cpp:248
Float_t endPoint[3]
End point.
Definition: GGSTHits.h:41