File indexing completed on 2025-01-18 09:55:45
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <DD4hep/DetElement.h>
0008 #include <DD4hep/Detector.h>
0009 #include <DD4hep/Objects.h>
0010 #include <DDRec/CellIDPositionConverter.h>
0011 #include <DDRec/DetectorData.h>
0012 #include <IRT/CherenkovDetector.h>
0013 #include <IRT/CherenkovDetectorCollection.h>
0014 #include <Math/GenVector/Cartesian3D.h>
0015 #include <Math/GenVector/DisplacementVector3D.h>
0016 #include <spdlog/logger.h>
0017 #include <gsl/pointers>
0018 #include <memory>
0019 #include <string>
0020 #include <unordered_map>
0021
0022
0023 #include "RichGeo.h"
0024
0025 namespace richgeo {
0026 class IrtGeo {
0027 public:
0028
0029
0030 IrtGeo(std::string detName_, gsl::not_null<const dd4hep::Detector*> det_, gsl::not_null<const dd4hep::rec::CellIDPositionConverter*> conv_, std::shared_ptr<spdlog::logger> log_);
0031 virtual ~IrtGeo();
0032
0033
0034 CherenkovDetectorCollection *GetIrtDetectorCollection() { return m_irtDetectorCollection; }
0035
0036 protected:
0037
0038
0039 virtual void DD4hep_to_IRT() = 0;
0040 void SetReadoutIDToPositionLambda();
0041 void SetRefractiveIndexTable();
0042
0043 template<class VecT>
0044 VecT GetVectorFromVariantParameters(dd4hep::rec::VariantParameters *pars, std::string key) {
0045 return VecT(pars->get<double>(key+"_x"), pars->get<double>(key+"_y"), pars->get<double>(key+"_z"));
0046 }
0047
0048
0049 std::string m_detName;
0050
0051
0052 gsl::not_null<const dd4hep::Detector*> m_det;
0053 dd4hep::DetElement m_detRich;
0054 dd4hep::Position m_posRich;
0055
0056
0057 gsl::not_null<const dd4hep::rec::CellIDPositionConverter*> m_converter;
0058 std::unordered_map<int,richgeo::Sensor> m_sensor_info;
0059
0060
0061 CherenkovDetectorCollection *m_irtDetectorCollection;
0062 CherenkovDetector *m_irtDetector;
0063
0064
0065 std::shared_ptr<spdlog::logger> m_log;
0066
0067 private:
0068
0069
0070 void Bind();
0071 };
0072 }