ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::MuonBlueprintNodeBuilder Class Reference

Helper class to build a Blueprint node of the muon system. More...

#include <MuonBlueprintNodeBuilder.h>

Inheritance diagram for ActsTrk::MuonBlueprintNodeBuilder:
Collaboration diagram for ActsTrk::MuonBlueprintNodeBuilder:

Public Types

enum class  EndcapSide : std::uint8_t { A , C , Both }
using blueprintNodePtr = std::shared_ptr<Acts::Experimental::BlueprintNode>
 Abrivation of the blueprint node ptr base class.
using staticNodePtr = std::shared_ptr<Acts::Experimental::StaticBlueprintNode>
 Abrivation of the blue print node pointer.
using materialNodePtr = std::shared_ptr<Acts::Experimental::MaterialDesignatorBlueprintNode>
 Abrivation of the material node pointer.
using surfacePtr = std::shared_ptr<Acts::Surface>
 Abrivation of the surface pointer.
using BluePrintSurfPairs_t = std::pair<std::vector<blueprintNodePtr>, std::vector<surfacePtr>>
 Abrivate the vector pair of blue print nodes and associated active surfaces.
using MuonChamberSet = MuonGMR4::MuonDetectorManager::MuonChamberSet
 Abrivation of the container holding all chambers.
using MuonSectorSet = MuonGMR4::MuonDetectorManager::MuonSectorSet
 Abrivation of the container holding all ms sectors.
using StIdx = Muon::MuonStationIndex::StIndex
 Abrivation of the station index.
using DetIdx = Muon::MuonStationIndex::DetectorRegionIndex
 Abrivatin for the detector region index.
using LayIdx = Muon::MuonStationIndex::LayerIndex
 Abrivation for the layer index.
using ChIdx = Muon::MuonStationIndex::ChIndex
 Abrivation for the chamber index.
using DetLayIdx_t = std::pair<DetIdx, LayIdx>
 Abrivation for the stations indices.
using EnvelopeSet_t = std::variant<MuonChamberSet, MuonSectorSet>
 Hide the flexibility to build the tracking geometry from sectors or chambers behind a variant.
using EnvelopesPerStIdx_t = std::unordered_map<StIdx, EnvelopeSet_t>

Public Member Functions

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.
template<typename ElementSet_t>
std::vector< std::shared_ptr< Acts::Surface > > getPassiveMaterialSurfaces (const Acts::GeometryContext &gctx, const std::unordered_map< unsigned int, ElementSet_t > &elementsPerStation) const

