 |
ATLAS Offline Software
|
Helper class to build a Blueprint node of the muon system.
More...
#include <MuonBlueprintNodeBuilder.h>
|
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. More...
|
|
|
std::shared_ptr< Acts::Surface > | blendChamberMaterial (const MuonGMR4::Chamber &chamber) const |
| Blend the chamber's material as plane surface. More...
|
|
std::pair< std::vector< volumePtr >, std::vector< surfacePtr > > | getSensitiveElements (const ActsGeometryContext &gctx, const MuonGMR4::Chamber &chamber, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const |
| Get the chamber's sensitive elements. More...
|
|
bool | isChamberInTheStation (const MuonGMR4::Chamber &chamber, const std::vector< StIdx > &stationNames, const EndcapSide &side) const |
| Check if the chamber is in this node. More...
|
|
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > | buildMuonNode (const Acts::GeometryContext &gctx, const MuonChamberSet &chambers, const std::string &name, const Acts::GeometryIdentifier &id, Acts::VolumeBoundFactory &boundsFactory) const |
| Build subnodes for the muon system node. More...
|
|
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 48 of file MuonBlueprintNodeBuilder.h.
◆ EndcapSide
◆ blendChamberMaterial()
std::shared_ptr< Acts::Surface > ActsTrk::MuonBlueprintNodeBuilder::blendChamberMaterial |
( |
const MuonGMR4::Chamber & |
chamber | ) |
const |
|
private |
Blend the chamber's material as plane surface.
- Parameters
-
chamber | The chamber to blend the material for |
chamberTransform | The transformation of the chamber |
materialBoundsFactory | The factory for surface bounds This function returns a plane surface with the chamber's material assigned to be placed at the center of the chamber. |
Definition at line 255 of file MuonBlueprintNodeBuilder.cxx.
258 const float thickness =
chamber.halfZ() * 2;
259 PVConstLink parentVolume =
chamber.readoutEles().front()->getMaterialGeom()->getParent();
260 GeoModelTools::GeoMaterialHelper geoMaterialHelper;
261 std::pair<GeoModelTools::GeoMaterialPtr, double> geoMaterials = geoMaterialHelper.collectMaterial(parentVolume);
263 const Acts::Material aMat = Acts::GeoModel::geoMaterialConverter(*geoMaterials.first);
265 auto constPtr =
chamber.surface().getSharedPtr();
267 auto ptr = std::const_pointer_cast<Acts::Surface>(constPtr);
268 Acts::MaterialSlab slab{aMat, thickness};
269 std::shared_ptr<Acts::HomogeneousSurfaceMaterial> material = std::make_shared<Acts::HomogeneousSurfaceMaterial>(slab);
270 ptr->assignSurfaceMaterial(material);
◆ 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
-
gctx | Geometry context |
childNode | The blueprint node as child of this node (for Muon System it should be Calo or Itk). |
Definition at line 46 of file MuonBlueprintNodeBuilder.cxx.
60 endcapAStations.insert(
chamber);
62 endcapCStations.insert(
chamber);
67 auto muonNode = std::make_shared<Acts::Experimental::CylinderContainerBlueprintNode>(
"MuonNode", Acts::AxisDirection::AxisZ);
69 Acts::VolumeBoundFactory boundsFactory{};
71 auto barrelNode =
buildMuonNode(gctx, barrelStations,
"BI_BM_BO_EE_EI",Acts::GeometryIdentifier().withVolume(s_muonBarrelId), boundsFactory);
72 auto endcapANode =
buildMuonNode(gctx, endcapAStations,
"EM_EO_A", Acts::GeometryIdentifier().withVolume(s_muonEndcapAId), boundsFactory);
73 auto endcapCNode =
buildMuonNode(gctx, endcapCStations,
"EM_EO_C", Acts::GeometryIdentifier().withVolume(s_muonEndcapCId), boundsFactory);
77 barrelNode->addChild(std::move(childNode));
80 muonNode->addChild(std::move(barrelNode));
81 muonNode->addChild(std::move(endcapANode));
82 muonNode->addChild(std::move(endcapCNode));
◆ buildMuonNode()
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > ActsTrk::MuonBlueprintNodeBuilder::buildMuonNode |
( |
const Acts::GeometryContext & |
gctx, |
|
|
const MuonChamberSet & |
chambers, |
|
|
const std::string & |
name, |
|
|
const Acts::GeometryIdentifier & |
id, |
|
|
Acts::VolumeBoundFactory & |
boundsFactory |
|
) |
| const |
|
private |
Build subnodes for the muon system node.
- Parameters
-
gctx | The geometry context |
stations | The name of the stations to include |
side | The side (A, C or Both) |
id | The geometry identifier of this node |
boundsFactory | The factory for volume bounds |
Definition at line 89 of file MuonBlueprintNodeBuilder.cxx.
97 std::vector<std::string> stationNames;
99 std::vector<std::shared_ptr<Acts::Experimental::StaticBlueprintNode>> nodes;
101 double innerRadius = 0.0;
102 double outerRadius = std::numeric_limits<double>::lowest();
103 double maxZ = std::numeric_limits<double>::lowest();
111 auto vol = std::make_unique<Acts::TrackingVolume>(
118 vol->addSurface(std::move(material));
120 Acts::GeometryIdentifier chId =
id.withLayer(chamberId++);
121 vol->assignGeometryId(chId);
123 std::pair<std::vector<volumePtr>,std::vector<surfacePtr>> innerStructure =
getSensitiveElements(*context, *
chamber, chId, boundsFactory);
125 for(
auto& surface: innerStructure.second){
126 vol->addSurface(surface);
130 for(
const auto& surface: vol->boundarySurfaces()){
131 const auto& surfaceRepr = surface->surfaceRepresentation();
132 const Acts::Polyhedron& polyhedron = surfaceRepr.polyhedronRepresentation(gctx);
145 Acts::ObjVisualization3D
helper;
146 vol->visualize(
helper, gctx, {.visible =
true},
147 {.visible =
false}, {.visible =
true});
152 auto node = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(vol));
153 for(
auto& readoutVol : innerStructure.first){
154 node->addStaticVolume(std::move(readoutVol));
158 nodes.emplace_back(std::move(
node));
161 double halfLengthZ = 0.5 * std::abs(maxZ - minZ);
170 auto bounds = boundsFactory.makeBounds<Acts::CylinderVolumeBounds>(innerRadius, outerRadius, halfLengthZ);
171 auto volume = std::make_unique<Acts::TrackingVolume>(
trf, bounds,
name);
172 volume->assignGeometryId(
id);
173 auto muonNode = std::make_shared<Acts::Experimental::StaticBlueprintNode>(std::move(volume));
176 std::ranges::for_each(nodes, [&muonNode](
auto&
node) {
177 muonNode->addChild(std::move(
node));
◆ getSensitiveElements()
Get the chamber's sensitive elements.
- Parameters
-
gctx | The geometry context |
chamber | The chamber to get the elements from |
chId | The geometry identifier of the chamber |
boundsFactory | The factory for volume bounds This function constructs and returns the sensitive elements (volumes and surfaces) of the chamber. |
Definition at line 184 of file MuonBlueprintNodeBuilder.cxx.
190 std::vector<volumePtr> readoutVolumes;
191 std::vector<surfacePtr> readoutSurfaces;
192 Acts::GeometryIdentifier::Value mdtId{1};
196 std::vector<surfacePtr> detSurfaces = readoutEle->getSurfaces();
197 switch(readoutEle->detectorType()){
207 Acts::Experimental::MultiWireVolumeBuilder::Config mwCfg;
209 mwCfg.mlSurfaces = detSurfaces;
210 mwCfg.transform = mdtTransform;
212 auto mdtBounds = boundsFactory.makeBounds<Acts::TrapezoidVolumeBounds>(
parameters.shortHalfX,
215 mwCfg.bounds = mdtBounds;
216 using BoundsV = Acts::TrapezoidVolumeBounds::BoundValues;
217 mwCfg.binning = {{{Acts::AxisDirection::AxisY, Acts::AxisBoundaryType::Bound,
218 -mdtBounds->get(BoundsV::eHalfLengthY),
219 mdtBounds->get(BoundsV::eHalfLengthY),
220 static_cast<std::size_t
>(std::lround(2 * mdtBounds->get(BoundsV::eHalfLengthY) /
parameters.tubePitch))}, 2
u},
221 {{Acts::AxisDirection::AxisZ, Acts::AxisBoundaryType::Bound,
222 -mdtBounds->get(BoundsV::eHalfLengthZ),
223 mdtBounds->get(BoundsV::eHalfLengthZ),
224 static_cast<std::size_t
>(std::lround(2 * mdtBounds->get(BoundsV::eHalfLengthZ) /
parameters.tubePitch))}, 1
u}};
225 Acts::Experimental::MultiWireVolumeBuilder mdtBuilder{mwCfg};
226 std::unique_ptr<Acts::TrackingVolume> mdtVolume = mdtBuilder.buildVolume(gctx.
context());
228 mdtVolume->assignGeometryId(chId.withExtra(mdtId++));
229 readoutVolumes.push_back(std::move(mdtVolume));
237 readoutSurfaces.insert(readoutSurfaces.end(), std::make_move_iterator(detSurfaces.begin()),
238 std::make_move_iterator(detSurfaces.end()));
249 return std::make_pair(std::move(readoutVolumes), std::move(readoutSurfaces));
◆ initialize()
StatusCode ActsTrk::MuonBlueprintNodeBuilder::initialize |
( |
| ) |
|
|
override |
◆ isChamberInTheStation()
Check if the chamber is in this node.
- Parameters
-
chamber | The chamber to check
|
stationNames | The names of the stations to check against |
side | The 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 275 of file MuonBlueprintNodeBuilder.cxx.
277 bool matchesName = std::ranges::any_of(stationIndex.begin(), stationIndex.end(), [&](
const auto&
n){
278 return stationIdx == n;
282 return matchesName && etaSignCorrect;
◆ m_detMgr
◆ m_dumpVolumes
Gaudi::Property<bool> ActsTrk::MuonBlueprintNodeBuilder::m_dumpVolumes {this, "dumpVolumes", false} |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
const float EO[NO]
Energy levels for Oxygen.
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
@ Tgc
Resitive Plate Chambers.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
virtual std::string toStringDetEl(const Identifier &id) const =0
print all fields up to detector element to string
Gaudi::Property< bool > m_dumpVolumes
const MuonGMR4::MuonDetectorManager * m_detMgr
@ u
Enums for curvilinear frames.
Acts::GeometryContext context() const
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
std::shared_ptr< Acts::Surface > blendChamberMaterial(const MuonGMR4::Chamber &chamber) const
Blend the chamber's material as plane surface.
Muon::MuonStationIndex::StIndex StIdx
@ Mm
Maybe not needed in the migration.
Set of parameters to describe a MDT chamber.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
bool isChamberInTheStation(const MuonGMR4::Chamber &chamber, const std::vector< StIdx > &stationNames, const EndcapSide &side) const
Check if the chamber is in this node.
Include the GeoPrimitives which need to be put first.
std::string to_string(const DetectorType &type)
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)
std::pair< std::vector< volumePtr >, std::vector< surfacePtr > > getSensitiveElements(const ActsGeometryContext &gctx, const MuonGMR4::Chamber &chamber, const Acts::GeometryIdentifier &chId, Acts::VolumeBoundFactory &boundsFactory) const
Get the chamber's sensitive elements.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
@ Rpc
Monitored Drift Tubes.
constexpr uint8_t stationEta
1 to 3
std::shared_ptr< Acts::Experimental::StaticBlueprintNode > buildMuonNode(const Acts::GeometryContext &gctx, const MuonChamberSet &chambers, const std::string &name, const Acts::GeometryIdentifier &id, Acts::VolumeBoundFactory &boundsFactory) const
Build subnodes for the muon system node.
MuonChamberSet getAllChambers() const
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis