00001 #ifndef SensitiveDetector_h 00002 #define SensitiveDetector_h 1 00003 00004 #include "G4VSensitiveDetector.hh" 00005 class DetectorConstruction; 00006 class RunAction; 00007 00008 // -- addition for jour4b2: 00009 #include "AstroHit.hh" // <<- the hit "format" we define 00010 #include "AstroHitCollection.hh" // <<- our collection format of above hits 00011 class G4HCofThisEvent; // <<- means "H(it) C(ollections) of This Event" 00012 00013 00014 class SensitiveDetector : public G4VSensitiveDetector 00015 { 00016 public: 00017 SensitiveDetector(G4String SDname); 00018 ~SensitiveDetector(); 00019 00020 public: 00021 // --------- methods from base class G4VSensitiveDetector ---------- 00022 // -- Mandatory base class method : it must to be overloaded: 00023 G4bool ProcessHits(G4Step *step, G4TouchableHistory *ROhist); 00024 // ------------------------- 00025 // unused in these examples 00026 // -- (optional) methods of base class G4VSensitiveDetector 00027 // -- used in this jour4b2 example: 00028 void Initialize(G4HCofThisEvent* HCE); 00029 void EndOfEvent(G4HCofThisEvent* HCE); 00030 // ----------------------------------------------------------------- 00031 00032 private: 00033 DetectorConstruction* m_detector; 00034 RunAction* m_runAction; 00035 00036 AstroHitCollection* m_hitCollection; 00037 G4int m_nbSlices; 00038 G4double m_sliceWidth; 00039 std::vector<G4int> m_hitIndex; 00040 }; 00041 00042 #endif