Private Member Functions

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.
std::pair< std::size_t, std::size_t > getMaterialBins (const Muon::MuonStationIndex::ChIndex chIdx) const
template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
BluePrintSurfPairs_t getSensitiveElements (const ActsTrk::GeometryContext &gctx, const T &element, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const
 Get the chamber's sensitive elements.
template<typename ElementSet_t>
std::vector< surfacePtrgetPassiveMaterialSurfaces (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/ discs for endcaps).
template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
std::shared_ptr< const Acts::ISurfaceMaterial > getActiveMaterial (const T &element) const
 Get the active material for a given element representing the chamber/sector.
template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
bool isElementInTheStation (const T &element, const std::vector< StIdx > &stationNames, const EndcapSide side) const
 Check if the chamber is in this node.
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::variant< staticNodePtr, materialNodePtrbuildChamberNode (const blueprintNodePtr &chamberNode) const
 Build a static or a material node for a chamber that corresponds to a single blueprint node (e.g for a single MDT multilayer).
template<typename T>
std::variant< staticNodePtr, materialNodePtrbuildChamberNode (const T &element, std::unique_ptr< Acts::TrackingVolume > &vol, const std::vector< blueprintNodePtr > &innerStructure) const
 Build a static or a material node for a chamber that corresponds to a single blueprint node (e.g for a single MDT multilayer).
bool isBIS78 (const MuonGMR4::MuonReadoutElement *element) const
 Helper function determining whether a readout element is BIS78.

Private Attributes

const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 the Detector manager
Gaudi::Property< bool > m_useSectors {this, "UseSectors", false}
 Flag to control if we want to build the muon node from sectors or chambers.
Gaudi::Property< bool > m_alignableVolumes {this, "AlignableVolumes", true}
 Flag to control if the volumes should be alignable or not.
Gaudi::Property< bool > m_isRun4 {this, "run4Layout", false}
 Flag to control if we use run4 geometry or not.
Gaudi::Property< bool > m_assignActiveMaterial {this, "AssignActiveMaterial", false}
 Flag to assign active material on the chambers.
Gaudi::Property< bool > m_buildPassiveVolumes {this, "BuildPassiveVolumes", false}
 Flag to construct the passive material surfaces.
Gaudi::Property< std::size_t > m_nPhiBinsBI {this, "nPhiBinsBI", 16}
 Number of bins in phi direction on the BI cylinder surface.
Gaudi::Property< std::size_t > m_nZBinsBI {this, "nZBinsBI", 12}
 Number of bins in Z direction on the BI cylinder surface.
Gaudi::Property< std::size_t > m_nPhiBinsBM {this, "nPhiBinsBM", 16}
 Number of bins in phi direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nZBinsBM {this, "nZBinsBM", 12}
 Number of bins in Z direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nPhiBinsBO {this, "nPhiBinsBO", 16}
 Number of bins in phi direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nZBinsBO {this, "nZBinsBO", 12}
 Number of bins in Z direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nRBinsEI1 {this, "nRBinsEIbNSW", 4}
 Number of bins in R direction on the disc before the NSW.
Gaudi::Property< std::size_t > m_nPhiBinsEI1 {this, "nPhiBinsEIbNSW", 16}
 Number of bins in phi direction on the disc before the NSW.
Gaudi::Property< std::size_t > m_nRBinsEI2 {this, "nRBinsEIaNSW", 4}
 Number of bins in R direction on the disc after the NSW.
Gaudi::Property< std::size_t > m_nPhiBinsEI2 {this, "nPhiBinsEIaNSW", 16}
 Number of bins in phi direction on the disc after the NSW.
Gaudi::Property< std::size_t > m_nRBinsEM1 {this, "nRBinsEMbBW", 16}
 Number of bins in R direction on the disc before the middle big wheel.
Gaudi::Property< std::size_t > m_nPhiBinsEM1 {this, "nPhiBinsEMbBW", 16}
 Number of bins in phi direction on the disc before the middle big wheel.
Gaudi::Property< std::size_t > m_nRBinsEM2 {this, "nRBinsEMaBW", 5}
 Number of bins in R direction on the disc after the middle big wheel.
Gaudi::Property< std::size_t > m_nPhiBinsEM2 {this, "nPhiBinsEMaBW", 16}
 Number of bins in phi direction on the disc after the NSW.

Detailed Description

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 42 of file MuonBlueprintNodeBuilder.h.

Member Typedef Documentation

◆ blueprintNodePtr

using ActsTrk::MuonBlueprintNodeBuilder::blueprintNodePtr = std::shared_ptr<Acts::Experimental::BlueprintNode>

Abrivation of the blueprint node ptr base class.

Definition at line 45 of file MuonBlueprintNodeBuilder.h.

◆ BluePrintSurfPairs_t

Abrivate the vector pair of blue print nodes and associated active surfaces.

Definition at line 53 of file MuonBlueprintNodeBuilder.h.

◆ ChIdx

Abrivation for the chamber index.

Definition at line 65 of file MuonBlueprintNodeBuilder.h.

◆ DetIdx

Abrivatin for the detector region index.

Definition at line 61 of file MuonBlueprintNodeBuilder.h.

◆ DetLayIdx_t

Abrivation for the stations indices.

Definition at line 67 of file MuonBlueprintNodeBuilder.h.

◆ EnvelopeSet_t

Hide the flexibility to build the tracking geometry from sectors or chambers behind a variant.

Definition at line 70 of file MuonBlueprintNodeBuilder.h.

◆ EnvelopesPerStIdx_t

◆ LayIdx

Abrivation for the layer index.

Definition at line 63 of file MuonBlueprintNodeBuilder.h.

◆ materialNodePtr

using ActsTrk::MuonBlueprintNodeBuilder::materialNodePtr = std::shared_ptr<Acts::Experimental::MaterialDesignatorBlueprintNode>

Abrivation of the material node pointer.

Definition at line 49 of file MuonBlueprintNodeBuilder.h.

◆ MuonChamberSet

Abrivation of the container holding all chambers.

Definition at line 55 of file MuonBlueprintNodeBuilder.h.

◆ MuonSectorSet

Abrivation of the container holding all ms sectors.

Definition at line 57 of file MuonBlueprintNodeBuilder.h.

◆ staticNodePtr

using ActsTrk::MuonBlueprintNodeBuilder::staticNodePtr = std::shared_ptr<Acts::Experimental::StaticBlueprintNode>

Abrivation of the blue print node pointer.

Definition at line 47 of file MuonBlueprintNodeBuilder.h.

◆ StIdx

Abrivation of the station index.

Definition at line 59 of file MuonBlueprintNodeBuilder.h.

◆ surfacePtr

using ActsTrk::MuonBlueprintNodeBuilder::surfacePtr = std::shared_ptr<Acts::Surface>

Abrivation of the surface pointer.

Definition at line 51 of file MuonBlueprintNodeBuilder.h.

Member Enumeration Documentation

◆ EndcapSide

enum class ActsTrk::MuonBlueprintNodeBuilder::EndcapSide : std::uint8_t
strong
Enumerator
Both 

Definition at line 74 of file MuonBlueprintNodeBuilder.h.

74 : std::uint8_t {
75 A,
76 C,
77 Both
78 };
struct color C

Member Function Documentation

◆ 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
gctxGeometry context
childNodeThe blueprint node as child of this node (for Muon System it should be Calo or Itk).

Definition at line 96 of file MuonBlueprintNodeBuilder.cxx.

96 {
97
98EnvelopeSet_t elements;
99EnvelopeSet_t barrelStations, endcapOuterAStations, endcapOuterCStations,
100 endcapMiddleAStations, endcapMiddleCStations;
101
102if (m_useSectors) {
103 elements = m_detMgr->getAllSectors();
104} else {
105 elements = m_detMgr->getAllChambers();
106}
107
108std::visit([&](auto& elems) {
109 using SetType = std::decay_t<decltype(elems)>;
110
111 // Initialize station containers of the same type
112 SetType barrel, endcapA, endcapC, endcapMiddleA, endcapMiddleC;
113
114 for (const auto& element : elems) {
115 if (isElementInTheStation(*element,
116 {StIdx::BI, StIdx::BM, StIdx::BO, StIdx::BE, StIdx::EE, StIdx::EI},
118 barrel.push_back(element);
119 } else if (isElementInTheStation(*element, {StIdx::EO}, EndcapSide::A)) {
120 endcapA.push_back(element);
121 } else if (isElementInTheStation(*element, {StIdx::EO}, EndcapSide::C)) {
122 endcapC.push_back(element);
123 } else if (isElementInTheStation(*element, {StIdx::EM}, EndcapSide::A)) {
124 endcapMiddleA.push_back(element);
125 } else if (isElementInTheStation(*element, {StIdx::EM}, EndcapSide::C)) {
126 endcapMiddleC.push_back(element);
127 } else {
128 ATH_MSG_WARNING("Element " << element->identString()
129 << " not assigned to any station!");
130 }
131 }
132
133 // Assign back into the outer variants
134 barrelStations = std::move(barrel);
135 endcapOuterAStations = std::move(endcapA);
136 endcapOuterCStations = std::move(endcapC);
137 endcapMiddleAStations = std::move(endcapMiddleA);
138 endcapMiddleCStations = std::move(endcapMiddleC);
139}, elements);
140
141 // Top level node for the Muon system
142auto muonNode = std::make_shared<Acts::Experimental::CylinderContainerBlueprintNode>("MuonNode", Acts::AxisDirection::AxisZ);
143
144Acts::VolumeBoundFactory boundsFactory{};
145using namespace ActsTrk::detail::GeoVolIds;
146auto barrelNode = buildMuonNode(gctx, barrelStations, "BI_BM_BO_EE_EI", Acts::GeometryIdentifier().withVolume(s_muonBarrelId), boundsFactory, {ChIdx::BIS, ChIdx::BML, ChIdx::BOL,
147 ChIdx::EIS, ChIdx::EIL});
148auto endcapANode = buildMuonNode(gctx, endcapOuterAStations, "EO_A", Acts::GeometryIdentifier().withVolume(s_muonEndcapAId), boundsFactory);
149auto endcapCNode = buildMuonNode(gctx, endcapOuterCStations, "EO_C", Acts::GeometryIdentifier().withVolume(s_muonEndcapCId), boundsFactory);
150auto endcapMiddleANode = buildMuonNode(gctx, endcapMiddleAStations, "EM_A", Acts::GeometryIdentifier().withVolume(s_muonEndcapMiddleAId), boundsFactory, {ChIdx::EML, ChIdx::EMS});
151auto endcapMiddleCNode = buildMuonNode(gctx, endcapMiddleCStations, "EM_C", Acts::GeometryIdentifier().withVolume(s_muonEndcapMiddleCId), boundsFactory, {ChIdx::EML, ChIdx::EMS});
152
153//Add to the muon barrel child node (e.g calo or Itk) - if existed
154if(childNode){
155 barrelNode->addChild(std::move(childNode));
156}
157muonNode->addChild(std::move(barrelNode));
158muonNode->addChild(std::move(endcapANode));
159muonNode->addChild(std::move(endcapCNode));
160muonNode->addChild(std::move(endcapMiddleANode));
161muonNode->addChild(std::move(endcapMiddleCNode));
162
163return muonNode;
164
165}
#define ATH_MSG_WARNING(x)
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.
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_useSectors
Flag to control if we want to build the muon node from sectors or chambers.
std::variant< MuonChamberSet, MuonSectorSet > EnvelopeSet_t
Hide the flexibility to build the tracking geometry from sectors or chambers behind a variant.
const MuonGMR4::MuonDetectorManager * m_detMgr
the Detector manager

◆ buildChamberNode() [1/2]

std::variant< MuonBlueprintNodeBuilder::staticNodePtr, MuonBlueprintNodeBuilder::materialNodePtr > ActsTrk::MuonBlueprintNodeBuilder::buildChamberNode ( const blueprintNodePtr & chamberNode) const
private

Build a static or a material node for a chamber that corresponds to a single blueprint node (e.g for a single MDT multilayer).

Parameters
chamberNodeThe blueprint node out of which the variant node will be built
Returns
A variant holding either a static node or material node depending on wether the assignment of active material is enabled

Definition at line 290 of file MuonBlueprintNodeBuilder.cxx.

290 {
292 auto materialNode = std::dynamic_pointer_cast<Acts::Experimental::MaterialDesignatorBlueprintNode>(chamberVolumeNode);
293 return materialNode;
294 }
295 auto staticNode = std::dynamic_pointer_cast<Acts::Experimental::StaticBlueprintNode>(chamberVolumeNode);
296 return staticNode;
297}
Gaudi::Property< bool > m_assignActiveMaterial
Flag to assign active material on the chambers.

◆ buildChamberNode() [2/2]

template<typename T>
std::variant< MuonBlueprintNodeBuilder::staticNodePtr, MuonBlueprintNodeBuilder::materialNodePtr > ActsTrk::MuonBlueprintNodeBuilder::buildChamberNode ( const T & element,
std::unique_ptr< Acts::TrackingVolume > & vol,
const std::vector< blueprintNodePtr > & innerStructure ) const
private

Build a static or a material node for a chamber that corresponds to a single blueprint node (e.g for a single MDT multilayer).

Parameters
innerStructureThe inner structure of the chamber that corresponds to the children nodes
elementThe element representing the chamber/sector for which the node is built
volThe tracking volume associated to the chamber/sector
Returns
A variant holding either a static node or material node depending on wether the assignment of active material is enabled

Definition at line 301 of file MuonBlueprintNodeBuilder.cxx.

303 {
304 //copy of the volume bounds
305 const Acts::VolumeBounds& bounds = vol->volumeBounds();
306 staticNodePtr staticNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(vol));
307 for (auto& childNode : innerStructure) {
308 auto node = std::dynamic_pointer_cast<Acts::Experimental::StaticBlueprintNode>(childNode);
309 if (node) {
310 staticNode->addChild(std::move(node));
311 }
312 }
314 return staticNode;
315 }
316 auto materialNode = std::make_shared<Acts::Experimental::MaterialDesignatorBlueprintNode>(element->identString() + "_MaterialNode");
317 configureMaterialFaces(*materialNode, bounds, getActiveMaterial(*element));
318 materialNode->addChild(staticNode);
319 return materialNode;
320}
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > staticNodePtr
Abrivation of the blue print node pointer.
std::shared_ptr< const Acts::ISurfaceMaterial > getActiveMaterial(const T &element) const
Get the active material for a given element representing the chamber/sector.

