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_isRun4{this, "run4Layout", false};
98 Gaudi::Property<bool> m_assignActiveMaterial{this, "AssignActiveMaterial", false};
100 Gaudi::Property<bool> m_buildPassiveVolumes{this, "BuildPassiveVolumes", true};
102 Gaudi::Property<std::size_t> m_nPhiBinsBI{this, "nPhiBinsBI", 16};
104 Gaudi::Property<std::size_t> m_nZBinsBI{this, "nZBinsBI", 12};
106 Gaudi::Property<std::size_t> m_nPhiBinsBM{this, "nPhiBinsBM", 16};
108 Gaudi::Property<std::size_t> m_nZBinsBM{this, "nZBinsBM", 12};
110 Gaudi::Property<std::size_t> m_nPhiBinsBO{this, "nPhiBinsBO", 16};
112 Gaudi::Property<std::size_t> m_nZBinsBO{this, "nZBinsBO", 12};
114 Gaudi::Property<std::size_t> m_nRBinsEI1{this, "nRBinsEIbNSW", 4};
116 Gaudi::Property<std::size_t> m_nPhiBinsEI1{this, "nPhiBinsEIbNSW", 16};
118 Gaudi::Property<std::size_t> m_nRBinsEI2{this, "nRBinsEIaNSW", 4};
120 Gaudi::Property<std::size_t> m_nPhiBinsEI2{this, "nPhiBinsEIaNSW", 16};
121
123 Gaudi::Property<std::size_t> m_nRBinsEM1{this, "nRBinsEMbBW", 16};
125 Gaudi::Property<std::size_t> m_nPhiBinsEM1{this, "nPhiBinsEMbBW", 16};
127 Gaudi::Property<std::size_t> m_nRBinsEM2{this, "nRBinsEMaBW", 5};
129 Gaudi::Property<std::size_t> m_nPhiBinsEM2{this, "nPhiBinsEMaBW", 16};
130
135 std::shared_ptr<Acts::ISurfaceMaterial> preparePassiveMaterial(const Acts::SurfaceBounds& bounds,
136 const std::size_t nBins1,
137 const std::size_t nBins2) const;
138
139 std::pair<std::size_t, std::size_t> getMaterialBins(const Muon::MuonStationIndex::ChIndex chIdx) const;
140
141
148 template<typename T>
150 const T& element,
151 const Acts::GeometryIdentifier& chId,
152 Acts::VolumeBoundFactory& boundsFactory) const
153 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
154 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
155
160 template <typename ElementSet_t>
161 std::vector<surfacePtr> getPassiveMaterialSurfaces(const Acts::GeometryContext& gctx,
162 const std::unordered_map<unsigned int, ElementSet_t>& elementsPerStation) const;
163
164
168 template<typename T>
169 std::shared_ptr<const Acts::ISurfaceMaterial>
170 getActiveMaterial(const T& element) const
171 requires (std::is_same_v<T, MuonGMR4::Chamber> ||
172 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
173
180 template<typename T>
181 bool isElementInTheStation(const T& element,
182 const std::vector<StIdx>& stationNames,
183 const EndcapSide side) const
184 requires(std::is_same_v<T, MuonGMR4::Chamber> ||
185 std::is_same_v<T, MuonGMR4::SpectrometerSector>);
186
195 staticNodePtr buildMuonNode(const Acts::GeometryContext& gctx,
196 const EnvelopeSet_t& elements,
197 const std::string& name,
198 const Acts::GeometryIdentifier& id,
199 Acts::VolumeBoundFactory& boundsFactory,
200 const std::vector<ChIdx>& passiveStationIds = {}) const;
201
206 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const blueprintNodePtr& chamberNode) const;
207
214 template<typename T>
215 std::variant<staticNodePtr, materialNodePtr> buildChamberNode(const T& element,
216 std::unique_ptr<Acts::TrackingVolume>& vol,
217 const std::vector<blueprintNodePtr>& innerStructure) const;
218
220 bool isBIS78(const MuonGMR4::MuonReadoutElement* element) const;
221};
222
223} //namespace ActsTrk
224
225#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_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.
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