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