◆ buildMuonNode()

std::shared_ptr< Acts::Experimental::StaticBlueprintNode > ActsTrk::MuonBlueprintNodeBuilder::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
private

Build subnodes for the muon system node.

Parameters
gctxThe geometry context
elementsThe name of the stations to include
sideThe side (A, C or Both)
idThe geometry identifier of this node
boundsFactoryThe factory for volume bounds
passiveStationIdsThe ids with the chamber indices we want to put passive material surfaces on

Definition at line 168 of file MuonBlueprintNodeBuilder.cxx.

173 {
174
175 const ActsTrk::GeometryContext* context = gctx.get<const ActsTrk::GeometryContext* >();
176 std::vector<std::string> stationNames;
177
178 //build the material nodes that will have as children the static nodes bult from the tracking volumes of the chambers
179 std::vector<std::variant<staticNodePtr, materialNodePtr>> nodes;
180
181 double innerRadius{0.0};
182 double outerRadius{std::numeric_limits<double>::lowest()};
183 double maxZ{std::numeric_limits<double>::lowest()};
184 double minZ{std::numeric_limits<double>::max()};
185 int chamberId = 1;
186 std::vector<std::shared_ptr<Acts::Surface>> passiveSurfaces;
187
188 std::visit([&](const auto& elems){
189
190 using SetType = std::decay_t<decltype(elems)>;
191 std::unordered_map<unsigned int, SetType> elementsPerStation;
192
193 for(const auto& element : elems){
194 std::unique_ptr<Acts::TrackingVolume> vol{};
195 if (m_alignableVolumes) {
196 vol = std::make_unique<Acts::TrackingVolume>(*element->boundingVolume(*context),
197 element->identString());
198 } else {
199 vol = std::make_unique<Acts::TrackingVolume>(element->localToGlobalTransform(*context),
200 element->bounds(),
201 element->identString());
202 }
203 // //the chamber geometry id
204 Acts::GeometryIdentifier chId = id.withLayer(chamberId++);
205 vol->assignGeometryId(chId);
206 //build the inner structure of the chamber this will return inner sensitive surfaces
207 //or volumes that have already constructed as blueptint nodes and will nbe assigned as children to the element node
208 std::pair<std::vector<blueprintNodePtr>,std::vector<surfacePtr>> innerStructure = getSensitiveElements(*context, *element, chId, boundsFactory);
209 for(auto& surface: innerStructure.second){
210 vol->addSurface(surface);
211 }
212
213 //calculate the bounds of the cylinder container
214 for(const auto& surface: vol->volumeBounds().orientedSurfaces(vol->localToGlobalTransform(gctx))) {
215 const auto& surfaceRepr = (*surface.surface);
216 const Acts::Polyhedron& polyhedron = surfaceRepr.polyhedronRepresentation(gctx);
217 const Amg::Vector3D& center = surfaceRepr.center(gctx);
218
219 maxZ = std::max(maxZ, center.z());
220 minZ = std::min(minZ, center.z());
221
222 // Outer radius needs to be treated differently due to curvature of cylindrical surface
223 for(const Amg::Vector3D& vertex: polyhedron.vertices){
224 outerRadius = std::max(outerRadius, vertex.perp());
225 }
226 }
227
228 std::variant<staticNodePtr, materialNodePtr> chamberNode;
229 const bool isSingleMdt =
230 (element->readoutEles().size() == 1 &&
231 element->readoutEles().front()->detectorType() == DetectorType::Mdt);
232 //for the single MDT elements we build the material node during the volume construction
233 //and the node returned is the material node already
234 if (isSingleMdt) {
235 // Take ownership of the single existing node where we have already included the static node as child
236 // if we allow active material assignment the node is the material node, otherwise it is the static node
237 chamberNode = buildChamberNode(innerStructure.first.front());
238 } else {
239 //for the non single MDT elements we build the material node that has as child the static node representing the chamber volume if we build with material
240 // or it is a static node with the other static nodes as children if not active material is assigned
241 chamberNode = buildChamberNode(element, vol, innerStructure.first);
242 innerStructure.first.clear();
243 }
244 if (isNullVariant(chamberNode)) {
245 THROW_EXCEPTION("No blueprint node constructed");
246 }
247 nodes.push_back(std::move(chamberNode));
248
249 //keep the elements of the stations we want to assign passive material surfaces
250 if(!Acts::rangeContainsValue(passiveStationIds, element->chamberIndex())){
251 continue;
252 }
253
254 DetIdx detIdx = toDetectorRegionIndex(element->chamberIndex(), element->side());
255 elementsPerStation[regionChamberHash(detIdx, element->chamberIndex())].push_back(element);
256 }
257 //construct the surfaces we want to map passive material on using the elements' geometrical parameters
258 passiveSurfaces = getPassiveMaterialSurfaces(gctx, std::move(elementsPerStation));
259
260 }, elements);
261
262 double halfLengthZ = 0.5 * std::abs(maxZ - minZ);
263 ATH_MSG_DEBUG("Inner radius: " << innerRadius<<", outer radius: " << outerRadius
264 <<", max Z: " << maxZ<<", min Z: " << minZ<<", half length Z: " << halfLengthZ);
265
266 Amg::Transform3D trf = Amg::getTranslateZ3D(halfLengthZ + minZ);
267
268 auto bounds = boundsFactory.makeBounds<Acts::CylinderVolumeBounds>(innerRadius, outerRadius, halfLengthZ);
269 auto volume = std::make_unique<Acts::TrackingVolume>(trf, bounds, name);
270 volume->assignGeometryId(id);
271
272 //put the passive material surfaces into the volume
273 std::ranges::for_each(passiveSurfaces, [&volume](auto& surf){
274 volume->addSurface(surf);
275 });
276
277 auto muonNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(volume));
278 ATH_MSG_DEBUG("There are " << nodes.size() << " nodes");
279 //loop through the nodes-material pairs to add the nodes to the muon node and assign the material to the faces
280 std::ranges::for_each(nodes, [&muonNode](auto& nodeVariant){
281 std::visit([&](auto&& ptr) {
282 muonNode->addChild(ptr);
283 }, nodeVariant);
284 });
285 return muonNode;
286 }
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
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::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...
Muon::MuonStationIndex::DetectorRegionIndex DetIdx
Abrivatin for the detector region index.
Gaudi::Property< bool > m_alignableVolumes
Flag to control if the volumes should be alignable or not.
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....
@ Mdt
MuonSpectrometer.
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
DetectorRegionIndex toDetectorRegionIndex(ChIndex index, int8_t etaSign)
convert ChamberIndex + etaSign into DetectorRegionIndex
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ getActiveMaterial()

