GEMC  1.8
Geant4 Monte-Carlo Framework
MSensitiveDetector.h
Go to the documentation of this file.
1 #ifndef MSensitiveDetector_H
7 #define MSensitiveDetector_H 1
8 
9 // %%%%%%%%%%
10 // G4 headers
11 // %%%%%%%%%%
12 #include "G4VSensitiveDetector.hh"
13 #include "G4Step.hh"
14 #include "G4HCofThisEvent.hh"
15 #include "G4TouchableHistory.hh"
16 
17 // %%%%%%%%%%%%%
18 // gemc headers
19 // %%%%%%%%%%%%%
20 #include "detector.h"
21 #include "MHit.h"
22 #include "MPHBaseClass.h"
23 
24 // %%%%%%%%%%%
25 // C++ headers
26 // %%%%%%%%%%%
27 #include <iostream>
28 #include <string>
29 #include <set>
30 using namespace std;
31 
32 
40 class SDId
41 {
42  public:
43  int id;
44  vector<string> IDnames;
45  double minEnergy;
46  double TimeWindow;
47  double ProdThreshold;
48  double MaxStep;
49 };
50 
51 
61 {
62  public:
63  MSensitiveDetector(G4String, gemc_opts);
64  virtual ~MSensitiveDetector();
65 
66  virtual void Initialize(G4HCofThisEvent*);
67  virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
68  virtual void EndOfEvent(G4HCofThisEvent*);
69 
70  G4String HCname;
71  map<string, detector> *Hall_Map;
72  map<string, MPHB_Factory> *MProcessHit_Map;
73  set<vector<identifier> > Id_Set;
74 
77 
78  private:
79  MHitCollection *hitCollection;
80  MPHBaseClass *ProcessHitRoutine;
81  int HCID;
82  double minEnergy;
83 
84  string hd_msg1;
85  string hd_msg2;
86  string hd_msg3;
87  string catch_v;
88  double HIT_VERBOSITY;
89  double RECORD_PASSBY;
90  double RECORD_MIRROR;
91 
92 
93  public:
94  vector<identifier> GetDetectorIdentifier(string name) {return (*Hall_Map)[name].identity;}
95  string GetDetectorHitType(string name) {return (*Hall_Map)[name].hitType;}
96  MHitCollection* GetMHitCollection() {if(hitCollection) return hitCollection; else return NULL;}
97  MHit* find_existing_hit(vector<identifier>);
98 };
99 
100 SDId get_SDId(string, gemc_opts);
101 
102 #endif
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
SDId SDID
SDId used for identification.
int id
Sensitive Detector identifier. This is also the bank ID.
double ProdThreshold
Production Threshold in the detector.
STL namespace.
double TimeWindow
If two steps happens withing the same TimeWindow, they belong to the same Hit.
map< string, MPHB_Factory > * MProcessHit_Map
Hit Process Routine Factory Map.
G4THitsCollection< MHit > MHitCollection
Definition: MHit.h:134
map< string, detector > * Hall_Map
detector map
vector< string > IDnames
Identifier names as they should be in identifier.
gemc_opts gemcOpt
gemc option class
double minEnergy
Minimum energy of the hit to be recorded in the output stream.
Definition: MHit.h:29
MHitCollection * GetMHitCollection()
returns hit collection
double MaxStep
Maximum Acceptable Step in the detector.
G4String HCname
Sensitive Detector/Hit Collection Name.
string GetDetectorHitType(string name)
returns detector hitType
set< vector< identifier > > Id_Set
Identifier Set. Used to determine if a step is inside a new/existing element.
vector< identifier > GetDetectorIdentifier(string name)
returns detector identity
SDId get_SDId(string, gemc_opts)
Connects to DB and retrieve SDId.