ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConvertDD4hepDetector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ConvertDD4hepDetector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 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 
11 #include <DD4hep/DetElement.h>
12 
18 #include "Acts/Utilities/Units.hpp"
19 
20 namespace Acts {
21 
24 void sortDetElementsByID(std::vector<dd4hep::DetElement>& det) {
25  sort(det.begin(), det.end(),
26  [](const dd4hep::DetElement& a, const dd4hep::DetElement& b) {
27  return (a.id() < b.id());
28  });
29 }
30 
78 
84 
85 std::unique_ptr<const TrackingGeometry> convertDD4hepDetector(
86  dd4hep::DetElement worldDetElement,
87  Logging::Level loggingLevel = Logging::Level::INFO,
88  BinningType bTypePhi = equidistant, BinningType bTypeR = equidistant,
89  BinningType bTypeZ = equidistant, double layerEnvelopeR = UnitConstants::mm,
90  double layerEnvelopeZ = UnitConstants::mm,
91  double defaultLayerThickness = UnitConstants::fm,
92  const std::function<void(std::vector<dd4hep::DetElement>& detectors)>&
93  sortSubDetectors = sortDetElementsByID,
95  std::shared_ptr<const IMaterialDecorator> matDecorator = nullptr);
96 
136 std::shared_ptr<const CylinderVolumeBuilder> volumeBuilder_dd4hep(
137  dd4hep::DetElement subDetector,
138  Logging::Level loggingLevel = Logging::Level::INFO,
139  BinningType bTypePhi = equidistant, BinningType bTypeR = equidistant,
140  BinningType bTypeZ = equidistant, double layerEnvelopeR = UnitConstants::mm,
141  double layerEnvelopeZ = UnitConstants::mm,
142  double defaultLayerThickness = UnitConstants::fm);
143 
146 std::shared_ptr<const CylinderVolumeHelper> cylinderVolumeHelper_dd4hep(
147  Logging::Level loggingLevel = Logging::Level::INFO);
148 
156 void collectSubDetectors_dd4hep(dd4hep::DetElement& detElement,
157  std::vector<dd4hep::DetElement>& subdetectors);
158 
165 void collectCompounds_dd4hep(dd4hep::DetElement& detElement,
166  std::vector<dd4hep::DetElement>& compounds);
167 
173 void collectLayers_dd4hep(dd4hep::DetElement& detElement,
174  std::vector<dd4hep::DetElement>& layers);
175 
181 void collectVolumes_dd4hep(dd4hep::DetElement& detElement,
182  std::vector<dd4hep::DetElement>& volumes);
183 } // namespace Acts