template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
std::shared_ptr< const Acts::ISurfaceMaterial > ActsTrk::MuonBlueprintNodeBuilder::getActiveMaterial ( const T & element) const
private

Get the active material for a given element representing the chamber/sector.

Parameters
elementThe element for which to get the active material
Returns
The active surface material

Definition at line 622 of file MuonBlueprintNodeBuilder.cxx.

624 {
625
626 const float thickness = element.halfZ();
627 PVConstLink parentVolume = element.readoutEles().front()->getMaterialGeom()->getParent();
628 GeoModelTools::GeoMaterialHelper geoMaterialHelper;
629 std::pair<GeoModelTools::GeoMaterialPtr, double> geoMaterials = geoMaterialHelper.collectMaterial(parentVolume);
630
631 const Acts::Material aMat = ActsPlugins::GeoModel::geoMaterialConverter(*geoMaterials.first);
632 Acts::MaterialSlab slab{aMat, thickness};
633 std::shared_ptr<Acts::HomogeneousSurfaceMaterial> material = std::make_shared<Acts::HomogeneousSurfaceMaterial>(slab);
634 material->scale(0.5); // we want to split the active material in two and put it on the two faces of the chamber bounds
635
636 return material;
637
638}

◆ getMaterialBins()

std::pair< std::size_t, std::size_t > ActsTrk::MuonBlueprintNodeBuilder::getMaterialBins ( const Muon::MuonStationIndex::ChIndex chIdx) const
private

Definition at line 687 of file MuonBlueprintNodeBuilder.cxx.

687 {
688 switch(chIdx) {
689 using enum ChIndex;
690 case BIS:
691 case BIL:
692 return std::make_pair(1ul * m_nZBinsBI, 1ul * m_nPhiBinsBI);
693 case BML:
694 case BMS:
695 return std::make_pair(1ul * m_nZBinsBM, 1ul * m_nPhiBinsBM);
696 case BOL:
697 case BOS:
698 return std::make_pair(1ul * m_nZBinsBO, 1ul * m_nPhiBinsBO);
699 case EIS:
700 return std::make_pair(1ul* m_nRBinsEI1, 1ul* m_nPhiBinsEI1);
701 case EIL:
702 return std::make_pair(1ul* m_nRBinsEI2, 1ul* m_nPhiBinsEI2);
703 case EMS:
704 return std::make_pair(1ul* m_nRBinsEM1, 1ul* m_nPhiBinsEM1);
705 case EML:
706 return std::make_pair(1ul* m_nRBinsEM2, 1ul* m_nPhiBinsEM2);
707 default:
708 THROW_EXCEPTION("getMaterialBins() - "<<chName(chIdx)<<" is not yet implemented");
709 }
710 return std::make_pair(0ul, 0ul);
711}
@ BIL
Definition RegSelEnums.h:10
@ BOL
Definition RegSelEnums.h:14
@ BIS
Definition RegSelEnums.h:11
@ BOS
Definition RegSelEnums.h:15
@ BML
Definition RegSelEnums.h:12
@ BMS
Definition RegSelEnums.h:13
Gaudi::Property< std::size_t > m_nPhiBinsEM1
Number of bins in phi direction on the disc before the middle big wheel.
Gaudi::Property< std::size_t > m_nZBinsBI
Number of bins in Z direction on the BI cylinder surface.
Gaudi::Property< std::size_t > m_nZBinsBM
Number of bins in Z direction on the BM cylinder surface.
Gaudi::Property< std::size_t > m_nPhiBinsBI
Number of bins in phi direction on the BI cylinder surface.
Gaudi::Property< std::size_t > m_nPhiBinsEI1
Number of bins in phi direction on the disc before the NSW.
Gaudi::Property< std::size_t > m_nPhiBinsEM2
Number of bins in phi direction on the disc after the NSW.
Gaudi::Property< std::size_t > m_nPhiBinsEI2
Number of bins in phi direction on the disc after the NSW.
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.
Gaudi::Property< std::size_t > m_nPhiBinsBM
Number of bins in phi direction on the BM cylinder surface.
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.
const std::string & chName(ChIndex index)
convert ChIndex into a string
ChIndex
enum to classify the different chamber layers in the muon spectrometer

