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 class StaticBlueprintNode;
28 class MaterialDesignatorBlueprintNode;
29
30} // namespace Acts
31
32
33namespace ActsTrk {
34
35
39class MuonBlueprintNodeBuilder : public extends<AthAlgTool, IBlueprintNodeBuilder> {
40public:
42 using blueprintNodePtr = std::shared_ptr<Acts::BlueprintNode>;
44 using staticNodePtr = std::shared_ptr<Acts::StaticBlueprintNode>;
46 using materialNodePtr = std::shared_ptr<Acts::MaterialDesignatorBlueprintNode>;
48 using surfacePtr = std::shared_ptr<Acts::Surface>;
50 using BluePrintSurfPairs_t = std::pair<std::vector<blueprintNodePtr>, std::vector<surfacePtr>>;
64 using DetLayIdx_t = std::pair<DetIdx, LayIdx>;
67 using EnvelopeSet_t = std::variant<MuonChamberSet, MuonSectorSet>;
68 /*** @brief Subdivide the envelopes according to their station index */
69 using EnvelopesPerStIdx_t = std::unordered_map<StIdx, EnvelopeSet_t>;
70
71 enum class EndcapSide: std::uint8_t {
75 };
76 StatusCode initialize() override;
77 using base_class::base_class;
78
82 std::shared_ptr<Acts::BlueprintNode> buildBlueprintNode(const Acts::GeometryContext& gctx,
83 std::shared_ptr<Acts::BlueprintNode>&& childNode) override;
84
85private:
89 Gaudi::Property<bool> m_useSectors{this, "UseSectors", false};
91 Gaudi::Property<bool> m_alignableVolumes{this, "AlignableVolumes", true};
93 Gaudi::Property<bool> m_isRun4{this, "run4Layout", false};
95 Gaudi::Property<bool> m_assignActiveMaterial{this, "AssignActiveMaterial", true};
97 Gaudi::Property<bool> m_buildPassiveVolumes{this, "BuildPassiveVolumes", false};
99 Gaudi::Property<bool> m_assignEmptyMaterial{this, "AssignEmptyPassiveMaterial", false};
101 Gaudi::Property<std::size_t> m_nPhiBinsBI{this, "nPhiBinsBI", 16};
103 Gaudi::Property<std::size_t> m_nZBinsBI{this, "nZBinsBI", 12};
105 Gaudi::Property<std::size_t> m_nPhiBinsBM{this, "nPhiBinsBM", 16};
107 Gaudi::Property<std::size_t> m_nZBinsBM{this, "nZBinsBM", 12};
109 Gaudi::Property<std::size_t> m_nPhiBinsBO{this, "nPhiBinsBO", 16};
111 Gaudi::Property<std::size_t> m_nZBinsBO{this, "nZBinsBO", 12};
113 Gaudi::Property<std::size_t> m_nRBinsEI1{this, "nRBinsEIbNSW", 4};
115 Gaudi::Property<std::size_t> m_nPhiBinsEI1{this, "nPhiBinsEIbNSW", 16};
117 Gaudi::Property<std::size_t> m_nRBinsEI2{this, "nRBinsEIaNSW", 4};
119 Gaudi::Property<std::size_t> m_nPhiBinsEI2{this, "nPhiBinsEIaNSW", 16};
120
122 Gaudi::Property<std::size_t> m_nRBinsEM1{this, "nRBinsEMbBW", 16};
124 Gaudi::Property<std::size_t> m_nPhiBinsEM1{this, "nPhiBinsEMbBW", 16};
126 Gaudi::Property<std::size_t> m_nRBinsEM2{this, "nRBinsEMaBW", 5};
128 Gaudi::Property<std::size_t> m_nPhiBinsEM2{this, "nPhiBinsEMaBW", 16};
129
134 std::shared_ptr<Acts::ISurfaceMaterial> preparePassiveMaterial(const Acts::SurfaceBounds& bounds,
135 const std::size_t nBins1,
136 const std::size_t nBins2) const;
137
138 std::pair<std::size_t, std::size_t> getMaterialBins(const Muon::MuonStationIndex::ChIndex chIdx) const;
139
140
147 template<typename T>
149 const T& element,
150 const Acts::GeometryIdentifier& chId,
151 Acts::VolumeBoundFactory& boundsFactory) const
152 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
153 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
154
159 template <typename ElementSet_t>
160 std::vector<surfacePtr> getPassiveMaterialSurfaces(const Acts::GeometryContext& gctx,
161 const std::unordered_map<unsigned int, ElementSet_t>& elementsPerStation) const;
162
163
167 template<typename T>
168 std::shared_ptr<const Acts::ISurfaceMaterial>
169 getActiveMaterial(const T& element) const
170 requires (std::is_same_v<T, MuonGMR4::Chamber> ||
171 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
172
179 template<typename T>
180 bool isElementInTheStation(const T& element,
181 const std::vector<StIdx>& stationNames,
182 const EndcapSide side) const
183 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
184 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
185
194 staticNodePtr buildMuonNode(const Acts::GeometryContext& gctx,
195 const EnvelopeSet_t& elements,
196 const std::string& name,
197 const Acts::GeometryIdentifier& id,
198 Acts::VolumeBoundFactory& boundsFactory,
199 const std::vector<ChIdx>& passiveStationIds = {}) const;
200
205 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const blueprintNodePtr& chamberNode) const;
206
213 template<typename T>
214 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const T& element,
215 std::unique_ptr<Acts::TrackingVolume>& vol,
216 const std::vector<blueprintNodePtr>& innerStructure) const;
217
219 bool isBIS78(const MuonGMR4::MuonReadoutElement* element) const;
220};
221
222} //namespace ActsTrk
223
224#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.
std::shared_ptr< Acts::BlueprintNode > buildBlueprintNode(const Acts::GeometryContext &gctx, std::shared_ptr< Acts::BlueprintNode > &&childNode) override
Build the Muon Blueprint Node.
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< bool > m_assignEmptyMaterial
Assign empty material slabs for the passive surfaces.
Gaudi::Property< std::size_t > m_nZBinsBM
Number of bins in Z direction on the BM cylinder surface.
std::shared_ptr< Acts::BlueprintNode > blueprintNodePtr
Abrivation of the blueprint node ptr base class.
MuonGMR4::MuonDetectorManager::MuonChamberSet MuonChamberSet
Abrivation of the container holding all chambers.
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::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_isRun4
Flag to control if we use run4 geometry 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.
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.
std::shared_ptr< Acts::StaticBlueprintNode > staticNodePtr
Abrivation of the blue print node pointer.
Gaudi::Property< bool > m_assignActiveMaterial
Flag to assign active material on the chambers.
std::shared_ptr< Acts::MaterialDesignatorBlueprintNode > materialNodePtr
Abrivation of the material node pointer.
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.
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.
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.
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