Build subnodes for the muon system node.
129 {
130
131 const ActsTrk::GeometryContext* context = gctx.get<const ActsTrk::GeometryContext* >();
132 std::vector<std::string> stationNames;
133
134 std::vector<std::shared_ptr<Acts::Experimental::StaticBlueprintNode>> nodes;
135
136 double innerRadius = 0.0;
137 double outerRadius = std::numeric_limits<double>::lowest();
138 double maxZ = std::numeric_limits<double>::lowest();
139 double minZ = std::numeric_limits<double>::max();
140
141 int chamberId = 1;
142
143 std::visit([&](const auto& elems){
144
145 for(const auto& element : elems){
147 std::string volName = element->identString();
148
149 auto vol = std::make_unique<Acts::TrackingVolume>(
150 transform,
151 element->bounds(),
152 volName);
153
154
156 vol->addSurface(std::move(material));
157
158 Acts::GeometryIdentifier chId = id.withLayer(chamberId++);
159 vol->assignGeometryId(chId);
160
161 std::pair<std::vector<staticNodePtr>,std::vector<surfacePtr>> innerStructure =
getSensitiveElements(*context, *element, chId, boundsFactory);
162
163 for(auto& surface: innerStructure.second){
164 vol->addSurface(surface);
165 }
166
167
168 for(const auto& surface: vol->boundarySurfaces()){
169 const auto& surfaceRepr = surface->surfaceRepresentation();
170 const Acts::Polyhedron& polyhedron = surfaceRepr.polyhedronRepresentation(gctx);
172
173 maxZ = std::max(maxZ, center.z());
174 minZ = std::min(minZ, center.z());
175
176
178 outerRadius = std::max(outerRadius,
vertex.perp());
179 }
180 }
182
183 Acts::ObjVisualization3D
helper;
184 vol->visualize(helper, gctx, {.visible = true},
185 {.visible = true}, {.visible = true});
186 helper.write(volName +
".obj");
188 }
189
190 std::shared_ptr<Acts::Experimental::StaticBlueprintNode>
node;
191
192 const bool isSingleMdt =
193 (element->readoutEles().
size() == 1 &&
195
196 if (isSingleMdt) {
197
198 node = std::move(innerStructure.first.front());
199 innerStructure.first.clear();
200 } else {
201 node = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(vol));
202
203 for (auto& childNode : innerStructure.first) {
204 node->addChild(std::move(childNode));
205 }
206 innerStructure.first.clear();
207 }
208
209 if (!node) {
211 }
212
213 nodes.emplace_back(std::move(node));
214
215 }
216
217 }, elements);
218
219 double halfLengthZ = 0.5 * std::abs(maxZ - minZ);
225
227
228 auto bounds = boundsFactory.makeBounds<Acts::CylinderVolumeBounds>(innerRadius, outerRadius, halfLengthZ);
229 auto volume = std::make_unique<Acts::TrackingVolume>(trf, bounds, name);
230 volume->assignGeometryId(id);
231 auto muonNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(volume));
232
234 std::ranges::for_each(nodes, [&muonNode](auto& node) {
235 muonNode->addChild(std::move(node));
236 });
237 return muonNode;
238 }
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.
Gaudi::Property< bool > m_dumpVolumes
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)