◆ getPassiveMaterialSurfaces() [1/2]

template<typename ElementSet_t>
std::vector< std::shared_ptr< Acts::Surface > > ActsTrk::MuonBlueprintNodeBuilder::getPassiveMaterialSurfaces ( const Acts::GeometryContext & gctx,
const std::unordered_map< unsigned int, ElementSet_t > & elementsPerStation ) const

Definition at line 470 of file MuonBlueprintNodeBuilder.cxx.

472 {
473
475 return {};
476 }
477 //this is a margin to put the surfaces along Z
478 //(a margin distance from the corresponding chamber's boundary surface)
479 constexpr double margin{4._mm};
480
481 std::vector<std::shared_ptr<Acts::Surface>> surfaces;
482 surfaces.reserve(elementsPerStation.size());
483 LayIdx layIdx = LayIdx::LayerIndexMax;
484 DetIdx detIdx = DetIdx::DetectorRegionIndexMax;
485
486 const ActsTrk::GeometryContext* context = gctx.get<const ActsTrk::GeometryContext* >();
487
488 //lamda function to reject BIS78 chambers from the extension of the passive surface
489 //otherwise they create overlap with the NSW sectors - stop a little bit before the cylinder of the passive surface
490 const auto rejectBIS78 = [&](const MuonGMR4::MuonReadoutElement* readoutEle) {
491 bool reject{false};
492 if(readoutEle->chamberIndex() != ChIdx::BIS){
493 return reject;
494 }
495 int stEta = readoutEle->stationEta();
496 if(m_isRun4){
497 stEta = std::abs(readoutEle->stationEta());
498 }
499 switch (readoutEle->detectorType()) {
500 case DetectorType::Mdt: {
501 const auto* techEle =
502 static_cast<const MuonGMR4::MdtReadoutElement*>(readoutEle);
503 if (techEle->multilayer() == 2 && stEta >= 7) {
504 reject = true;
505 }
506 break;
507 }
508 case DetectorType::Rpc: {
509 const auto* techEle =
510 static_cast<const MuonGMR4::RpcReadoutElement*>(readoutEle);
511 if (techEle->doubletZ() == 2 && stEta >= 7) {
512 reject = true;
513 }
514 break;
515 }
516 default:
517 break;
518 }
519 return reject;
520 };
521
522 for(const auto& [hash, elements] : elementsPerStation){
523
524 //decompose the layer hash to the detector region idx and layer index
525 const auto& [detIdxVal, chIdx] = decomposeRegionChamberHash(hash);
526 layIdx = toLayerIndex(chIdx);
527 detIdx = detIdxVal;
528
529 double maxZ{std::numeric_limits<double>::lowest()};
530 double minZ{std::numeric_limits<double>::max()};
531 double rMin{std::numeric_limits<double>::max()};
532 double rMax{std::numeric_limits<double>::lowest()};
533 //loop through the elements of every station to construct the cylinder/disc surfaces
534 for(const auto& el : elements){
535
536 if(rejectBIS78(el->readoutEles().front())){
537 continue;
538 }
539 const Amg::Transform3D& locToGlobal = el->localToGlobalTransform(*context);
540 const auto& bounds = el->bounds();
541 for(const auto& surface : bounds->orientedSurfaces(locToGlobal)){
542 const auto& surfaceRepr = (*surface.surface);
543 const Amg::Vector3D& center = surfaceRepr.center(gctx);
544 rMin = std::min(rMin, center.perp());
545 minZ = std::min(minZ, center.z());
546 maxZ = std::max(maxZ, center.z());
547 rMax = std::max(rMax, center.perp());
548 }
549
550 }
551 double halfZ = 0.5*std::abs(maxZ-minZ);
552 Amg::Transform3D trf = Amg::Transform3D::Identity();
553 double zShift{0.};
554 // the chambers are groupd per chamber index and detector region(side) -
555 // we can use the first one for the distinction
556 const auto& testCh = elements.front();
557 int8_t side = testCh->side();
558 switch (testCh->chamberIndex()) {
559 //small NSW sectors (disc passive surface in front of NSW and one in front of EMS)
560 case ChIdx::EIS :
561 case ChIdx::EMS :{
562 side > 0 ? zShift = minZ - margin : zShift = maxZ + margin;
563 trf = Amg::getTranslateZ3D(zShift);
564 auto surface = Acts::Surface::makeShared<Acts::DiscSurface>(trf, std::make_shared<Acts::RadialBounds>(rMin, rMax));
565 const auto [nBins1, nBins2] = getMaterialBins(testCh->chamberIndex());
566 surface->assignSurfaceMaterial(preparePassiveMaterial(surface->bounds(), nBins1, nBins2));
567 surfaces.push_back(surface);
568 break;
569 //large sectors (disc passive surface after NSW/EIL and after EML)
570 } case ChIdx::EIL :
571 case ChIdx::EML : {
572 // HARDCODED!! (maybe think a better solution in the future)
573 // But for the EIL that we put after the EIS/EIL chambers we extend the radius of the disc surface
574 // in order to have a better coverage for the projections from EE
575 if(testCh->chamberIndex() == ChIdx::EIL){
576 rMax += 60*margin;
577 }
578 side > 0 ? zShift = maxZ + margin : zShift = minZ - margin;
579 trf = Amg::getTranslateZ3D(zShift);
580 auto surface = Acts::Surface::makeShared<Acts::DiscSurface>(trf,
581 std::make_shared<Acts::RadialBounds>(rMin, rMax));
582 const auto [nBins1, nBins2] = getMaterialBins(testCh->chamberIndex());
583 surface->assignSurfaceMaterial(preparePassiveMaterial(surface->bounds(), nBins1, nBins2));
584 surfaces.push_back(surface);
585 break;
586 } case ChIdx::BIS :
587 case ChIdx::BML :
588 case ChIdx::BOL : {
589 //hack for run3 because of overlaps with eta = -7 BIS chambers
590
591 if(!m_isRun4 && testCh->chamberIndex() == ChIdx::BIS){
592 halfZ -= 130.;
593
594 }
595 auto surface = Acts::Surface::makeShared<Acts::CylinderSurface>(trf,
596 std::make_shared<Acts::CylinderBounds>(rMin - margin, halfZ));
597 const auto [nBins1, nBins2] = getMaterialBins(testCh->chamberIndex());
598 surface->assignSurfaceMaterial(preparePassiveMaterial(surface->bounds(), nBins1, nBins2));
599 surfaces.push_back(surface);
600 break;
601 } default :
602 THROW_EXCEPTION("No implementation of passive material surface for this station!!!! - sorry :) ");
603 }
604 ATH_MSG_VERBOSE("Putting passive material surface for station " << layerName(layIdx) << "/ "<< regionName(detIdx) << ": minZ = " << minZ << ", maxZ = " << maxZ<< "and radius "<< rMax);
605 }
606
607 if(msgLvl(MSG::VERBOSE)){
608 std::stringstream stream{};
609 for(const auto& surf : surfaces){
610 stream<< " at position : "<< Amg::toString(surf->center(gctx))
611 << "with bounds "<< surf->bounds()<<std::endl;
612 }
613 ATH_MSG_VERBOSE("Constructed "<< surfaces.size()
614 << " surfaces for passive material description : "<<std::endl<<stream.str());
615 }
616
617 return surfaces;
618}
#define ATH_MSG_VERBOSE(x)
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< bool > m_buildPassiveVolumes
Flag to construct the passive material surfaces.
Gaudi::Property< bool > m_isRun4
Flag to control if we use run4 geometry or not.
std::pair< std::size_t, std::size_t > getMaterialBins(const Muon::MuonStationIndex::ChIndex chIdx) const
Muon::MuonStationIndex::LayerIndex LayIdx
Abrivation for the layer index.
@ Rpc
Monitored Drift Tubes.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double halfZ(const Acts::VolumeBounds &bounds)
Returns the half-Z length for the parsed volume bounds (Trapezoid/ Cuboid).
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
std::pair< DetectorRegionIndex, ChIndex > decomposeRegionChamberHash(unsigned int hash)
decompose the hash into Region and Chamber
const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex

