Skip to content
Snippets Groups Projects
CherenkovPhotonDetector.h 1.94 KiB
Newer Older
  • Learn to ignore specific revisions
  • Alexander Kiselev's avatar
    Alexander Kiselev committed
    
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
    #ifndef _CHERENKOV_PHOTON_DETECTOR_
    #define _CHERENKOV_PHOTON_DETECTOR_
    
    #include <G4Object.h>
    #include <ParametricSurface.h>
    
    class G4DataInterpolation;
    
    #include <IRT.h>
    
    class CherenkovPhotonDetector: public G4Object {
     public:
    
     CherenkovPhotonDetector(G4VSolid *solid = 0, G4Material *material = 0):
      G4Object(solid, material), m_QERangeMin(0.0), m_QERangeMax(0.0), m_QE(0), 
        m_GeometricEfficiency(0.0) {};
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
      ~CherenkovPhotonDetector() {};
    
      void SetQE(double min, double max, const G4DataInterpolation *qe) { 
        m_QERangeMin = min; 
        m_QERangeMax = max; 
    
        m_QE = qe; 
      };
    
      inline bool CheckQERange(double e) const { return m_QE && e >= m_QERangeMin && e <= m_QERangeMax; };
      const G4DataInterpolation *GetQE( void ) const { return m_QE; };
      void SetGeometricEfficiency(double value) { m_GeometricEfficiency = value; };
      double GetGeometricEfficiency( void ) const { return m_GeometricEfficiency; };
    
    
      void AddItselfToOpticalBoundaries(IRT *irt, ParametricSurface *surface) /*const*/ {
        auto boundary = new OpticalBoundary(0, surface, true);
    
        irt->AddOpticalBoundary(boundary);
    
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
      };
    
      IRT *AllocateIRT(unsigned sector, uint64_t icopy) { 
        auto irt = new IRT(sector); _m_IRT[icopy] = irt; return irt; 
      };
    
      IRT *GetIRT(uint64_t icopy) { return (_m_IRT.find(icopy) == _m_IRT.end() ? 0 : _m_IRT[icopy]); };
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
    
     private:
    
      // One optical path for each clone (identified by a logical volume copy);
    
      std::map<uint64_t, IRT*> _m_IRT;
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
    
    
      // IRT has a TRef by (unfortunate) design -> need a serialized storage buffer to refer to;
      std::vector<OpticalBoundary*> m_OpticalBoundaryStorage;
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
    
      // NB: the actual getQE() method can not be in this class since it will require linking 
      // against GEANT libraries; that's fine;
      double m_QERangeMin, m_QERangeMax;  //!
      const G4DataInterpolation *m_QE;    //!
    
      double m_GeometricEfficiency;
    
    
      ClassDef(CherenkovPhotonDetector, 3);
    
    Alexander Kiselev's avatar
    Alexander Kiselev committed
    };
    
    #endif