19 #include "Acts/Utilities/Logger.hpp"
20 #include "Acts/Definitions/Units.hpp"
21 #include "Acts/Surfaces/Surface.hpp"
22 #include "Acts/Definitions/Common.hpp"
23 #include "Acts/Geometry/TrackingGeometry.hpp"
24 #include "Acts/Plugins/DD4hep/DD4hepDetectorElement.hpp"
25 #include <Acts/Material/IMaterialDecorator.hpp>
28 #include "GaudiKernel/MsgStream.h"
29 #include "GaudiKernel/Service.h"
30 #include "GaudiKernel/ServiceHandle.h"
33 #include "DD4hep/Detector.h"
34 #include "DDRec/CellIDPositionConverter.h"
35 #include "DDRec/SurfaceManager.h"
36 #include "DDRec/Surface.h"
37 #include "DD4hep/DD4hepUnits.h"
46 void draw_surfaces(std::shared_ptr<const Acts::TrackingGeometry> trk_geo,
const std::string& fname);
48 class GeoSvc :
public extends<Service, IGeoSvc> {
58 dd4hep::Detector* m_dd4hepGeo =
nullptr;
61 std::map< int64_t, dd4hep::rec::Surface* > m_surfaceMap ;
64 std::map< int64_t, std::shared_ptr<genfit::DetPlane> > m_detPlaneMap ;
67 Acts::Logging::Level m_actsLoggingLevel = Acts::Logging::INFO;
70 Acts::GeometryContext m_trackingGeoCtx;
73 std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeo{
nullptr};
76 std::shared_ptr<const Acts::IMaterialDecorator> m_materialDeco{
nullptr};
85 std::shared_ptr<const dd4hep::rec::CellIDPositionConverter> m_cellid_converter =
nullptr;
88 std::shared_ptr<const Jug::BField::DD4hepBField> m_magneticField =
nullptr;
91 Gaudi::Property<std::vector<std::string>> m_xmlFileNames{
92 this,
"detectors", {},
"Detector descriptions XML-files"};
95 Gaudi::Property<std::string> m_jsonFileName{
96 this,
"materials",
"",
"Material map JSON-file"};
102 GeoSvc(
const std::string& name, ISvcLocator* svc);
108 virtual StatusCode
finalize() final;
126 return m_cellid_converter;
133 virtual dd4hep::Detector*
detector()
override;
137 virtual std::shared_ptr<const Acts::TrackingGeometry>
trackingGeometry()
const;
139 virtual std::shared_ptr<const Acts::MagneticFieldProvider>
getFieldProvider()
const override {
return m_magneticField; }
143 return m_dd4hepGeo->field().magneticField({0, 0, 0}).z() * (Acts::UnitConstants::T / dd4hep::tesla);
149 virtual std::map<int64_t, std::shared_ptr<genfit::DetPlane>>
getDetPlaneMap()
const {
return m_detPlaneMap; }
156 return m_trackingGeo;