◆ getPassiveMaterialSurfaces() [2/2]

template<typename ElementSet_t>
std::vector< surfacePtr > ActsTrk::MuonBlueprintNodeBuilder::getPassiveMaterialSurfaces ( const Acts::GeometryContext & gctx,
const std::unordered_map< unsigned int, ElementSet_t > & elementsPerStation ) const
private

Construct and return the surfaces for the passive material description (e.g cylinders for barrel/ discs for endcaps).

Parameters
gctxThe geometry context
elementsPerStationThe elements (chambers or sectors) grouped per station to which we want to assign passive material This function uses the elements of the station to construct the surfaces and define their bounds

◆ getSensitiveElements()

template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
MuonBlueprintNodeBuilder::BluePrintSurfPairs_t ActsTrk::MuonBlueprintNodeBuilder::getSensitiveElements ( const ActsTrk::GeometryContext & gctx,
const T & element,
const Acts::GeometryIdentifier & chId,
Acts::VolumeBoundFactory & boundsFactory ) const
private

Get the chamber's sensitive elements.

Parameters
gctxGeometry context
elementThe element for which to get the sensitive elements (chamber or sector)
chIdThe geometry identifier of the chamber
boundsFactoryThe factory for volume bounds This function constructs and returns the sensitive elements (volumes and surfaces) of the sector.

Definition at line 325 of file MuonBlueprintNodeBuilder.cxx.

