79 const Acts::GeometryContext& gctx,
80 std::shared_ptr<Acts::BlueprintNode>&& child) {
82 ExtentEnvelope envelope = ExtentEnvelope{{
88 std::make_shared<Acts::CylinderContainerBlueprintNode>(
92 itkHgtdNode->addChild(std::move(child));
95 auto itkHgtdPad = std::make_shared<Acts::PadBlueprintNode>(
"itkHgtdPad", envelope);
96 itkHgtdPad->addChild(std::move(itkHgtdNode));
98 auto idNode = std::make_shared<Acts::GeometryIdentifierBlueprintNode>();
100 idNode->addChild(std::move(itkHgtdPad));
105 const Acts::GeometryContext& ,
106 Acts::BlueprintNode&
node) {
109 throw std::runtime_error(
"HGTD manager not available");
113 <<
m_hgtdMgr->getDetectorElementCollection()->size()
116 std::vector<std::shared_ptr<ActsDetectorElement>> elements;
118 for (
const auto* element : *
m_hgtdMgr->getDetectorElementCollection()) {
121 if (hgtdDetElement ==
nullptr) {
123 throw std::runtime_error{
"Corrupt detector element collection"};
125 elements.push_back(std::make_shared<ActsDetectorElement>(
126 *hgtdDetElement, hgtdDetElement->
identify()));
131 elements.begin(), elements.end());
133 for (
int bec : {-2, 2}) {
134 const std::string s = bec > 0 ?
"p" :
"n";
136 std::map<int, std::vector<std::shared_ptr<Acts::Surface>>> layers{};
138 for (
auto& element : elements) {
142 <<
id.bec() <<
", layer/disk " <<
id.layer_disk()
143 <<
", eta_module " <<
id.eta_module() <<
", phi_module "
146 if (
id.bec() * bec <= 0) {
150 layers[
id.layer_disk()].push_back(element->surface().getSharedPtr());
153 ATH_MSG_DEBUG(
"Found " << layers.size() <<
" layers in HGTD " << s <<
"EC");
154 for (
auto& [key, surfaces] : layers) {
159 node.withGeometryIdentifier([&layers, bec, s,
this](
auto& geoId) {
160 std::string ecName =
"HGTD_" + s +
"EC";
162 .incrementLayerIds(1);
164 geoId.addCylinderContainer(ecName, AxisR, [&](
auto& hgtd) {
165 hgtd.setAttachmentStrategy(AttachmentStrategy::Gap);
166 hgtd.setResizeStrategy(ResizeStrategy::Gap);
168 hgtd.addCylinderContainer(
169 ecName +
"_Container", AxisZ, [&](
auto& hgtdContainer) {
173 hgtdContainer.setAttachmentStrategy(
174 bec > 0 ? AttachmentStrategy::Second
175 : AttachmentStrategy::First);
176 hgtdContainer.setResizeStrategy(ResizeStrategy::Gap);
178 const int innermostLayer = layers.begin()->first;
179 for (
auto& [key, surfaces] : layers) {
180 std::string layerName = ecName +
"_" + std::to_string(key);
187 key == innermostLayer);
196 Acts::BlueprintNode& parent,
int bec,
int index,
197 const std::string& name,
198 std::vector<std::shared_ptr<Acts::Surface>>& surfaces,
bool isInnermost) {
199 using enum Acts::SurfaceArrayNavigationPolicy::LayerType;
200 using enum Acts::CylinderVolumeBounds::Face;
201 using enum Acts::AxisDirection;
209 const auto outwardDisc = (bec > 0) ? PositiveDisc : NegativeDisc;
210 const auto inwardDisc = (bec > 0) ? NegativeDisc : PositiveDisc;
211 const bool hasMaterial = (
index != 3) || isInnermost;
213 auto configureLayer = [&](
auto&
node) {
214 node.addLayer(name, [&surfaces](
auto& layer) {
215 layer.setNavigationPolicyFactory(
216 Acts::NavigationPolicyFactory{}
217 .add<Acts::SurfaceArrayNavigationPolicy>(
218 Acts::SurfaceArrayNavigationPolicy::Config{.layerType = Disc,
219 .bins = {0, 0}, .numberOfBinsFactor = 5.0})
220 .add<Acts::CylinderNavigationPolicy>()
222 layer.setSurfaces(surfaces);
223 layer.setEnvelope(Acts::ExtentEnvelope{{
224 .z = {0.1_mm, 0.1_mm},
233 const std::string materialName = name +
"_Material";
234 parent.addMaterial(materialName, [&](
auto& mat) {
236 mat.configureFace(outwardDisc, AxisSpec::DeferredEquidistant(50, AxisR),
237 AxisSpec::DeferredEquidistant(50, AxisPhi),
238 materialName +
"_Outward");
241 mat.configureFace(inwardDisc, AxisSpec::DeferredEquidistant(50, AxisR),
242 AxisSpec::DeferredEquidistant(50, AxisPhi),
243 materialName +
"_Inward");
248 configureLayer(parent);