ATLAS Offline Software
Loading...
Searching...
No Matches
MuonBlueprintNodeBuilder.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSMUONDETECTOR_MUONBLUEPRINTNODEBUILDER_H
6#define ACTSMUONDETECTOR_MUONBLUEPRINTNODEBUILDER_H
7
9
13
14#include "Acts/Utilities/BoundFactory.hpp"
15#include "Acts/Surfaces/PlanarBounds.hpp"
16#include "Acts/Surfaces/Surface.hpp"
17
18
19
20
21namespace MuonGMR4 {
22 class Chamber;
23}
24
25namespace Acts {
26 class GeometryContext;
27 namespace Experimental {
28 class StaticBlueprintNode;
29 class MaterialDesignatorBlueprintNode;
30
31}
32
33} // namespace Acts
34
35
36namespace ActsTrk {
37
38
42class MuonBlueprintNodeBuilder : public extends<AthAlgTool, IBlueprintNodeBuilder> {
43public:
45 using blueprintNodePtr = std::shared_ptr<Acts::Experimental::BlueprintNode>;
47 using staticNodePtr = std::shared_ptr<Acts::Experimental::StaticBlueprintNode>;
49 using materialNodePtr = std::shared_ptr<Acts::Experimental::MaterialDesignatorBlueprintNode>;
51 using surfacePtr = std::shared_ptr<Acts::Surface>;
53 using BluePrintSurfPairs_t = std::pair<std::vector<blueprintNodePtr>, std::vector<surfacePtr>>;
67 using DetLayIdx_t = std::pair<DetIdx, LayIdx>;
70 using EnvelopeSet_t = std::variant<MuonChamberSet, MuonSectorSet>;
71 /*** @brief Subdivide the envelopes according to their station index */
72 using EnvelopesPerStIdx_t = std::unordered_map<StIdx, EnvelopeSet_t>;
73
74 enum class EndcapSide: std::uint8_t {
78 };
79 StatusCode initialize() override;
80 using base_class::base_class;
81
85 std::shared_ptr<Acts::Experimental::BlueprintNode> buildBlueprintNode(const Acts::GeometryContext& gctx,
86 std::shared_ptr<Acts::Experimental::BlueprintNode>&& childNode) override;
87
88private:
92 Gaudi::Property<bool> m_useSectors{this, "UseSectors", false};
94 Gaudi::Property<bool> m_alignableVolumes{this, "AlignableVolumes", true};
96 Gaudi::Property<bool> m_assignActiveMaterial{this, "AssignActiveMaterial", false};
98 Gaudi::Property<bool> m_buildPassiveVolumes{this, "BuildPassiveVolumes", true};
100 Gaudi::Property<std::size_t> m_nPhiBinsBI{this, "nPhiBinsBI", 16};
102 Gaudi::Property<std::size_t> m_nZBinsBI{this, "nZBinsBI", 12};
104 Gaudi::Property<std::size_t> m_nPhiBinsBM{this, "nPhiBinsBM", 16};
106 Gaudi::Property<std::size_t> m_nZBinsBM{this, "nZBinsBM", 12};
108 Gaudi::Property<std::size_t> m_nPhiBinsBO{this, "nPhiBinsBO", 16};
110 Gaudi::Property<std::size_t> m_nZBinsBO{this, "nZBinsBO", 12};
112 Gaudi::Property<std::size_t> m_nRBinsEI1{this, "nRBinsEIbNSW", 4};
114 Gaudi::Property<std::size_t> m_nPhiBinsEI1{this, "nPhiBinsEIbNSW", 16};
116 Gaudi::Property<std::size_t> m_nRBinsEI2{this, "nRBinsEIaNSW", 4};
118 Gaudi::Property<std::size_t> m_nPhiBinsEI2{this, "nPhiBinsEIaNSW", 16};
119
121 Gaudi::Property<std::size_t> m_nRBinsEM1{this, "nRBinsEMbBW", 16};
123 Gaudi::Property<std::size_t> m_nPhiBinsEM1{this, "nPhiBinsEMbBW", 16};
125 Gaudi::Property<std::size_t> m_nRBinsEM2{this, "nRBinsEMaBW", 5};
127 Gaudi::Property<std::size_t> m_nPhiBinsEM2{this, "nPhiBinsEMaBW", 16};
128
133 std::shared_ptr<Acts::ISurfaceMaterial> preparePassiveMaterial(const Acts::SurfaceBounds& bounds,
134 const std::size_t nBins1,
135 const std::size_t nBins2) const;
136
137 std::pair<std::size_t, std::size_t> getMaterialBins(const Muon::MuonStationIndex::ChIndex chIdx) const;
138
139
146 template<typename T>
148 const T& element,
149 const Acts::GeometryIdentifier& chId,
150 Acts::VolumeBoundFactory& boundsFactory) const
151 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
152 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
153
158 template <typename ElementSet_t>
159 std::vector<surfacePtr> getPassiveMaterialSurfaces(const Acts::GeometryContext& gctx,
160 const std::unordered_map<unsigned int, ElementSet_t>& elementsPerStation) const;
161
162
166 template<typename T>
167 std::shared_ptr<const Acts::ISurfaceMaterial>
168 getActiveMaterial(const T& element) const
169 requires (std::is_same_v<T, MuonGMR4::Chamber> ||
170 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
171
178 template<typename T>
179 bool isElementInTheStation(const T& element,
180 const std::vector<StIdx>& stationNames,
181 const EndcapSide side) const
182 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
183 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
184
193 staticNodePtr buildMuonNode(const Acts::GeometryContext& gctx,
194 const EnvelopeSet_t& elements,
195 const std::string& name,
196 const Acts::GeometryIdentifier& id,
197 Acts::VolumeBoundFactory& boundsFactory,
198 const std::vector<ChIdx>& passiveStationIds = {}) const;
199
204 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const blueprintNodePtr& chamberNode) const;
205
212 template<typename T>
213 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const T& element,
214 std::unique_ptr<Acts::TrackingVolume>& vol,
215 const std::vector<blueprintNodePtr>& innerStructure) const;
216
218 bool isBIS78(const MuonGMR4::MuonReadoutElement* element) const;
219};
220
221} //namespace ActsTrk
222
223#endif
Helper class to build a Blueprint node of the muon system.
Gaudi::Property< std::size_t > m_nPhiBinsEM1
Number of bins in phi direction on the disc before the middle big wheel.
BluePrintSurfPairs_t getSensitiveElements(const ActsTrk::GeometryContext &gctx, const T &element, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const
Get the chamber's sensitive elements.
Gaudi::Property< std::size_t > m_nZBinsBI
Number of bins in Z direction on the BI cylinder surface.
std::pair< DetIdx, LayIdx > DetLayIdx_t
Abrivation for the stations indices.
Gaudi::Property< std::size_t > m_nZBinsBM
Number of bins in Z direction on the BM cylinder surface.
std::shared_ptr< Acts::Experimental::BlueprintNode > buildBlueprintNode(const Acts::GeometryContext &gctx, std::shared_ptr< Acts::Experimental::BlueprintNode > &&childNode) override
Build the Muon Blueprint Node.
MuonGMR4::MuonDetectorManager::MuonChamberSet MuonChamberSet
Abrivation of the container holding all chambers.
staticNodePtr buildMuonNode(const Acts::GeometryContext &gctx, const EnvelopeSet_t &elements, const std::string &name, const Acts::GeometryIdentifier &id, Acts::VolumeBoundFactory &boundsFactory, const std::vector< ChIdx > &passiveStationIds={}) const
Build subnodes for the muon system node.
Gaudi::Property< std::size_t > m_nPhiBinsBI
Number of bins in phi direction on the BI cylinder surface.
std::shared_ptr< Acts::ISurfaceMaterial > preparePassiveMaterial(const Acts::SurfaceBounds &bounds, const std::size_t nBins1, const std::size_t nBins2) const
Prepare a binned material which is associated to the surface.
Gaudi::Property< std::size_t > m_nPhiBinsEI1
Number of bins in phi direction on the disc before the NSW.
bool isElementInTheStation(const T &element, const std::vector< StIdx > &stationNames, const EndcapSide side) const
Check if the chamber is in this node.
Gaudi::Property< bool > m_buildPassiveVolumes
Flag to construct the passive material surfaces.
std::vector< surfacePtr > getPassiveMaterialSurfaces(const Acts::GeometryContext &gctx, const std::unordered_map< unsigned int, ElementSet_t > &elementsPerStation) const
Construct and return the surfaces for the passive material description (e.g cylinders for barrel/ dis...
std::unordered_map< StIdx, EnvelopeSet_t > EnvelopesPerStIdx_t
Muon::MuonStationIndex::DetectorRegionIndex DetIdx
Abrivatin for the detector region index.
Gaudi::Property< std::size_t > m_nPhiBinsEM2
Number of bins in phi direction on the disc after the NSW.
std::shared_ptr< Acts::Experimental::BlueprintNode > blueprintNodePtr
Abrivation of the blueprint node ptr base class.
std::shared_ptr< Acts::Surface > surfacePtr
Abrivation of the surface pointer.
Muon::MuonStationIndex::ChIndex ChIdx
Abrivation for the chamber index.
Gaudi::Property< bool > m_alignableVolumes
Flag to control if the volumes should be alignable or not.
Gaudi::Property< bool > m_useSectors
Flag to control if we want to build the muon node from sectors or chambers.
std::pair< std::size_t, std::size_t > getMaterialBins(const Muon::MuonStationIndex::ChIndex chIdx) const
std::pair< std::vector< blueprintNodePtr >, std::vector< surfacePtr > > BluePrintSurfPairs_t
Abrivate the vector pair of blue print nodes and associated active surfaces.
std::variant< MuonChamberSet, MuonSectorSet > EnvelopeSet_t
Hide the flexibility to build the tracking geometry from sectors or chambers behind a variant.
std::variant< staticNodePtr, materialNodePtr > buildChamberNode(const blueprintNodePtr &chamberNode) const
Build a static or a material node for a chamber that corresponds to a single blueprint node (e....
MuonGMR4::MuonDetectorManager::MuonSectorSet MuonSectorSet
Abrivation of the container holding all ms sectors.
Gaudi::Property< std::size_t > m_nPhiBinsEI2
Number of bins in phi direction on the disc after the NSW.
const MuonGMR4::MuonDetectorManager * m_detMgr
the Detector manager
Gaudi::Property< std::size_t > m_nRBinsEI1
Number of bins in R direction on the disc before the NSW.
Gaudi::Property< std::size_t > m_nRBinsEM1
Number of bins in R direction on the disc before the middle big wheel.
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > staticNodePtr
Abrivation of the blue print node pointer.
Gaudi::Property< std::size_t > m_nRBinsEM2
Number of bins in R direction on the disc after the middle big wheel.
Muon::MuonStationIndex::LayerIndex LayIdx
Abrivation for the layer index.
bool isBIS78(const MuonGMR4::MuonReadoutElement *element) const
Helper function determining whether a readout element is BIS78.
Gaudi::Property< bool > m_assignActiveMaterial
Flag to assign active material on the chambers.
Muon::MuonStationIndex::StIndex StIdx
Abrivation of the station index.
Gaudi::Property< std::size_t > m_nPhiBinsBM
Number of bins in phi direction on the BM cylinder surface.
std::shared_ptr< const Acts::ISurfaceMaterial > getActiveMaterial(const T &element) const
Get the active material for a given element representing the chamber/sector.
Gaudi::Property< std::size_t > m_nZBinsBO
Number of bins in Z direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nPhiBinsBO
Number of bins in phi direction on the BM cylinder surface.
std::shared_ptr< Acts::Experimental::MaterialDesignatorBlueprintNode > materialNodePtr
Abrivation of the material node pointer.
Gaudi::Property< std::size_t > m_nRBinsEI2
Number of bins in R direction on the disc after the NSW.
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:29
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
struct color C
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
StIndex
enum to classify the different station layers in the muon spectrometer
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
LayerIndex
enum to classify the different layers in the muon spectrometer
ChIndex
enum to classify the different chamber layers in the muon spectrometer
hold the test vectors and ease the comparison