329 {
330
331 std::vector<blueprintNodePtr> readoutVolumes;
332 std::vector<surfacePtr> readoutSurfaces;
333 Acts::GeometryIdentifier::Value mdtId{1};
334
335 for (const MuonGMR4::MuonReadoutElement* readoutEle : element.readoutEles()) {
336
337 std::vector<surfacePtr> detSurfaces = readoutEle->getSurfaces();
338 switch(readoutEle->detectorType()){
339 case DetectorType::Mdt: {
340 const auto* mdtReadoutEle = static_cast<const MuonGMR4::MdtReadoutElement*>(readoutEle);
341 const MuonGMR4::MdtReadoutElement::parameterBook& parameters{mdtReadoutEle->getParameters()};
342
343 std::unique_ptr<ActsTrk::VolumePlacement> placement{};
344
345 // create the MDT multilayer volume with the dedicated builder
346 Acts::Experimental::MultiWireVolumeBuilder::Config mwCfg;
347 mwCfg.name = m_detMgr->idHelperSvc()->toStringDetEl(mdtReadoutEle->identify());
348 mwCfg.mlSurfaces = detSurfaces;
349 mwCfg.transform = readoutEle->localToGlobalTransform(gctx);
350
351 //initialize a nullptr material node which will be filled in the case of single MDT readout elements
352 //and used to assign the material to the volume and add the static node as child of the material node
353 std::shared_ptr<Acts::Experimental::MaterialDesignatorBlueprintNode> mdtMaterialNode;
354
355 //special treatment of BIS78 MDT multilayer
356 //use different shape because of clashes with EIL chambers
357 if(isBIS78(readoutEle) && mdtReadoutEle->multilayer() == 2){
358
359
360 //find the minimum and the maximum tube length (x dimension of the diamond bounds)
361 std::vector<double> tubeLengths;
362 tubeLengths.reserve(mdtReadoutEle->numTubesInLay());
363 for(std::size_t tube = 1; tube < mdtReadoutEle->numTubesInLay(); ++tube){
364 const IdentifierHash tubeHash = MuonGMR4::MdtReadoutElement::measurementHash(1,tube);
365 const auto& surface = mdtReadoutEle->surface(tubeHash);
366 const auto& lBounds = static_cast<const Acts::LineBounds&>(surface.bounds());
367 using BoundEnum = Acts::LineBounds::BoundValues;
368 const double tubeLength = 2.*lBounds.get(BoundEnum::eHalfLengthZ);
369 tubeLengths.push_back(tubeLength);
370 }
371 auto [minX,maxX] = std::ranges::minmax_element(tubeLengths);
372 int nSmallTubes = std::count_if(tubeLengths.begin(), tubeLengths.end(), [minX](double length){
373 return std::abs(*minX-length) < Acts::s_epsilon;
374 });
375
376 //create the diamond bounds for the volume
377 constexpr double extraMargin = 1._cm;
378 double y2 = (nSmallTubes+1.)*parameters.tubePitch;
379 double y1 = 2.*parameters.halfY + extraMargin - y2;
380 if (m_alignableVolumes) {
381 placement = std::make_unique<ActsTrk::VolumePlacement>(*readoutEle,
382 Amg::getTranslateY3D(parameters.halfY + extraMargin -y2));
383 }
384 mwCfg.transform = mwCfg.transform * Amg::getTranslateY3D(parameters.halfY + extraMargin - y2);
385 mwCfg.bounds = boundsFactory.makeBounds<Acts::DiamondVolumeBounds>(0.5*(*maxX), 0.5*(*maxX), 0.5*(*minX),
386 y1, y2, parameters.halfHeight);
387
388 } else {
390 placement = std::make_unique<ActsTrk::VolumePlacement>(*readoutEle);
391 }
392 //check for rectangular or trapezoidal shape bounds
393 if(std::abs(parameters.shortHalfX - parameters.longHalfX) < Acts::s_epsilon){
394 mwCfg.bounds = boundsFactory.makeBounds<Acts::CuboidVolumeBounds>(parameters.shortHalfX,
395 parameters.halfY,
396 parameters.halfHeight);
397 } else {
398 mwCfg.bounds = boundsFactory.makeBounds<Acts::TrapezoidVolumeBounds>(parameters.shortHalfX,
399 parameters.longHalfX,
400 parameters.halfY,
401 parameters.halfHeight);
402 }
403 }
404 mwCfg.alignablePlacement = placement.get();
406 element.addPlacement(std::move(placement));
407 }
408 mwCfg.binning = {{{Acts::AxisDirection::AxisY, Acts::AxisBoundaryType::Bound,
409 -parameters.halfY,
410 parameters.halfY,
411 static_cast<std::size_t>(std::lround(2 * parameters.halfY / parameters.tubePitch))}, 2u},
412 {{Acts::AxisDirection::AxisZ, Acts::AxisBoundaryType::Bound,
413 -parameters.halfHeight,
414 parameters.halfHeight,
415 static_cast<std::size_t>(std::lround(2 * parameters.halfHeight / parameters.tubePitch))}, 1u}};
416 Acts::Experimental::MultiWireVolumeBuilder mdtBuilder{mwCfg};
417 std::unique_ptr<Acts::TrackingVolume> mdtVolume = mdtBuilder.buildVolume();
418
419 mdtVolume->assignGeometryId(chId.withExtra(mdtId++));
420 //create the blueprint node for the mdt multilayers
421 // check if this is a single mdt (single multilayer) chamber so we assign the material directly to the multilayer
422 if(element.readoutEles().size() == 1 && m_assignActiveMaterial){
423
424 mdtMaterialNode = std::make_shared<Acts::Experimental::MaterialDesignatorBlueprintNode>(element.identString() + "_MaterialNode");
425 configureMaterialFaces(*mdtMaterialNode, mdtVolume->volumeBounds(), getActiveMaterial(element));
426 auto staticNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(mdtVolume));
427 mdtMaterialNode->addChild(std::move(staticNode));
428 readoutVolumes.push_back(std::move(mdtMaterialNode));
429 break;
430 }
431 auto mdtNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(mdtVolume));
432 mdtNode->setNavigationPolicyFactory(mdtBuilder.createNavigationPolicyFactory());
433 readoutVolumes.push_back(std::move(mdtNode));
434
435 break;
436
437 } case DetectorType::Rpc:
440 case DetectorType::Mm: {
441
442 readoutSurfaces.insert(readoutSurfaces.end(), std::make_move_iterator(detSurfaces.begin()),
443 std::make_move_iterator(detSurfaces.end()));
444
445 break;
446
447 } default:
448 THROW_EXCEPTION("Unknown detector type for readout element: " << readoutEle->detectorType());
449 break;
450
451 }
452 }
453
454 return std::make_pair(std::move(readoutVolumes), std::move(readoutSurfaces));
455}
double length(const pvec &v)
double tubeLength
bool isBIS78(const MuonGMR4::MuonReadoutElement *element) const
Helper function determining whether a readout element is BIS78.
static IdentifierHash measurementHash(unsigned layerNumber, unsigned tubeNumber)
Constructs a Measurement hash from layer && tube number.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW).
Amg::Transform3D getTranslateY3D(const double Y)
: Returns a shift transformation along the y-axis

◆ initialize()

StatusCode ActsTrk::MuonBlueprintNodeBuilder::initialize ( )
override

Definition at line 90 of file MuonBlueprintNodeBuilder.cxx.

90 {
91 ATH_CHECK(detStore()->retrieve(m_detMgr));
92 return StatusCode::SUCCESS;
93 }
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ isBIS78()

bool ActsTrk::MuonBlueprintNodeBuilder::isBIS78 ( const MuonGMR4::MuonReadoutElement * element) const
private

Helper function determining whether a readout element is BIS78.

Definition at line 458 of file MuonBlueprintNodeBuilder.cxx.

458 {
459 int stEta = element->stationEta();
460 if(m_isRun4){
461 stEta = std::abs(element->stationEta());
462 }
463 return element->detectorType() == ActsTrk::DetectorType::Mdt &&
464 element->chamberIndex() == ChIndex::BIS &&
465 stEta >= 7;
466 }
virtual DetectorType detectorType() const =0
Returns the detector element type.
int stationEta() const
Returns the stationEta (positive A site, negative C site).
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS).

◆ isElementInTheStation()

template<typename T>
requires (std::is_same_v<T, MuonGMR4::Chamber> || std::is_same_v<T, MuonGMR4::SpectrometerSector>)
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
elementThe element to check (chamber or sector)
stationNamesThe names of the stations to check against
sideThe 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 641 of file MuonBlueprintNodeBuilder.cxx.

645 {
646 bool etaSignCorrect = (side == EndcapSide::Both) ||
647 (side == EndcapSide::A && element.side() > 0) ||
648 (side == EndcapSide::C && element.side() < 0);
649 return etaSignCorrect &&
650 Acts::rangeContainsValue(stationIndex, toStationIndex(element.chamberIndex()));
651}
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex

◆ preparePassiveMaterial()

std::shared_ptr< Acts::ISurfaceMaterial > ActsTrk::MuonBlueprintNodeBuilder::preparePassiveMaterial ( const Acts::SurfaceBounds & bounds,
const std::size_t nBins1,
const std::size_t nBins2 ) const
private

Prepare a binned material which is associated to the surface.

Parameters
typeThe surface type on which the material is mapped (Plane, Disc, Cylinder)
nBins1Number of bins in the local0 direction
nBins2Number of bins in the complementary direction

Definition at line 655 of file MuonBlueprintNodeBuilder.cxx.

