File indexing completed on 2025-12-10 10:18:06
0001 #pragma once
0002
0003 #include <map>
0004
0005 #include "G4Object.h"
0006 #include "FlatSurface.h"
0007
0008 class G4DataInterpolation;
0009
0010 #include "IRT.h"
0011
0012 namespace IRT2 {
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), m_ScaleFactor(1.0),
0018 m_GeometricEfficiency(0.0), m_CopyIdentifierLevel(0) {};
0019 ~CherenkovPhotonDetector() {};
0020
0021 void SetQE(double min, double max, G4DataInterpolation *qe, double scale = 1.0) {
0022 m_QERangeMin = min;
0023 m_QERangeMax = max;
0024
0025 m_QE = qe;
0026 m_ScaleFactor = scale;
0027 };
0028
0029 inline bool CheckQERange(double e) const { return m_QE && e >= m_QERangeMin && e <= m_QERangeMax; };
0030 G4DataInterpolation *GetQE( void ) const { return m_QE; };
0031 double GetScaleFactor( void ) const { return m_ScaleFactor; };
0032 void SetGeometricEfficiency(double value) { m_GeometricEfficiency = value; };
0033 double GetGeometricEfficiency( void ) const { return m_GeometricEfficiency; };
0034
0035 void SetActiveAreaSize(double size) { m_ActiveAreaSize = size; };
0036 double GetActiveAreaSize( void ) const { return m_ActiveAreaSize; };
0037
0038 void SetCopyIdentifierLevel(unsigned lv) { m_CopyIdentifierLevel = lv; };
0039 unsigned GetCopyIdentifierLevel( void ) const { return m_CopyIdentifierLevel; };
0040
0041 void AddItselfToOpticalBoundaries(IRT *irt, ParametricSurface *surface) {
0042 auto boundary = new OpticalBoundary(0, surface, true);
0043 irt->AddOpticalBoundary(boundary);
0044
0045 m_OpticalBoundaryStorage.push_back(boundary);
0046 };
0047 IRT *AllocateIRT(unsigned sector, uint64_t icopy) {
0048 auto irt = new IRT();
0049
0050 if (m_IRT.find(std::make_pair(sector, icopy)) == m_IRT.end()) {
0051 std::vector<IRT*> ret;
0052 ret.push_back(irt);
0053 m_IRT[std::make_pair(sector,icopy)] = ret;
0054 } else
0055 m_IRT[std::make_pair(sector,icopy)].push_back(irt);
0056
0057 return irt;
0058 };
0059
0060
0061
0062
0063
0064 std::vector<IRT*> *GetIRTs(unsigned sector, uint64_t icopy) {
0065 return (m_IRT.find(std::make_pair(sector,icopy)) == m_IRT.end() ? 0 :
0066 &m_IRT[std::make_pair(sector, icopy)]);
0067 };
0068
0069 private:
0070
0071
0072 std::map<std::pair<unsigned,uint64_t>, std::vector<IRT*>> m_IRT;
0073
0074
0075 std::vector<OpticalBoundary*> m_OpticalBoundaryStorage;
0076
0077
0078
0079 double m_QERangeMin, m_QERangeMax;
0080 G4DataInterpolation *m_QE;
0081
0082
0083
0084
0085 double m_ScaleFactor;
0086
0087 double m_GeometricEfficiency;
0088
0089
0090 double m_ActiveAreaSize;
0091
0092 unsigned m_CopyIdentifierLevel;
0093
0094 #ifndef DISABLE_ROOT_IO
0095 ClassDef(CherenkovPhotonDetector, 7);
0096 #endif
0097 };
0098
0099 }