ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::HgtdBlueprintNodeBuilder Class Reference

Helper class to build the HgtdBlueprint node It adds the system as a node to the Blueprint. More...

#include <HgtdBlueprintNodeBuilder.h>

Inheritance diagram for ActsTrk::HgtdBlueprintNodeBuilder:
Collaboration diagram for ActsTrk::HgtdBlueprintNodeBuilder:

Public Member Functions

StatusCode initialize () override
std::shared_ptr< Acts::Experimental::BlueprintNode > buildBlueprintNode (const Acts::GeometryContext &gctx, std::shared_ptr< Acts::Experimental::BlueprintNode > &&child) override
 Build the HGTD Blueprint Node.

Private Member Functions

void buildHgtdBlueprintNode (const Acts::GeometryContext &gctx, Acts::Experimental::BlueprintNode &node)
 Build the HGTD Blueprint Node.
void addHgtdLayers (Acts::Experimental::BlueprintNode &parent, int bec, int layer, const std::string &name, std::vector< std::shared_ptr< Acts::Surface > > &surfaces)

Private Attributes

const HGTD_DetectorManagerm_hgtdMgr {nullptr}
std::shared_ptr< ActsElementVectorm_elementStore {nullptr}

Detailed Description

Helper class to build the HgtdBlueprint node It adds the system as a node to the Blueprint.

Definition at line 19 of file HgtdBlueprintNodeBuilder.h.

Member Function Documentation

◆ addHgtdLayers()

void ActsTrk::HgtdBlueprintNodeBuilder::addHgtdLayers ( Acts::Experimental::BlueprintNode & parent,
int bec,
int layer,
const std::string & name,
std::vector< std::shared_ptr< Acts::Surface > > & surfaces )
private

Definition at line 180 of file HgtdBlueprintNodeBuilder.cxx.

183 {
184 using enum Acts::SurfaceArrayNavigationPolicy::LayerType;
185 using enum Acts::CylinderVolumeBounds::Face;
186 using enum Acts::AxisDirection;
187 using enum Acts::AxisBoundaryType;
188
189 parent.addMaterial(name + "_Material", [&](auto& mat) {
190 if (index == 3) {
191 mat.configureFace(bec > 0 ? NegativeDisc : PositiveDisc,
192 {AxisR, Bound, 20}, {AxisPhi, Closed, 40});
193 } else {
194 mat.configureFace(NegativeDisc, {AxisR, Bound, 20},
195 {AxisPhi, Closed, 40});
196 mat.configureFace(PositiveDisc, {AxisR, Bound, 20},
197 {AxisPhi, Closed, 40});
198 }
199
200 mat.addLayer(name, [&surfaces](auto& layer) {
201 layer.setNavigationPolicyFactory(
202 Acts::NavigationPolicyFactory{}
203 .add<Acts::SurfaceArrayNavigationPolicy>(
204 Acts::SurfaceArrayNavigationPolicy::Config{.layerType = Disc,
205 .bins = {20, 20}})
206 .add<Acts::TryAllNavigationPolicy>(
207 Acts::TryAllNavigationPolicy::Config{.sensitives = false})
208 .asUniquePtr());
209 layer.setSurfaces(surfaces);
210 layer.setEnvelope(Acts::ExtentEnvelope{{
211 .z = {0.1_mm, 0.1_mm},
212 .r = {2_mm, 2_mm},
213 }});
214 });
215 });
216}
@ layer
Definition HitInfo.h:79

◆ buildBlueprintNode()

std::shared_ptr< Acts::Experimental::BlueprintNode > ActsTrk::HgtdBlueprintNodeBuilder::buildBlueprintNode ( const Acts::GeometryContext & gctx,
std::shared_ptr< Acts::Experimental::BlueprintNode > && child )
override

Build the HGTD Blueprint Node.

Parameters
gctxGeometry context
childThe child node which is added to the HGTD node.

Definition at line 72 of file HgtdBlueprintNodeBuilder.cxx.

74 {
75
76 ExtentEnvelope envelope = ExtentEnvelope{{
77 .z = {20_mm, 20_mm},
78 .r = {0_mm, 20_mm},
79 }};
80 auto itkHgtdPad = std::make_shared<Acts::Experimental::PadBlueprintNode>(
81 "itkHgtdPad", envelope);
82
83 auto itkHgtdNode =
84 std::make_shared<Acts::Experimental::CylinderContainerBlueprintNode>(
85 "itkHgtd", AxisZ);
86
87 if (child) {
88 itkHgtdNode->addChild(std::move(child));
89 }
90 buildHgtdBlueprintNode(gctx, *itkHgtdNode);
91
92 itkHgtdPad->addChild(itkHgtdNode);
93 return itkHgtdPad;
94}
void buildHgtdBlueprintNode(const Acts::GeometryContext &gctx, Acts::Experimental::BlueprintNode &node)
Build the HGTD Blueprint Node.

◆ buildHgtdBlueprintNode()

void ActsTrk::HgtdBlueprintNodeBuilder::buildHgtdBlueprintNode ( const Acts::GeometryContext & gctx,
Acts::Experimental::BlueprintNode & node )
private

Build the HGTD Blueprint Node.

Parameters
gctxGeometry context
nodeThe node to add the HGTD node to

