Build subnodes for the muon system node.
128 {
129
130 const ActsTrk::GeometryContext* context = gctx.get<const ActsTrk::GeometryContext* >();
131 std::vector<std::string> stationNames;
132
133 std::vector<std::shared_ptr<Acts::Experimental::StaticBlueprintNode>> nodes;
134
135 double innerRadius = 0.0;
136 double outerRadius = std::numeric_limits<double>::lowest();
137 double maxZ = std::numeric_limits<double>::lowest();
138 double minZ = std::numeric_limits<double>::max();
139 int chamberId = 1;
140 std::visit([&](const auto& elems){
141
142 for(const auto& element : elems){
144 std::string volName = element->identString();
145
146 auto vol = std::make_unique<Acts::TrackingVolume>(
147 transform,
148 element->bounds(),
149 volName);
150
151
153 vol->addSurface(std::move(material));
154
155 Acts::GeometryIdentifier chId = id.withLayer(chamberId++);
156 vol->assignGeometryId(chId);
157 std::pair<std::vector<staticNodePtr>,std::vector<surfacePtr>> innerStructure =
getSensitiveElements(*context, *element, chId, boundsFactory);
158 for(auto& surface: innerStructure.second){
159 vol->addSurface(surface);
160 }
161
162 for(const auto& surface: vol->boundarySurfaces()){
163 const auto& surfaceRepr = surface->surfaceRepresentation();
164 const Acts::Polyhedron& polyhedron = surfaceRepr.polyhedronRepresentation(gctx);
166
167 maxZ = std::max(maxZ, center.z());
168 minZ = std::min(minZ, center.z());
169
170
172 outerRadius = std::max(outerRadius,
vertex.perp());
173 }
174 }
175
176 std::shared_ptr<Acts::Experimental::StaticBlueprintNode> node;
177 const bool isSingleMdt =
178 (element->readoutEles().size() == 1 &&
180
181 if (isSingleMdt) {
182
183 node = std::move(innerStructure.first.front());
184 } else {
185 node = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(vol));
186 for (auto& childNode : innerStructure.first) {
187 node->addChild(std::move(childNode));
188 }
189 innerStructure.first.clear();
190 }
191 if (!node) {
193 }
194 nodes.emplace_back(std::move(node));
195 }
196
197 }, elements);
198
199 double halfLengthZ = 0.5 * std::abs(maxZ - minZ);
205
207
208 auto bounds = boundsFactory.makeBounds<Acts::CylinderVolumeBounds>(innerRadius, outerRadius, halfLengthZ);
209 auto volume = std::make_unique<Acts::TrackingVolume>(trf, bounds, name);
210 volume->assignGeometryId(id);
211 auto muonNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(volume));
212
214 std::ranges::for_each(nodes, [&muonNode](auto& node) {
215 muonNode->addChild(std::move(node));
216 });
217 return muonNode;
218 }
std::shared_ptr< Acts::Surface > blendMaterial(const T &element) const
Blend the sector's/chamber's material as plane surface.
std::pair< std::vector< staticNodePtr >, std::vector< surfacePtr > > getSensitiveElements(const ActsTrk::GeometryContext &gctx, const T &element, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const
Get the chamber's sensitive elements.
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)