ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DD4hepGeometryService.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DD4hepGeometryService.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
15 #include <DD4hep/DetElement.h>
16 #include <DD4hep/Detector.h>
17 #include <TGeoNode.h>
18 #include <functional>
19 #include <memory>
20 
23 
24 namespace FW {
25 namespace DD4hep {
26 
35  public:
36  struct Config {
40  std::vector<std::string> xmlFileNames;
42  std::string name;
55  double envelopeR;
61  double envelopeZ;
63  std::function<void(std::vector<dd4hep::DetElement>& detectors)>
66  std::shared_ptr<const Acts::IMaterialDecorator> matDecorator = nullptr;
67  };
68 
69  DD4hepGeometryService(const Config& cfg);
70  ~DD4hepGeometryService() final override;
71 
74  dd4hep::DetElement dd4hepGeometry();
75 
78  TGeoNode* tgeoGeometry();
79 
81  dd4hep::Detector* lcdd();
82 
86  std::unique_ptr<const Acts::TrackingGeometry> trackingGeometry(
87  const Acts::GeometryContext& gctx);
88 
89  private:
92 
94  FW::ProcessCode buildTrackingGeometry(const Acts::GeometryContext& gctx);
95 
99  dd4hep::Detector* m_lcdd;
101  dd4hep::DetElement m_dd4hepGeometry;
103  std::unique_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
104 };
105 
106 } // namespace DD4hep
107 } // namespace FW