ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDetectorDefs.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef SIMULATIONBASE
6# include <Acts/Geometry/VolumeBounds.hpp>
7# include <Acts/Geometry/CuboidVolumeBounds.hpp>
8# include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
9
10
11namespace MuonGMR4 {
12 double halfXlowY(const Acts::VolumeBounds& visitBounds) {
13 switch (visitBounds.type()) {
14 case Acts::VolumeBounds::BoundsType::eCuboid: {
15 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
16 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
17 return bounds.get(BoundEnum::eHalfLengthX);
18 }
19 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
20 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
21 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
22 return bounds.get(BoundEnum::eHalfLengthXnegY);
23 } default:
24 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
25 }
26 return 0.;
27 }
28 double halfXhighY(const Acts::VolumeBounds& visitBounds) {
29 switch (visitBounds.type()) {
30 case Acts::VolumeBounds::BoundsType::eCuboid: {
31 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
32 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
33 return bounds.get(BoundEnum::eHalfLengthX);
34 }
35 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
36 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
37 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
38 return bounds.get(BoundEnum::eHalfLengthXposY);
39 } default:
40 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
41 }
42 return 0.;
43 }
44 double halfY(const Acts::VolumeBounds& visitBounds) {
45 switch (visitBounds.type()) {
46 case Acts::VolumeBounds::BoundsType::eCuboid: {
47 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
48 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
49 return bounds.get(BoundEnum::eHalfLengthY);
50 }
51 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
52 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
53 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
54 return bounds.get(BoundEnum::eHalfLengthY);
55 } default:
56 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
57 }
58 return 0.;
59
60 }
61 double halfZ(const Acts::VolumeBounds& visitBounds) {
62 switch (visitBounds.type()) {
63 case Acts::VolumeBounds::BoundsType::eCuboid: {
64 const auto& bounds = static_cast<const Acts::CuboidVolumeBounds&>(visitBounds);
65 using BoundEnum = Acts::CuboidVolumeBounds::BoundValues;
66 return bounds.get(BoundEnum::eHalfLengthZ);
67 }
68 case Acts::VolumeBounds::BoundsType::eTrapezoid: {
69 const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(visitBounds);
70 using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
71 return bounds.get(BoundEnum::eHalfLengthZ);
72 } default:
73 THROW_EXCEPTION("Unsupported bound type "<<visitBounds.type());
74 }
75 return 0.;
76 }
77}
78#endif
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)
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