20 #include "DD4hep/DetElement.h"
22 using namespace Acts::detail;
25 std::unique_ptr<const Logger> mlogger)
31 Cache& cache,
const dd4hep::DetElement& dd4hepElement,
38 ?
"nothing (this is likely a configuration error)."
40 ACTS_DEBUG(
"Constructing DD4hepDetectorElements - tree level call from "
41 << dd4hepElement.name() <<
".");
42 recursiveConstruct(cache, dd4hepElement, options, 1);
49 Cache& cache,
const dd4hep::DetElement& dd4hepElement,
51 ACTS_VERBOSE(
"Conversion call at level " << level <<
" for element "
52 << dd4hepElement.name());
55 int sBinning = getParamOr<int>(
"acts_surface_binning_dim", dd4hepElement, 0);
62 getParamOr<bool>(
"acts_passive_surface", dd4hepElement,
false);
66 constructPassiveComponents(dd4hepElement, options));
69 const dd4hep::DetElement::Children& children = dd4hepElement.children();
70 if (!children.empty()) {
71 ACTS_VERBOSE(children.size() <<
" child(ren) detected.");
72 for (
auto&
child : children) {
73 dd4hep::DetElement childDetElement =
child.second;
74 ACTS_VERBOSE(
"Processing child " << childDetElement.name());
78 constructSensitiveComponents(childDetElement, options));
80 recursiveConstruct(cache, childDetElement, options, level + 1);
89 const dd4hep::DetElement& dd4hepElement,
const Options&
options)
const {
92 getParamOr<std::string>(
"axis_definitions", dd4hepElement,
"XYZ");
93 std::shared_ptr<const Acts::ISurfaceMaterial> surfaceMaterial =
nullptr;
96 auto dd4hepDetElement = std::make_shared<Acts::DD4hepDetectorElement>(
97 dd4hepElement, detAxis, unitLength,
false,
nullptr);
98 auto sSurface = dd4hepDetElement->surface().getSharedPtr();
99 attachSurfaceMaterial(dd4hepElement, *sSurface.get(),
100 dd4hepDetElement->thickness(),
options);
102 return {dd4hepDetElement, sSurface};
107 const dd4hep::DetElement& dd4hepElement,
const Options&
options)
const {
109 const auto& tgeoNode = *(dd4hepElement.placement().ptr());
110 auto tgeoShape = tgeoNode.GetVolume()->GetShape();
111 const auto tgeoTransform = dd4hepElement.nominal().worldTransformation();
114 getParamOr<std::string>(
"axis_definitions", dd4hepElement,
"XYZ");
115 bool assignToAll = getParamOr<bool>(
"assign_to_all", dd4hepElement,
true);
129 const auto& tgeoNode = *(dd4hepElement.placement().ptr());
130 auto tgeoMaterial = tgeoNode.GetMedium()->GetMaterial();
137 auto surfaceMaterial =
138 std::make_shared<HomogeneousSurfaceMaterial>(materialSlab);