657 {
658 if (nBins1 == 0 || nBins2 == 0) {
659 ATH_MSG_ERROR("Cannot create material for "<<bounds
660 <<" as one of the bin dimensions is zero. nBins1: "<<nBins1<<", nBins2: "<<nBins2);
661 return nullptr;
662 }
663 if (nBins1 == 1 && nBins1 == nBins2) {
664 return std::make_shared<Acts::HomogeneousSurfaceMaterial>();
665 }
666
667 std::vector<Acts::DirectedProtoAxis> pmBinning = {};
668
669 switch (bounds.type()) {
670 using enum Acts::SurfaceBounds::BoundsType;
671 case eCylinder: {
672 pmBinning = {{Acts::AxisDirection::AxisZ, Acts::AxisBoundaryType::Bound, nBins1},
673 {Acts::AxisDirection::AxisRPhi, Acts::AxisBoundaryType::Bound, nBins2}};
674 break;
675 } case eDisc: {
676 pmBinning = {{Acts::AxisDirection::AxisR, Acts::AxisBoundaryType::Bound, nBins1},
677 {Acts::AxisDirection::AxisPhi, Acts::AxisBoundaryType::Bound, nBins2}};
678
679 break;
680 } default:
681 ATH_MSG_ERROR("Unsupoorted type "<<bounds<<".");
682 return nullptr;
683 }
684 return std::make_shared<Acts::ProtoGridSurfaceMaterial>(pmBinning);
685}
#define ATH_MSG_ERROR(x)

Member Data Documentation

◆ m_alignableVolumes

Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_alignableVolumes {this, "AlignableVolumes", true}
private

Flag to control if the volumes should be alignable or not.

Definition at line 94 of file MuonBlueprintNodeBuilder.h.

94{this, "AlignableVolumes", true};

◆ m_assignActiveMaterial

Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_assignActiveMaterial {this, "AssignActiveMaterial", false}
private

Flag to assign active material on the chambers.

Definition at line 98 of file MuonBlueprintNodeBuilder.h.

98{this, "AssignActiveMaterial", false};

◆ m_buildPassiveVolumes

Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_buildPassiveVolumes {this, "BuildPassiveVolumes", false}
private

Flag to construct the passive material surfaces.

Definition at line 100 of file MuonBlueprintNodeBuilder.h.

100{this, "BuildPassiveVolumes", false};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* ActsTrk::MuonBlueprintNodeBuilder::m_detMgr {nullptr}
private

the Detector manager

Definition at line 90 of file MuonBlueprintNodeBuilder.h.

90{nullptr};

◆ m_isRun4

Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_isRun4 {this, "run4Layout", false}
private

Flag to control if we use run4 geometry or not.

Definition at line 96 of file MuonBlueprintNodeBuilder.h.

96{this, "run4Layout", false};

◆ m_nPhiBinsBI

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsBI {this, "nPhiBinsBI", 16}
private

Number of bins in phi direction on the BI cylinder surface.

Definition at line 102 of file MuonBlueprintNodeBuilder.h.

102{this, "nPhiBinsBI", 16};

◆ m_nPhiBinsBM

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsBM {this, "nPhiBinsBM", 16}
private

Number of bins in phi direction on the BM cylinder surface.

Definition at line 106 of file MuonBlueprintNodeBuilder.h.

106{this, "nPhiBinsBM", 16};

◆ m_nPhiBinsBO

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsBO {this, "nPhiBinsBO", 16}
private

Number of bins in phi direction on the BM cylinder surface.

Definition at line 110 of file MuonBlueprintNodeBuilder.h.

110{this, "nPhiBinsBO", 16};

◆ m_nPhiBinsEI1

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsEI1 {this, "nPhiBinsEIbNSW", 16}
private

Number of bins in phi direction on the disc before the NSW.

Definition at line 116 of file MuonBlueprintNodeBuilder.h.

116{this, "nPhiBinsEIbNSW", 16};

◆ m_nPhiBinsEI2

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsEI2 {this, "nPhiBinsEIaNSW", 16}
private

Number of bins in phi direction on the disc after the NSW.

Definition at line 120 of file MuonBlueprintNodeBuilder.h.

120{this, "nPhiBinsEIaNSW", 16};

◆ m_nPhiBinsEM1

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsEM1 {this, "nPhiBinsEMbBW", 16}
private

Number of bins in phi direction on the disc before the middle big wheel.

Definition at line 125 of file MuonBlueprintNodeBuilder.h.

125{this, "nPhiBinsEMbBW", 16};

◆ m_nPhiBinsEM2

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nPhiBinsEM2 {this, "nPhiBinsEMaBW", 16}
private

Number of bins in phi direction on the disc after the NSW.

Definition at line 129 of file MuonBlueprintNodeBuilder.h.

129{this, "nPhiBinsEMaBW", 16};

◆ m_nRBinsEI1

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nRBinsEI1 {this, "nRBinsEIbNSW", 4}
private

Number of bins in R direction on the disc before the NSW.

Definition at line 114 of file MuonBlueprintNodeBuilder.h.

114{this, "nRBinsEIbNSW", 4};

◆ m_nRBinsEI2

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nRBinsEI2 {this, "nRBinsEIaNSW", 4}
private

Number of bins in R direction on the disc after the NSW.

Definition at line 118 of file MuonBlueprintNodeBuilder.h.

118{this, "nRBinsEIaNSW", 4};

◆ m_nRBinsEM1

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nRBinsEM1 {this, "nRBinsEMbBW", 16}
private

Number of bins in R direction on the disc before the middle big wheel.

Definition at line 123 of file MuonBlueprintNodeBuilder.h.

123{this, "nRBinsEMbBW", 16};

◆ m_nRBinsEM2

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nRBinsEM2 {this, "nRBinsEMaBW", 5}
private

Number of bins in R direction on the disc after the middle big wheel.

Definition at line 127 of file MuonBlueprintNodeBuilder.h.

127{this, "nRBinsEMaBW", 5};

◆ m_nZBinsBI

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nZBinsBI {this, "nZBinsBI", 12}
private

Number of bins in Z direction on the BI cylinder surface.

Definition at line 104 of file MuonBlueprintNodeBuilder.h.

104{this, "nZBinsBI", 12};

◆ m_nZBinsBM

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nZBinsBM {this, "nZBinsBM", 12}
private

Number of bins in Z direction on the BM cylinder surface.

Definition at line 108 of file MuonBlueprintNodeBuilder.h.

108{this, "nZBinsBM", 12};

◆ m_nZBinsBO

Gaudi::Property<std::size_t> ActsTrk::MuonBlueprintNodeBuilder::m_nZBinsBO {this, "nZBinsBO", 12}
private

Number of bins in Z direction on the BM cylinder surface.

Definition at line 112 of file MuonBlueprintNodeBuilder.h.

112{this, "nZBinsBO", 12};

◆ m_useSectors

Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_useSectors {this, "UseSectors", false}
private

Flag to control if we want to build the muon node from sectors or chambers.

Definition at line 92 of file MuonBlueprintNodeBuilder.h.

92{this, "UseSectors", false};

The documentation for this class was generated from the following files: