Analysis Software
Documentation for sPHENIX simulation 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 
19 
20 #include <functional>
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 #include <DD4hep/DetElement.h>
26 #include <DD4hep/Detector.h>
27 #include <TGeoNode.h>
28 
29 class TGeoNode;
30 namespace Acts {
31 class IMaterialDecorator;
32 class TrackingGeometry;
33 } // namespace Acts
34 namespace dd4hep {
35 class Detector;
36 } // namespace dd4hep
37 
38 namespace ActsExamples {
39 namespace DD4hep {
40 
41 void sortFCChhDetElements(std::vector<dd4hep::DetElement>& det);
42 
51  public:
52  struct Config {
58  std::vector<std::string> xmlFileNames;
80  double defaultLayerThickness = 10e-10;
81  std::function<void(std::vector<dd4hep::DetElement>& detectors)>
84  std::shared_ptr<const Acts::IMaterialDecorator> matDecorator;
85 
87  std::shared_ptr<const Acts::GeometryIdentifierHook> geometryIdentifierHook =
88  std::make_shared<const Acts::GeometryIdentifierHook>();
89  };
90 
93 
95  dd4hep::Detector& detector();
96 
99  dd4hep::DetElement& geometry();
100 
103  TGeoNode& tgeoGeometry();
104 
108  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry(
109  const Acts::GeometryContext& gctx);
110 
111  private:
114 
117  const Acts::GeometryContext& gctx);
118 
122  dd4hep::Detector* m_detector = nullptr;
124  dd4hep::DetElement m_geometry;
126  std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
127 
128  const Acts::Logger& logger() const { return *m_logger; }
129 
130  std::unique_ptr<const Acts::Logger> m_logger;
131 };
132 
133 } // namespace DD4hep
134 } // namespace ActsExamples