source: trunk/examples/novice/gemc/src/MSensitiveDetector.h@ 1336

Last change on this file since 1336 was 807, checked in by garnier, 17 years ago

update

File size: 2.3 KB
RevLine 
[807]1
2
3
4
5
6#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>
30using namespace std;
31
32
33class SDId
34{
35 public:
36 int id;
37 vector<string> IDnames;
38 vector<int> IDmaxs;
39 vector<int> IDshifts;
40 double minEnergy;
41 double TimeWindow;
42 double ProdThreshold;
43 double MaxStep;
44};
45
46class MTrackInfo
47{
48 public:
49 string pid;
50 G4ThreeVector v;
51};
52
53class MSensitiveDetector : public G4VSensitiveDetector
54{
55
56 public:
57 MSensitiveDetector(G4String, gemc_opts);
58 virtual ~MSensitiveDetector();
59
60 virtual void Initialize(G4HCofThisEvent*);
61 virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
62 virtual void EndOfEvent(G4HCofThisEvent*);
63
64 G4String HCname;
65 map<string, detector> *Hall_Map;
66 map<string, MPHB_Factory> *MProcessHit_Map;
67 set<vector<identifier> > Id_Set;
68 map<int, MTrackInfo> Tr_Map;
69
70 gemc_opts gemcOpt;
71 SDId SDID;
72
73 private:
74 MHitCollection *hitCollection;
75 int HCID;
76 double minEnergy;
77
78 public:
79 vector<identifier> GetDetectorIdentifier(string name) {return (*Hall_Map)[name].identity;}
80 string GetDetectorHitType(string name) {return (*Hall_Map)[name].hitType;}
81 int get_bit_compressed_id(vector<identifier>);
82 MHitCollection* GetMHitCollection() {return hitCollection;}
83 MHit* find_existing_hit(vector<identifier>);
84};
85
86SDId get_SDId(string, gemc_opts);
87
88#endif
89
90
91
92
93
94
95
96
97
98
Note: See TracBrowser for help on using the repository browser.