ATLAS Offline Software
MuonBlueprintNodeBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSMUONDETECTOR_MUONBLUEPRINTNODEBUILDER_H
6 #define ACTSMUONDETECTOR_MUONBLUEPRINTNODEBUILDER_H
7 
8 
9 
10 #include <GaudiKernel/MsgStream.h>
12 
16 
17 #include "Acts/Utilities/BoundFactory.hpp"
18 #include "Acts/Surfaces/PlanarBounds.hpp"
19 #include "Acts/Surfaces/Surface.hpp"
20 
21 
22 
23 
24 namespace MuonGMR4 {
25  class Chamber;
26 }
27 
28 namespace Acts {
29  class GeometryContext;
30  namespace Experimental {
31  class StaticBlueprintNode;
32 
33 }
34 
35 } // namespace Acts
36 
37 
38 namespace ActsTrk {
39 
40  using staticNodePtr = std::shared_ptr<Acts::Experimental::StaticBlueprintNode>;
41  using surfacePtr = std::shared_ptr<Acts::Surface>;
45 
49 class MuonBlueprintNodeBuilder : public extends<AthAlgTool, IBlueprintNodeBuilder> {
50 
51 public:
52 
53 
54  enum class EndcapSide {
55  A,
56  C,
57  Both
58  };
59 
60  StatusCode initialize() override;
61  using base_class::base_class;
62 
66  std::shared_ptr<Acts::Experimental::BlueprintNode> buildBlueprintNode(const Acts::GeometryContext& gctx,
67  std::shared_ptr<Acts::Experimental::BlueprintNode>&& childNode) override;
68 
69 
70 private:
71 
73 
74  Gaudi::Property<bool> m_dumpVolumes{this, "dumpVolumes", false}; // Flag to control if we want to visualize each chamber volume individually
75 
76  Gaudi::Property<bool> m_useSectors{this, "UseSectors", false}; // Flag to control if we want to build the muon node from sectors or chambers
77 
82  template<typename T>
83  std::shared_ptr<Acts::Surface> blendMaterial(const T& element) const;
84 
91  template<typename T>
92  std::pair<std::vector<staticNodePtr>, std::vector<surfacePtr>> getSensitiveElements(const ActsTrk::GeometryContext& gctx,
93  const T& element,
94  const Acts::GeometryIdentifier& chId,
95  Acts::VolumeBoundFactory& boundsFactory) const;
96 
103  template<typename T>
104  bool isElementInTheStation(const T& element, const std::vector<StIdx>& stationNames, const EndcapSide& side) const;
105 
113  template<typename MuonElementsSet>
114  std::shared_ptr<Acts::Experimental::StaticBlueprintNode> buildMuonNode(const Acts::GeometryContext& gctx,
115  const MuonElementsSet& elements,
116  const std::string& name,
117  const Acts::GeometryIdentifier& id,
118  Acts::VolumeBoundFactory& boundsFactory) const;
119 };
120 
121 } //namespace ActsTrk
122 
123 #endif
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
MuonGMR4::MuonDetectorManager::MuonSectorSet
std::set< const SpectrometerSector *, MSEnvelopeSorter > MuonSectorSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:123
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
ActsTrk::MuonBlueprintNodeBuilder::getSensitiveElements
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.
Definition: MuonBlueprintNodeBuilder.cxx:223
ActsTrk::MuonBlueprintNodeBuilder::EndcapSide::Both
@ Both
ActsTrk::MuonBlueprintNodeBuilder::m_dumpVolumes
Gaudi::Property< bool > m_dumpVolumes
Definition: MuonBlueprintNodeBuilder.h:74
ActsTrk::surfacePtr
std::shared_ptr< Acts::Surface > surfacePtr
Definition: MuonBlueprintNodeBuilder.h:41
ActsTrk::MuonBlueprintNodeBuilder::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: MuonBlueprintNodeBuilder.h:72
ActsTrk::MuonBlueprintNodeBuilder::EndcapSide::A
@ A
TRT::Hit::side
@ side
Definition: HitInfo.h:83
ActsTrk::MuonBlueprintNodeBuilder::EndcapSide::C
@ C
ActsTrk::MuonBlueprintNodeBuilder::m_useSectors
Gaudi::Property< bool > m_useSectors
Definition: MuonBlueprintNodeBuilder.h:76
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:19
Acts
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/UtilFunctions.h:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonGMR4::MuonDetectorManager::MuonChamberSet
std::set< const Chamber *, MSEnvelopeSorter > MuonChamberSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:124
ActsTrk::staticNodePtr
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > staticNodePtr
Definition: MuonBlueprintNodeBuilder.h:40
ActsTrk::MuonBlueprintNodeBuilder::initialize
StatusCode initialize() override
Definition: MuonBlueprintNodeBuilder.cxx:43
MuonDetectorManager.h
ActsTrk::MuonBlueprintNodeBuilder::isElementInTheStation
bool isElementInTheStation(const T &element, const std::vector< StIdx > &stationNames, const EndcapSide &side) const
Check if the chamber is in this node.
Definition: MuonBlueprintNodeBuilder.cxx:320
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
ActsTrk::MuonBlueprintNodeBuilder
Helper class to build a Blueprint node of the muon system.
Definition: MuonBlueprintNodeBuilder.h:49
ActsTrk::MuonBlueprintNodeBuilder::blendMaterial
std::shared_ptr< Acts::Surface > blendMaterial(const T &element) const
Blend the sector's/chamber's material as plane surface.
Definition: MuonBlueprintNodeBuilder.cxx:298
ActsTrk::MuonBlueprintNodeBuilder::buildMuonNode
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.
Definition: MuonBlueprintNodeBuilder.cxx:122
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
IBlueprintNodeBuilder.h
ActsTrk::MuonBlueprintNodeBuilder::EndcapSide
EndcapSide
Definition: MuonBlueprintNodeBuilder.h:54
ActsTrk::MuonSectorSet
MuonGMR4::MuonDetectorManager::MuonSectorSet MuonSectorSet
Definition: MuonBlueprintNodeBuilder.h:43
AthMessaging.h
ActsTrk::MuonChamberSet
MuonGMR4::MuonDetectorManager::MuonChamberSet MuonChamberSet
Definition: MuonBlueprintNodeBuilder.h:42
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MdtCalibInput.h:31
MuonStationIndex.h
ActsTrk::MuonBlueprintNodeBuilder::buildBlueprintNode
std::shared_ptr< Acts::Experimental::BlueprintNode > buildBlueprintNode(const Acts::GeometryContext &gctx, std::shared_ptr< Acts::Experimental::BlueprintNode > &&childNode) override
Build the Muon Blueprint Node.
Definition: MuonBlueprintNodeBuilder.cxx:49