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