Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-07-05 07:06:40

0001 
0002 #include <map>
0003 
0004 #ifndef _CHERENKOV_PHOTON_DETECTOR_
0005 #define _CHERENKOV_PHOTON_DETECTOR_
0006 
0007 #include "G4Object.h"
0008 #include "ParametricSurface.h"
0009 
0010 class G4DataInterpolation;
0011 
0012 #include "IRT.h"
0013 
0014 class CherenkovPhotonDetector: public G4Object {
0015  public:
0016  CherenkovPhotonDetector(G4VSolid *solid = 0, G4Material *material = 0):
0017   G4Object(solid, material), m_QERangeMin(0.0), m_QERangeMax(0.0), m_QE(0), 
0018     m_GeometricEfficiency(0.0) {};
0019   ~CherenkovPhotonDetector() {};
0020 
0021   void SetQE(double min, double max, const G4DataInterpolation *qe) { 
0022     m_QERangeMin = min; 
0023     m_QERangeMax = max; 
0024 
0025     m_QE = qe; 
0026   };
0027 
0028   inline bool CheckQERange(double e) const { return m_QE && e >= m_QERangeMin && e <= m_QERangeMax; };
0029   const G4DataInterpolation *GetQE( void ) const { return m_QE; };
0030   void SetGeometricEfficiency(double value) { m_GeometricEfficiency = value; };
0031   double GetGeometricEfficiency( void ) const { return m_GeometricEfficiency; };
0032 
0033   void AddItselfToOpticalBoundaries(IRT *irt, ParametricSurface *surface) /*const*/ {
0034     auto boundary = new OpticalBoundary(0, surface, true);
0035     irt->AddOpticalBoundary(boundary);
0036 
0037     m_OpticalBoundaryStorage.push_back(boundary);
0038   };
0039   IRT *AllocateIRT(unsigned sector, uint64_t icopy) { 
0040     auto irt = new IRT(sector); _m_IRT[icopy] = irt; return irt; 
0041   };
0042   IRT *GetIRT(uint64_t icopy) { return (_m_IRT.find(icopy) == _m_IRT.end() ? 0 : _m_IRT[icopy]); };
0043 
0044  private:
0045   // One optical path for each clone (identified by a logical volume copy);
0046   std::map<uint64_t, IRT*> _m_IRT;
0047 
0048   // IRT has a TRef by (unfortunate) design -> need a serialized storage buffer to refer to;
0049   std::vector<OpticalBoundary*> m_OpticalBoundaryStorage;
0050 
0051   // NB: the actual getQE() method can not be in this class since it will require linking 
0052   // against GEANT libraries; that's fine;
0053   double m_QERangeMin, m_QERangeMax;  //!
0054   const G4DataInterpolation *m_QE;    //!
0055 
0056   double m_GeometricEfficiency;
0057 
0058 #ifndef DISABLE_ROOT_IO
0059   ClassDef(CherenkovPhotonDetector, 3);
0060 #endif
0061 };
0062 
0063 #endif