EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
RichGeo_service.h
Go to the documentation of this file.
1// Copyright (C) 2022, 2023, Christopher Dilks
2// Subject to the terms in the LICENSE file found in the top-level directory.
3
4#pragma once
5
6#include <DD4hep/Detector.h>
7#include <DDRec/CellIDPositionConverter.h>
8// JANA
9#include <JANA/JApplicationFwd.h>
10#include <JANA/JServiceFwd.h>
11#include <spdlog/logger.h>
12#include <map>
13#include <memory>
14#include <mutex>
15#include <string>
16
17#include "ActsGeo.h"
18#include "IrtGeo.h"
19#include "ReadoutGeo.h"
20
21class RichGeo_service : public JService {
22public:
24 virtual ~RichGeo_service();
25
26 // return pointer to the main DD4hep Detector
27 virtual const dd4hep::Detector* GetDD4hepGeo() { return m_dd4hepGeo; };
28
29 // return pointers to geometry bindings; initializes the bindings upon the first time called
30 virtual richgeo::IrtGeo* GetIrtGeo(std::string detector_name);
31 virtual const richgeo::ActsGeo* GetActsGeo(std::string detector_name);
32 virtual std::shared_ptr<richgeo::ReadoutGeo> GetReadoutGeo(std::string detector_name,
33 std::string readout_class);
34
35private:
36 RichGeo_service() = default;
37 void acquire_services(JServiceLocator*) override;
38
39 std::mutex m_init_lock;
40 std::map<std::string, std::once_flag> m_init_irt;
41 std::map<std::string, std::once_flag> m_init_acts;
42 std::map<std::string, std::once_flag> m_init_readout;
43
44 const dd4hep::Detector* m_dd4hepGeo = nullptr;
45 const dd4hep::rec::CellIDPositionConverter* m_converter = nullptr;
46 richgeo::IrtGeo* m_irtGeo = nullptr;
47 richgeo::ActsGeo* m_actsGeo = nullptr;
48 std::shared_ptr<richgeo::ReadoutGeo> m_readoutGeo;
49
50 std::shared_ptr<spdlog::logger> m_log;
51};
Definition RichGeo_service.h:21
virtual std::shared_ptr< richgeo::ReadoutGeo > GetReadoutGeo(std::string detector_name, std::string readout_class)
Definition RichGeo_service.cc:82
virtual richgeo::IrtGeo * GetIrtGeo(std::string detector_name)
Definition RichGeo_service.cc:34
virtual const richgeo::ActsGeo * GetActsGeo(std::string detector_name)
Definition RichGeo_service.cc:63
virtual const dd4hep::Detector * GetDD4hepGeo()
Definition RichGeo_service.h:27
virtual ~RichGeo_service()
Definition RichGeo_service.cc:103
RichGeo_service(JApplication *)
Definition RichGeo_service.h:23
Definition ActsGeo.h:19
Definition IrtGeo.h:26