GGS(GenericGEANT4Simulation)Software  2.6.3
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSIntHitSD.h
Go to the documentation of this file.
1 /*
2  * GGSIntHitSD.h
3  *
4  * Created on: 2010-10-17
5  * Authors: Franz Longo
6  */
7 
10 #ifndef GGSINTHITSD_H
11 #define GGSINTHITSD_H
12 
13 #include "G4VSensitiveDetector.hh"
14 #include "globals.hh"
15 
16 class G4HCofThisEvent;
17 class G4Step;
19 
20 #include "GGSIntHit.h"
21 
28 class GGSIntHitSD: public G4VSensitiveDetector {
29 public:
30 
35  GGSIntHitSD(G4String name);
36 
38  ~GGSIntHitSD();
39 
44  void Initialize(G4HCofThisEvent* hitCollection);
45 
55  G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROHist);
56 
61  void EndOfEvent(G4HCofThisEvent* hitCollection);
62 
70  void SetTimeBin(G4double time) {
71  _timeBins.push_back(time);
72  std::sort(_timeBins.begin(), _timeBins.end());
73  }
74 
83  const std::vector<G4double>& GetTimeBins() {
84  return _timeBins;
85  }
86 
99  void SetPartHitsStorage(bool store) {
100  _storePartHits = store;
101  if (store == false) {
102  SetPosHitsStorage(false);
103  }
104  }
105 
111  return _storePartHits;
112  }
113 
126  void SetPosHitsStorage(bool store) {
127  _storePosHits = store;
128  if (store == true) {
129  SetPartHitsStorage(true);
130  }
131  }
132 
138  return _storePosHits;
139  }
140 
147  void SetIntHitThreshold(float minEnergy){
148  _intHitThreshold = minEnergy;
149  }
150 
157  void SetPartHitThreshold(float minEnergy){
158  _partHitThreshold = minEnergy;
159  }
160 
161 
168  void SetPosHitThreshold(float minEnergy){
169  _posHitThreshold = minEnergy;
170  }
171 
172 
173 private:
174 
175  GGSIntHitsCollection* _intHitCollection;
176  std::vector<G4double> _timeBins;
177  GGSIntHitSDMessenger *_messenger;
178  std::string _intHitClass, _partHitClass, _posHitClass;
179  bool _storePartHits;
180  bool _storePosHits;
181 
182  float _intHitThreshold, _partHitThreshold, _posHitThreshold;
183  GGSPartHit *_currPartHit;
184 };
185 
186 #endif /* GGSINTHITSD_H */
187 
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:28
void SetIntHitThreshold(float minEnergy)
Sets the minimum energy for integrated hits.
Definition: GGSIntHitSD.h:147
void SetTimeBin(G4double time)
Time bins setter.
Definition: GGSIntHitSD.h:70
void EndOfEvent(G4HCofThisEvent *hitCollection)
Sets the hits collection, as required by specifications of mother class.
void SetPartHitThreshold(float minEnergy)
Sets the minimum energy for particle hits.
Definition: GGSIntHitSD.h:157
void SetPosHitsStorage(bool store)
Turn on or off the storage (i.e. persistence) of position hits.
Definition: GGSIntHitSD.h:126
bool GetPosHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:137
Definition of GGS Particle Hit.
Definition: GGSPartHit.h:35
const std::vector< G4double > & GetTimeBins()
Time bins getter.
Definition: GGSIntHitSD.h:83
GGSIntHitSD(G4String name)
Constructor.
Definition: GGSIntHitSD.cpp:24
void Initialize(G4HCofThisEvent *hitCollection)
Initializes the sensitive detector.
void SetPartHitsStorage(bool store)
Turn on or off the storage (i.e. persistency) of particle hits.
Definition: GGSIntHitSD.h:99
bool GetPartHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:110
~GGSIntHitSD()
Destructor.
G4THitsCollection< GGSIntHit > GGSIntHitsCollection
Alias for G4 template hits collection for GGSIntHit.
Definition: GGSIntHit.h:272
void SetPosHitThreshold(float minEnergy)
Sets the minimum energy for position hits.
Definition: GGSIntHitSD.h:168
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROHist)
The hit processing method.
The integrated hit SD messenger class.