GGS(GenericGEANT4Simulation)Software  2.7.0
 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;
20 
21 #include "GGSIntHit.h"
22 
29 class GGSIntHitSD : public G4VSensitiveDetector {
30 public:
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() { return _timeBins; }
84 
97  void SetPartHitsStorage(bool store) {
98  _storePartHits = store;
99  if (store == false) {
100  SetPosHitsStorage(false);
101  }
102  }
103 
111  void SetTouchableIDComputer(const std::string &tidcClassName);
112 
117  bool GetPartHitsStorage() { return _storePartHits; }
118 
131  void SetPosHitsStorage(bool store) {
132  _storePosHits = store;
133  if (store == true) {
134  SetPartHitsStorage(true);
135  }
136  }
137 
142  bool GetPosHitsStorage() { return _storePosHits; }
143 
150  void SetIntHitThreshold(float minEnergy) { _intHitThreshold = minEnergy; }
151 
158  void SetPartHitThreshold(float minEnergy) { _partHitThreshold = minEnergy; }
159 
166  void SetPosHitThreshold(float minEnergy) { _posHitThreshold = minEnergy; }
167 
168 private:
169  GGSIntHitsCollection *_intHitCollection;
170  std::vector<G4double> _timeBins;
171  GGSIntHitSDMessenger *_messenger;
172  std::string _intHitClass, _partHitClass, _posHitClass;
173  bool _storePartHits;
174  bool _storePosHits;
175  std::unique_ptr<GGSTouchableIDComputer> _idComputer;
176  float _intHitThreshold, _partHitThreshold, _posHitThreshold;
177  GGSPartHit *_currPartHit;
178 };
179 
180 #endif /* GGSINTHITSD_H */
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:29
void SetIntHitThreshold(float minEnergy)
Sets the minimum energy for integrated hits.
Definition: GGSIntHitSD.h:150
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:158
void SetPosHitsStorage(bool store)
Turn on or off the storage (i.e. persistence) of position hits.
Definition: GGSIntHitSD.h:131
bool GetPosHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:142
Definition of GGS Particle Hit.
Definition: GGSPartHit.h:36
const std::vector< G4double > & GetTimeBins()
Time bins getter.
Definition: GGSIntHitSD.h:83
GGSIntHitSD(G4String name)
Constructor.
Definition: GGSIntHitSD.cpp:23
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:97
bool GetPartHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:117
~GGSIntHitSD()
Destructor.
G4THitsCollection< GGSIntHit > GGSIntHitsCollection
Alias for G4 template hits collection for GGSIntHit.
Definition: GGSIntHit.h:256
void SetPosHitThreshold(float minEnergy)
Sets the minimum energy for position hits.
Definition: GGSIntHitSD.h:166
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROHist)
The hit processing method.
The integrated hit SD messenger class.
Interface for volume ID calculator classes.
void SetTouchableIDComputer(const std::string &tidcClassName)
Sets the touchable ID computer class.