File indexing completed on 2024-11-15 09:02:11
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <gsl/gsl>
0011 #include <memory>
0012
0013 #include "DDRec/CellIDPositionConverter.h"
0014 #include <DD4hep/Detector.h>
0015
0016 #include <algorithms/logger.h>
0017 #include <algorithms/service.h>
0018
0019 namespace algorithms {
0020
0021 class GeoSvc : public LoggedService<GeoSvc> {
0022 public:
0023
0024
0025
0026 void init(const dd4hep::Detector* = nullptr);
0027
0028
0029 gsl::not_null<const dd4hep::Detector*> detector() const { return m_detector; }
0030 dd4hep::DetElement world() const { return detector()->world(); }
0031 gsl::not_null<const dd4hep::rec::CellIDPositionConverter*> cellIDPositionConverter() const {
0032 return m_converter.get();
0033 }
0034
0035 private:
0036 const dd4hep::Detector* m_detector = nullptr;
0037 std::unique_ptr<const dd4hep::Detector> m_detector_ptr;
0038 std::unique_ptr<const dd4hep::rec::CellIDPositionConverter> m_converter;
0039
0040
0041
0042 Property<std::vector<std::string>> m_xml_list{
0043 this, "detectors", {}, "List of DD4hep compact files for standalone operation"};
0044
0045 ALGORITHMS_DEFINE_LOGGED_SERVICE(GeoSvc)
0046 };
0047
0048 }