File indexing completed on 2025-09-17 08:07:32
0001
0002
0003
0004 #pragma once
0005
0006 #include <DD4hep/Detector.h>
0007 #include <DDRec/CellIDPositionConverter.h>
0008
0009 #include <JANA/JApplicationFwd.h>
0010 #include <JANA/JServiceFwd.h>
0011 #include <spdlog/logger.h>
0012 #include <map>
0013 #include <memory>
0014 #include <mutex>
0015 #include <string>
0016
0017 #include "ActsGeo.h"
0018 #include "IrtGeo.h"
0019 #include "ReadoutGeo.h"
0020
0021 class RichGeo_service : public JService {
0022 public:
0023 RichGeo_service(JApplication* ) {}
0024 virtual ~RichGeo_service();
0025
0026
0027 virtual const dd4hep::Detector* GetDD4hepGeo() { return m_dd4hepGeo; };
0028
0029
0030 virtual richgeo::IrtGeo* GetIrtGeo(std::string detector_name);
0031 virtual const richgeo::ActsGeo* GetActsGeo(std::string detector_name);
0032 virtual std::shared_ptr<richgeo::ReadoutGeo> GetReadoutGeo(std::string detector_name,
0033 std::string readout_class);
0034
0035 private:
0036 RichGeo_service() = default;
0037 void acquire_services(JServiceLocator*) override;
0038
0039 std::mutex m_init_lock;
0040 std::map<std::string, std::once_flag> m_init_irt;
0041 std::map<std::string, std::once_flag> m_init_acts;
0042 std::map<std::string, std::once_flag> m_init_readout;
0043
0044 const dd4hep::Detector* m_dd4hepGeo = nullptr;
0045 const dd4hep::rec::CellIDPositionConverter* m_converter = nullptr;
0046 richgeo::IrtGeo* m_irtGeo = nullptr;
0047 richgeo::ActsGeo* m_actsGeo = nullptr;
0048 std::shared_ptr<richgeo::ReadoutGeo> m_readoutGeo;
0049
0050 std::shared_ptr<spdlog::logger> m_log;
0051 };