Definition at line 96 of file HgtdBlueprintNodeBuilder.cxx.

98 {
99 if (not m_hgtdMgr) {
100 ATH_MSG_ERROR("HGTD manager not available");
101 throw std::runtime_error("HGTD manager not available");
102 }
103
104 ATH_MSG_DEBUG("Detector manager has "
105 << m_hgtdMgr->getDetectorElementCollection()->size()
106 << " elements");
107
108 std::vector<std::shared_ptr<ActsDetectorElement>> elements;
109
110 for (const auto* element : *m_hgtdMgr->getDetectorElementCollection()) {
111 const InDetDD::HGTD_DetectorElement* hgtdDetElement =
112 dynamic_cast<const InDetDD::HGTD_DetectorElement*>(element);
113 if (hgtdDetElement == nullptr) {
114 ATH_MSG_ERROR("Detector element was nullptr");
115 throw std::runtime_error{"Corrupt detector element collection"};
116 }
117 elements.push_back(std::make_shared<ActsDetectorElement>(
118 *hgtdDetElement, hgtdDetElement->identify()));
119 }
120 ATH_MSG_VERBOSE("Retrieved " << elements.size() << " elements");
121
122 m_elementStore->vector().insert(m_elementStore->vector().end(),
123 elements.begin(), elements.end());
124
125 for (int bec : {-2, 2}) {
126 const std::string s = bec > 0 ? "p" : "n";
127
128 std::map<int, std::vector<std::shared_ptr<Acts::Surface>>> layers{};
129
130 for (auto& element : elements) {
131 IdentityHelper id = element->identityHelper();
132
133 ATH_MSG_VERBOSE("Reading element with bec "
134 << id.bec() << ", layer/disk " << id.layer_disk()
135 << ", eta_module " << id.eta_module() << ", phi_module "
136 << id.phi_module());
137
138 if (id.bec() * bec <= 0) {
139 continue;
140 }
141
142 layers[id.layer_disk()].push_back(element->surface().getSharedPtr());
143 }
144
145 ATH_MSG_DEBUG("Found " << layers.size() << " layers in HGTD " << s << "EC");
146 for (auto& [key, surfaces] : layers) {
147 ATH_MSG_DEBUG("Layer " << key << " has " << surfaces.size()
148 << " surfaces");
149 }
150
151 node.withGeometryIdentifier([&layers, bec, s, this](auto& geoId) {
152 std::string ecName = "HGTD_" + s + "EC";
153 geoId.setAllVolumeIdsTo((bec > 0 ? s_hgtdPosVolumeId : s_hgtdNegVolumeId))
154 .incrementLayerIds(1);
155
156 geoId.addCylinderContainer(ecName, AxisR, [&](auto& hgtd) {
157 hgtd.setAttachmentStrategy(AttachmentStrategy::Gap);
158 hgtd.setResizeStrategy(ResizeStrategy::Gap);
159
160 hgtd.addCylinderContainer(
161 ecName + "_Container", AxisZ, [&](auto& hgtdContainer) {
162 hgtdContainer.setAttachmentStrategy(AttachmentStrategy::Gap);
163 hgtdContainer.setResizeStrategy(ResizeStrategy::Gap);
164
165 for (auto& [key, surfaces] : layers) {
166 std::string layerName = ecName + "_" + std::to_string(key);
167
168 ATH_MSG_DEBUG("Adding layer " << layerName << " with "
169 << surfaces.size()
170 << " surfaces");
171
172 addHgtdLayers(hgtdContainer, bec, key, layerName, surfaces);
173 }
174 });
175 });
176 });
177 }
178}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
void addHgtdLayers(Acts::Experimental::BlueprintNode &parent, int bec, int layer, const std::string &name, std::vector< std::shared_ptr< Acts::Surface > > &surfaces)
const HGTD_DetectorManager * m_hgtdMgr
std::shared_ptr< ActsElementVector > m_elementStore
virtual Identifier identify() const override final
identifier of this detector element (inline)
constexpr std::size_t s_hgtdNegVolumeId
constexpr std::size_t s_hgtdPosVolumeId
HGTD volume IDs.
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string

◆ initialize()

StatusCode ActsTrk::HgtdBlueprintNodeBuilder::initialize ( )
override

Definition at line 61 of file HgtdBlueprintNodeBuilder.cxx.

61 {
62 ATH_MSG_DEBUG("Initializing HgtdBlueprintNodeBuilder");
63
64 ATH_CHECK(detStore()->retrieve(m_hgtdMgr, "HGTD"));
65
66 m_elementStore = std::make_shared<ActsElementVector>();
67
68 return StatusCode::SUCCESS;
69}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_elementStore

std::shared_ptr<ActsElementVector> ActsTrk::HgtdBlueprintNodeBuilder::m_elementStore {nullptr}
private

Definition at line 36 of file HgtdBlueprintNodeBuilder.h.

36{nullptr};

◆ m_hgtdMgr

const HGTD_DetectorManager* ActsTrk::HgtdBlueprintNodeBuilder::m_hgtdMgr {nullptr}
private

Definition at line 34 of file HgtdBlueprintNodeBuilder.h.

34{nullptr};

The documentation for this class was generated from the following files: