ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDetectorDefs.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5#include <GaudiKernel/SystemOfUnits.h>
6
7#ifndef SIMULATIONBASE
8# include <Acts/Geometry/VolumeBounds.hpp>
9# include <Acts/Geometry/CuboidVolumeBounds.hpp>
10# include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
11#endif
12
13namespace MuonGMR4 {
14 std::unique_ptr<ActsTrk::DetectorAlignStore> copyDeltas(const ActsTrk::DetectorAlignStore& inStore) {
15 auto newStore = std::make_unique<ActsTrk::DetectorAlignStore>(inStore);
16 if(newStore->geoModelAlignment) {
17 if (!inStore.geoModelAlignment->posCacheLocked()) {
18 newStore->geoModelAlignment->clearPosCache();
19 }
20 newStore->trackingAlignment = std::make_unique<ActsTrk::DetectorAlignStore::TrackingAlignStore>(inStore.detType);
21 }
22 return newStore;
23 }
24 namespace detail{
26 return type == ActsTrk::DetectorType::sTgc ? Amg::Transform3D::Identity()
27 : Amg::getRotateY3D(90. * Gaudi::Units::deg) * Amg::getRotateZ3D(90. * Gaudi::Units::deg);
28 }
29 }
30
31#ifndef SIMULATIONBASE
32 double halfXlowY(const Acts::VolumeBounds& visitBounds) {
33 switch (visitBounds.type()) {
34 case Acts::VolumeBounds::BoundsType::eCuboid: {
35 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
36 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
37 return bounds.get(BoundEnum::eHalfLengthX);
38 }
39 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
40 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
41 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
42 return bounds.get(BoundEnum::eHalfLengthXnegY);
43 } default:
44 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
45 }
46 return 0.;
47 }
48 double halfXhighY(const Acts::VolumeBounds& visitBounds) {
49 switch (visitBounds.type()) {
50 case Acts::VolumeBounds::BoundsType::eCuboid: {
51 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
52 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
53 return bounds.get(BoundEnum::eHalfLengthX);
54 }
55 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
56 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
57 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
58 return bounds.get(BoundEnum::eHalfLengthXposY);
59 } default:
60 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
61 }
62 return 0.;
63 }
64 double halfY(const Acts::VolumeBounds& visitBounds) {
65 switch (visitBounds.type()) {
66 case Acts::VolumeBounds::BoundsType::eCuboid: {
67 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
68 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
69 return bounds.get(BoundEnum::eHalfLengthY);
70 }
71 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
72 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
73 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
74 return bounds.get(BoundEnum::eHalfLengthY);
75 } default:
76 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
77 }
78 return 0.;
79
80 }
81 double halfZ(const Acts::VolumeBounds& visitBounds) {
82 switch (visitBounds.type()) {
83 case Acts::VolumeBounds::BoundsType::eCuboid: {
84 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
85 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
86 return bounds.get(BoundEnum::eHalfLengthZ);
87 }
88 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
89 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
90 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
91 return bounds.get(BoundEnum::eHalfLengthZ);
92 } default:
93 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
94 }
95 return 0.;
96 }
97#endif
98}
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.
DetectorType detType
The aligned detector element type.
bool posCacheLocked() const
Returns whether the position cache is locked.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ sTgc
Micromegas (NSW)
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Eigen::Affine3d Transform3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Amg::Transform3D rotationToAMDB(const ActsTrk::DetectorType type)
Returns the rotation matrix from the readout element coordinate system into the AMDB coordinate syste...
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
double halfY(const Acts::VolumeBounds &bounds)
Returns the half-Y length for the parsed volume bounds (Trapezoid/ Cuboid)
std::unique_ptr< ActsTrk::DetectorAlignStore > copyDeltas(const ActsTrk::DetectorAlignStore &inStore)
Copy the alignment deltas from the inStore to a new alignment store.
double halfZ(const Acts::VolumeBounds &bounds)
Returns the half-Z length for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXhighY(const Acts::VolumeBounds &bounds)
Returns the half-Y length @ posiive Y for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXlowY(const Acts::VolumeBounds &bounds)
Returns the half-X length @ negative Y for the parsed volume bounds (Trapezoid/ Cuboid)
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10