 |
ATLAS Offline Software
|
Helper class to build a Blueprint node of the muon system.
More...
#include <MuonBlueprintNodeBuilder.h>
|
StatusCode | initialize () override |
|
std::shared_ptr< Acts::Experimental::BlueprintNode > | buildBlueprintNode (const Acts::GeometryContext &gctx, std::shared_ptr< Acts::Experimental::BlueprintNode > &&childNode) override |
| Build the Muon Blueprint Node. More...
|
|
|
template<typename T > |
std::shared_ptr< Acts::Surface > | blendMaterial (const T &element) const |
| Blend the sector's/chamber's material as plane surface. More...
|
|
template<typename T > |
std::pair< std::vector< staticNodePtr >, std::vector< surfacePtr > > | getSensitiveElements (const ActsGeometryContext &gctx, const T &element, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const |
| Get the chamber's sensitive elements. More...
|
|
template<typename T > |
bool | isElementInTheStation (const T &element, const std::vector< StIdx > &stationNames, const EndcapSide &side) const |
| Check if the chamber is in this node. More...
|
|
template<typename MuonElementsSet > |
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > | buildMuonNode (const Acts::GeometryContext &gctx, const MuonElementsSet &elements, const std::string &name, const Acts::GeometryIdentifier &id, Acts::VolumeBoundFactory &boundsFactory) const |
| Build subnodes for the muon system node. More...
|
|
Helper class to build a Blueprint node of the muon system.
It builds the whole muon system for PhaseII adding it to the Blueprint as a node.
Definition at line 49 of file MuonBlueprintNodeBuilder.h.
◆ EndcapSide
◆ blendMaterial()
template<typename T >
std::shared_ptr< Acts::Surface > ActsTrk::MuonBlueprintNodeBuilder::blendMaterial |
( |
const T & |
element | ) |
const |
|
private |
Blend the sector's/chamber's material as plane surface.
- Parameters
-
element | The element for which to blend the material for This function returns a plane surface with the element's (chamber or sector) material assigned to be placed at the center of the element. |
Definition at line 298 of file MuonBlueprintNodeBuilder.cxx.
301 const float thickness = element.halfZ() * 2;
302 PVConstLink parentVolume = element.readoutEles().front()->getMaterialGeom()->getParent();
303 GeoModelTools::GeoMaterialHelper geoMaterialHelper;
304 std::pair<GeoModelTools::GeoMaterialPtr, double> geoMaterials = geoMaterialHelper.collectMaterial(parentVolume);
306 const Acts::Material aMat = Acts::GeoModel::geoMaterialConverter(*geoMaterials.first);
308 auto constPtr = element.surface().getSharedPtr();
310 auto ptr = std::const_pointer_cast<Acts::Surface>(constPtr);
312 Acts::MaterialSlab slab{aMat, thickness};
313 std::shared_ptr<Acts::HomogeneousSurfaceMaterial> material = std::make_shared<Acts::HomogeneousSurfaceMaterial>(slab);
314 ptr->assignSurfaceMaterial(material);
◆ buildBlueprintNode()
std::shared_ptr< Acts::Experimental::BlueprintNode > ActsTrk::MuonBlueprintNodeBuilder::buildBlueprintNode |
( |
const Acts::GeometryContext & |
gctx, |
|
|
std::shared_ptr< Acts::Experimental::BlueprintNode > && |
childNode |
|
) |
| |
|
override |
Build the Muon Blueprint Node.
- Parameters
-
gctx | Geometry context |
childNode | The blueprint node as child of this node (for Muon System it should be Calo or Itk). |
Definition at line 49 of file MuonBlueprintNodeBuilder.cxx.
51 std::variant<MuonChamberSet, MuonSectorSet> elements;
52 std::variant<MuonChamberSet, MuonSectorSet> barrelStations, endcapAStations, endcapCStations, endcapMiddleAStations, endcapMiddleCStations;
60 std::visit([&](
auto& elems) {
61 using SetType = std::decay_t<decltype(elems)>;
64 SetType
barrel, endcapA, endcapC, endcapMiddleA, endcapMiddleC;
66 for (
const auto& element : elems) {
72 endcapA.insert(element);
74 endcapC.insert(element);
76 endcapMiddleA.insert(element);
78 endcapMiddleC.insert(element);
81 <<
" not assigned to any station!");
86 barrelStations = std::move(barrel);
87 endcapAStations = std::move(endcapA);
88 endcapCStations = std::move(endcapC);
89 endcapMiddleAStations= std::move(endcapMiddleA);
90 endcapMiddleCStations= std::move(endcapMiddleC);
95 auto muonNode = std::make_shared<Acts::Experimental::CylinderContainerBlueprintNode>(
"MuonNode", Acts::AxisDirection::AxisZ);
97 Acts::VolumeBoundFactory boundsFactory{};
99 auto barrelNode =
buildMuonNode(gctx, barrelStations,
"BI_BM_BO_EE_EI",Acts::GeometryIdentifier().withVolume(s_muonBarrelId), boundsFactory);
100 auto endcapANode =
buildMuonNode(gctx, endcapAStations,
"EO_A", Acts::GeometryIdentifier().withVolume(s_muonEndcapAId), boundsFactory);
101 auto endcapCNode =
buildMuonNode(gctx, endcapCStations,
"EO_C", Acts::GeometryIdentifier().withVolume(s_muonEndcapCId), boundsFactory);
102 auto endcapMiddleANode =
buildMuonNode(gctx, endcapMiddleAStations,
"EM_A", Acts::GeometryIdentifier().withVolume(s_muonEndcapMiddleAId), boundsFactory);
103 auto endcapMiddleCNode =
buildMuonNode(gctx, endcapMiddleCStations,
"EM_C", Acts::GeometryIdentifier().withVolume(s_muonEndcapMiddleCId), boundsFactory);
107 barrelNode->addChild(std::move(childNode));
110 muonNode->addChild(std::move(barrelNode));
111 muonNode->addChild(std::move(endcapANode));
112 muonNode->addChild(std::move(endcapCNode));
113 muonNode->addChild(std::move(endcapMiddleANode));
114 muonNode->addChild(std::move(endcapMiddleCNode));
◆ buildMuonNode()
template<typename MuonElementsSet >
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > ActsTrk::MuonBlueprintNodeBuilder::buildMuonNode |
( |
const Acts::GeometryContext & |
gctx, |
|
|
const MuonElementsSet & |
elements, |
|
|
const std::string & |
name, |
|
|
const Acts::GeometryIdentifier & |
id, |
|
|
Acts::VolumeBoundFactory & |
boundsFactory |
|
) |
| const |
|
private |
Build subnodes for the muon system node.
- Parameters
-
gctx | The geometry context |
elements | The name of the stations to include |
side | The side (A, C or Both) |
id | The geometry identifier of this node |
boundsFactory | The factory for volume bounds |
Definition at line 122 of file MuonBlueprintNodeBuilder.cxx.
130 std::vector<std::string> stationNames;
132 std::vector<std::shared_ptr<Acts::Experimental::StaticBlueprintNode>> nodes;
134 double innerRadius = 0.0;
135 double outerRadius = std::numeric_limits<double>::lowest();
136 double maxZ = std::numeric_limits<double>::lowest();
141 std::visit([&](
const auto& elems){
143 for(
const auto& element : elems){
145 std::string volName = element->identString();
147 auto vol = std::make_unique<Acts::TrackingVolume>(
154 vol->addSurface(std::move(material));
156 Acts::GeometryIdentifier chId =
id.withLayer(chamberId++);
157 vol->assignGeometryId(chId);
159 std::pair<std::vector<staticNodePtr>,std::vector<surfacePtr>> innerStructure =
getSensitiveElements(*context, *element, chId, boundsFactory);
161 for(
auto& surface: innerStructure.second){
162 vol->addSurface(surface);
166 for(
const auto& surface: vol->boundarySurfaces()){
167 const auto& surfaceRepr = surface->surfaceRepresentation();
168 const Acts::Polyhedron& polyhedron = surfaceRepr.polyhedronRepresentation(gctx);
181 Acts::ObjVisualization3D
helper;
182 vol->visualize(
helper, gctx, {.visible =
true},
183 {.visible =
true}, {.visible =
true});
184 helper.write(volName +
".obj");
188 auto node = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(vol));
189 for(
auto& childNode : innerStructure.first){
190 node->addChild(std::move(childNode));
196 nodes.emplace_back(std::move(
node));
200 double halfLengthZ = 0.5 * std::abs(maxZ - minZ);
209 auto bounds = boundsFactory.makeBounds<Acts::CylinderVolumeBounds>(innerRadius, outerRadius, halfLengthZ);
210 auto volume = std::make_unique<Acts::TrackingVolume>(
trf, bounds,
name);
211 volume->assignGeometryId(
id);
212 auto muonNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(volume));
215 std::ranges::for_each(nodes, [&muonNode](
auto&
node) {
216 muonNode->addChild(std::move(
node));
◆ getSensitiveElements()
Get the chamber's sensitive elements.
- Parameters
-
gctx | The geometry context |
element | The element for which to get the sensitive elements (chamber or sector) |
chId | The geometry identifier of the chamber |
boundsFactory | The factory for volume bounds This function constructs and returns the sensitive elements (volumes and surfaces) of the sector. |
Definition at line 223 of file MuonBlueprintNodeBuilder.cxx.
229 std::vector<staticNodePtr> readoutVolumes;
230 std::vector<surfacePtr> readoutSurfaces;
231 Acts::GeometryIdentifier::Value mdtId{1};
235 std::vector<surfacePtr> detSurfaces = readoutEle->getSurfaces();
236 switch(readoutEle->detectorType()){
242 const Amg::Vector3D toChamber = element.globalToLocalTrans(gctx)*mdtReadoutEle->center(gctx);
243 const Acts::Transform3 mdtTransform = element.localToGlobalTrans(gctx) *
Amg::getTranslate3D(toChamber);
246 Acts::Experimental::MultiWireVolumeBuilder::Config mwCfg;
248 mwCfg.mlSurfaces = detSurfaces;
249 mwCfg.transform = mdtTransform;
251 auto mdtBounds = boundsFactory.makeBounds<Acts::TrapezoidVolumeBounds>(
parameters.shortHalfX,
254 mwCfg.bounds = mdtBounds;
255 using BoundsV = Acts::TrapezoidVolumeBounds::BoundValues;
256 mwCfg.binning = {{{Acts::AxisDirection::AxisY, Acts::AxisBoundaryType::Bound,
257 -mdtBounds->get(BoundsV::eHalfLengthY),
258 mdtBounds->get(BoundsV::eHalfLengthY),
259 static_cast<std::size_t
>(std::lround(2 * mdtBounds->get(BoundsV::eHalfLengthY) /
parameters.tubePitch))}, 2
u},
260 {{Acts::AxisDirection::AxisZ, Acts::AxisBoundaryType::Bound,
261 -mdtBounds->get(BoundsV::eHalfLengthZ),
262 mdtBounds->get(BoundsV::eHalfLengthZ),
263 static_cast<std::size_t
>(std::lround(2 * mdtBounds->get(BoundsV::eHalfLengthZ) /
parameters.tubePitch))}, 1
u}};
264 Acts::Experimental::MultiWireVolumeBuilder mdtBuilder{mwCfg};
265 std::unique_ptr<Acts::TrackingVolume> mdtVolume = mdtBuilder.buildVolume();
267 mdtVolume->assignGeometryId(chId.withExtra(mdtId++));
269 std::shared_ptr<Acts::Experimental::StaticBlueprintNode> mdtNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(mdtVolume));
270 mdtNode->setNavigationPolicyFactory(mdtBuilder.createNavigationPolicyFactory());
271 readoutVolumes.push_back(std::move(mdtNode));
280 readoutSurfaces.insert(readoutSurfaces.end(), std::make_move_iterator(detSurfaces.begin()),
281 std::make_move_iterator(detSurfaces.end()));
292 return std::make_pair(std::move(readoutVolumes), std::move(readoutSurfaces));
◆ initialize()
StatusCode ActsTrk::MuonBlueprintNodeBuilder::initialize |
( |
| ) |
|
|
override |
◆ isElementInTheStation()
template<typename T >
bool ActsTrk::MuonBlueprintNodeBuilder::isElementInTheStation |
( |
const T & |
element, |
|
|
const std::vector< StIdx > & |
stationNames, |
|
|
const EndcapSide & |
side |
|
) |
| const |
|
private |
Check if the chamber is in this node.
- Parameters
-
element | The element to check (chamber or sector) |
stationNames | The names of the stations to check against |
side | The side of the endcap (A, C or Both) This function checks if the chamber is part of the configured chambers in this node. It is used to filter out chambers that are not part of this muon node. |
Definition at line 320 of file MuonBlueprintNodeBuilder.cxx.
322 auto stationSide = element.side();
323 bool matchesName = std::ranges::any_of(stationIndex.begin(), stationIndex.end(), [&](
const auto&
n){
324 return stationIdx == n;
328 return matchesName && etaSignCorrect;
◆ m_detMgr
◆ m_dumpVolumes
Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_dumpVolumes {this, "dumpVolumes", true} |
|
private |
◆ m_useSectors
Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_useSectors {this, "UseSectors", false} |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
const float EO[NO]
Energy levels for Oxygen.
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
@ Tgc
Resitive Plate Chambers.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
virtual std::string toStringDetEl(const Identifier &id) const =0
print all fields up to detector element to string
Gaudi::Property< bool > m_dumpVolumes
const MuonGMR4::MuonDetectorManager * m_detMgr
@ u
Enums for curvilinear frames.
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Gaudi::Property< bool > m_useSectors
Muon::MuonStationIndex::StIndex StIdx
@ Mm
Maybe not needed in the migration.
Set of parameters to describe a MDT chamber.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
bool isElementInTheStation(const T &element, const std::vector< StIdx > &stationNames, const EndcapSide &side) const
Check if the chamber is in this node.
std::shared_ptr< Acts::Surface > blendMaterial(const T &element) const
Blend the sector's/chamber's material as plane surface.
Include the GeoPrimitives which need to be put first.
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > buildMuonNode(const Acts::GeometryContext &gctx, const MuonElementsSet &elements, const std::string &name, const Acts::GeometryIdentifier &id, Acts::VolumeBoundFactory &boundsFactory) const
Build subnodes for the muon system node.
std::string to_string(const DetectorType &type)
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)
MuonSectorSet getAllSectors() const
: Returns all MuonChambers associated with the readout geometry
#define ATH_MSG_WARNING(x)
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
@ Rpc
Monitored Drift Tubes.
std::pair< std::vector< staticNodePtr >, std::vector< surfacePtr > > getSensitiveElements(const ActsGeometryContext &gctx, const T &element, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const
Get the chamber's sensitive elements.
MuonChamberSet getAllChambers() const
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis