GGS(GenericGEANT4Simulation)Software  2.6.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;
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 
141 private:
142 
143  GGSIntHitsCollection* _intHitCollection;
144  std::vector<G4double> _timeBins;
145  GGSIntHitSDMessenger *_messenger;
146  std::string _intHitClass, _partHitClass, _posHitClass;
147  bool _storePartHits;
148  bool _storePosHits;
149 };
150 
151 #endif /* GGSINTHITSD_H */
152 
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:28
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 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
const std::vector< G4double > & GetTimeBins()
Time bins getter.
Definition: GGSIntHitSD.h:83
GGSIntHitSD(G4String name)
Constructor.
Definition: GGSIntHitSD.cpp:22
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.
Definition: GGSIntHitSD.cpp:99
G4THitsCollection< GGSIntHit > GGSIntHitsCollection
Alias for G4 template hits collection for GGSIntHit.
Definition: GGSIntHit.h:272
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROHist)
The hit processing method.
The integrated hit SD messenger class.