00001 00007 #ifndef DSPMTSENSDET_H 00008 #define DSPMTSENSDET_H 00009 00010 #include "G4DataHelpers/G4DhHit.h" 00011 00012 #include "GiGa/GiGaSensDetBase.h" 00013 #include "GaudiKernel/RndmGenerators.h" 00014 00015 #include "G4OpticalPhoton.hh" 00016 00017 #include <string> 00018 #include <map> 00019 00020 namespace DayaBay { 00021 class SimPmtHit; 00022 } 00023 class ITouchableToDetectorElement; 00024 class DetectorElement; 00025 00026 class DsPmtSensDet : public GiGaSensDetBase { 00027 public: 00028 DsPmtSensDet(const std::string& type, 00029 const std::string& name, 00030 const IInterface* parent); 00031 virtual ~DsPmtSensDet(); 00032 00033 // G4VSensitiveDetector interface 00034 virtual void Initialize( G4HCofThisEvent* HCE ) ; 00035 virtual void EndOfEvent( G4HCofThisEvent* HCE ) ; 00036 virtual bool ProcessHits(G4Step* step, 00037 G4TouchableHistory* history); 00038 00039 // Tool interface 00040 virtual StatusCode initialize(); 00041 virtual StatusCode finalize(); 00042 00043 private: 00045 00048 std::vector<std::string> m_cathodeLogVols; 00049 00052 std::vector<std::string> m_sensorStructures; 00053 00057 std::string m_idParameter; 00058 00061 std::string m_t2deName; 00062 ITouchableToDetectorElement* m_t2de; 00063 00068 double m_qeScale; 00069 00073 bool m_applyPreQE; 00074 double m_preQE; 00075 00078 std::string m_qeffParamName; 00079 00083 bool m_preserveWeight; 00084 00085 // Store hit in a hit collection 00086 void StoreHit(DayaBay::SimPmtHit* hit, int trackid); 00087 00088 // lookup DE from touchable history 00089 const DetectorElement* SensDetElem(const G4TouchableHistory& hist); 00090 // lookup ID from DE or daughter DE 00091 int SensDetId(const DetectorElement& de); 00092 // lookup QE from LV or daughter LV 00093 double SensDetQE(G4LogicalVolume* logvol, double energy); 00094 00095 typedef std::map<short int,G4DhHitCollection*> LocalHitCache; 00096 LocalHitCache m_hc; 00097 00098 Rndm::Numbers m_uni; 00099 }; 00100 00101 00102 #endif // DSPMTSENSDET_H