ATLAS Offline Software
SpectrometerSector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
5 #define MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
6 
7 #ifndef SIMULATIONBASE
8 
12 #include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
13 
14 
15 #include <set>
16 
17 namespace Acts {
18  class Volume;
19 }
20 namespace MuonGMR4{
21  class SpectrometerSector;
22  class Chamber;
23 }
24 
25 namespace MuonGMR4 {
42  public:
44  using ChamberSet = std::vector<ChamberPtr>;
45 
50  public:
51  using enum Acts::TrapezoidVolumeBounds::BoundValues;
52  using BoundPtr_t = std::shared_ptr<const Acts::TrapezoidVolumeBounds>;
60  const MuonReadoutElement* reEle,
62  m_origin{origin}, m_reEle{reEle}, m_bounds{std::move(bounds)}{}
74  bool insideYZ(const Amg::Vector3D& pos) const {
75  return minY() <= pos.y() && maxY() >= pos.y() &&
76  minZ() <= pos.z() && maxZ() >= pos.z();
77  }
79  double minY() const { return m_origin.y() - m_bounds->get(eHalfLengthY); }
81  double maxY() const { return m_origin.y() + m_bounds->get(eHalfLengthY); }
83  double minZ() const { return m_origin.z() - m_bounds->get(eHalfLengthZ); }
85  double maxZ() const { return m_origin.z() + m_bounds->get(eHalfLengthZ); }
87  double width(const double y0) const {
88  const double tanPhiHalf = 0.5*(m_bounds->get(eHalfLengthXposY) - m_bounds->get(eHalfLengthXnegY))
89  / m_bounds->get(eHalfLengthY);
90  return m_bounds->get(eHalfLengthXnegY) + tanPhiHalf * (y0 - minY());
91  }
93  const MuonReadoutElement* readoutEle() const { return m_reEle; }
95  const BoundPtr_t& bounds() const { return m_bounds; }
97  const Amg::Vector3D& location() const { return m_origin; }
98  private:
102  const MuonReadoutElement* m_reEle{nullptr};
105  };
106 
107  struct defineArgs{
111  std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds{};
113  Amg::Transform3D locToGlobTrf{Amg::Transform3D::Identity()};
114 
115  std::vector<chamberLocation> detectorLocs{};
116  };
117 
123 
124  bool operator<(const SpectrometerSector& other) const;
125 
127  std::string identString() const;
129  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
133  int stationPhi() const;
135  int sector() const;
137  int8_t side() const;
139  bool barrel() const;
142  const Amg::Transform3D& localToGlobalTrans(const ActsGeometryContext& gctx) const;
146  const ChamberSet& chambers() const;
148  double halfXLong() const;
150  double halfXShort() const;
152  double halfY() const;
154  double halfZ() const;
156  const defineArgs& parameters() const;
159  std::shared_ptr<Acts::Volume> boundingVolume(const ActsGeometryContext& gctx) const;
161  std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds() const;
165  const std::vector<chamberLocation> & chamberLocations() const;
166 
167 
168  private:
170  };
171 
172  std::ostream& operator<<(std::ostream& ostr,
174 
175  std::ostream& operator<<(std::ostream& ostr,
176  const SpectrometerSector& chamber);
177 
178 }
179 
180 
181 #endif
182 #endif
MuonGMR4::SpectrometerSector::chamberLocation::bounds
const BoundPtr_t & bounds() const
Returns the pointer to the associate bounds.
Definition: SpectrometerSector.h:95
GeoModel::TransientConstSharedPtr
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
Definition: TransientConstSharedPtr.h:13
MuonGMR4::SpectrometerSector::boundingVolume
std::shared_ptr< Acts::Volume > boundingVolume(const ActsGeometryContext &gctx) const
Returns the Acts::Volume representation of the sector.
Definition: SpectrometerSector.cxx:63
MuonGMR4::SpectrometerSector::sector
int sector() const
Returns the sector of the MS-sector.
Definition: SpectrometerSector.cxx:43
MuonGMR4::SpectrometerSector::chamberLocation::BoundPtr_t
std::shared_ptr< const Acts::TrapezoidVolumeBounds > BoundPtr_t
Definition: SpectrometerSector.h:52
MuonGMR4::RpcReadoutElement::defineArgs
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:46
MuonGMR4::SpectrometerSector::side
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
Definition: SpectrometerSector.cxx:36
MuonGMR4::SpectrometerSector::chamberLocation::readoutEle
const MuonReadoutElement * readoutEle() const
Returns the poter to the associate readout element
Definition: SpectrometerSector.h:93
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:41
MuonGMR4::SpectrometerSector::stationPhi
int stationPhi() const
: Returns the station phi of the sector
Definition: SpectrometerSector.cxx:42
MuonGMR4::SpectrometerSector::chamberLocation::m_origin
Amg::Vector3D m_origin
Origin vector of the readout element inside the spectrometer frame.
Definition: SpectrometerSector.h:100
python.CaloAddPedShiftConfig.args
args
Definition: CaloAddPedShiftConfig.py:47
MuonGMR4::SpectrometerSector::chamberLocation::m_reEle
const MuonReadoutElement * m_reEle
Associated readout element.
Definition: SpectrometerSector.h:102
calibdata.chamber
chamber
Definition: calibdata.py:32
MuonGMR4::SpectrometerSector::chambers
const ChamberSet & chambers() const
Returns the associated chambers with this sector.
Definition: SpectrometerSector.cxx:50
MuonGMR4::SpectrometerSector::m_args
defineArgs m_args
Definition: SpectrometerSector.h:169
MuonGMR4::SpectrometerSector::readoutEles
Chamber::ReadoutSet readoutEles() const
Returns the list of all associated readout elements.
Definition: SpectrometerSector.cxx:69
MuonGMR4::SpectrometerSector::chamberLocation::location
const Amg::Vector3D & location() const
Returns the location.
Definition: SpectrometerSector.h:97
MuonGMR4::SpectrometerSector::defineArgs
Definition: SpectrometerSector.h:107
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonGMR4::SpectrometerSector::halfXShort
double halfXShort() const
Short extend of the chamber in the x-direction at negative Y.
Definition: SpectrometerSector.cxx:58
MuonGMR4::SpectrometerSector::chamberLocation::chamberLocation
chamberLocation(chamberLocation &&other)=default
Move constructor.
MuonGMR4::SpectrometerSector::SpectrometerSector
SpectrometerSector(const SpectrometerSector &other)=delete
Delete the copy constructor and copy assignment.
MuonGMR4::SpectrometerSector::chamberLocation::minY
double minY() const
Returns the minimum y covered by the chamber location.
Definition: SpectrometerSector.h:79
MuonGMR4::SpectrometerSector::halfZ
double halfZ() const
Thickness of the chamber in the z-direction.
Definition: SpectrometerSector.cxx:60
MuonGMR4::SpectrometerSector::identString
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
Definition: SpectrometerSector.cxx:45
MuonGMR4::SpectrometerSector::halfY
double halfY() const
Extend of the chamber in the y-direction.
Definition: SpectrometerSector.cxx:59
MuonGMR4::SpectrometerSector::chamberLocation::chamberLocation
chamberLocation(const Amg::Vector3D &origin, const MuonReadoutElement *reEle, BoundPtr_t bounds)
Standard constructor taking the position of the readout element inside the sector frame,...
Definition: SpectrometerSector.h:59
MuonGMR4::SpectrometerSector::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
Definition: SpectrometerSector.cxx:41
MuonGMR4::SpectrometerSector::halfXLong
double halfXLong() const
Long-extend of the chamber in the x-direction at positive Y.
Definition: SpectrometerSector.cxx:57
MuonGMR4::SpectrometerSector::chamberLocation::chamberLocation
chamberLocation(const chamberLocation &other)=default
Copy constructor.
MuonGMR4::SpectrometerSector::chamberLocation::maxY
double maxY() const
Returns the maximum u covered by the chamber location.
Definition: SpectrometerSector.h:81
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:19
Acts
Definition: ChamberAssembleTool.h:18
MuonGMR4::SpectrometerSector::chamberLocations
const std::vector< chamberLocation > & chamberLocations() const
returns the list of all MDT chambers in the sector for fast navigation
Definition: SpectrometerSector.cxx:76
MuonGMR4::SpectrometerSector::barrel
bool barrel() const
Returns whether the sector is placed in the barrel.
Definition: SpectrometerSector.cxx:44
MuonGMR4::SpectrometerSector::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
Definition: SpectrometerSector.cxx:54
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGMR4::Chamber::ReadoutSet
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Definition: Chamber.h:25
MuonGMR4::SpectrometerSector::chamberLocation::operator=
chamberLocation & operator=(chamberLocation &&other)=default
Move assignment.
GeometryDefs.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::SpectrometerSector::SpectrometerSector
SpectrometerSector(defineArgs &&args)
Standard constructor taking the defining parameters.
Definition: SpectrometerSector.cxx:17
MuonGMR4::SpectrometerSector::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the IdHelpeSvc.
Definition: SpectrometerSector.cxx:40
MuonGMR4::SpectrometerSector::chamberLocation::width
double width(const double y0) const
Calculate the strip / tube length at a given position in the y-z plane.
Definition: SpectrometerSector.h:87
MuonGMR4::SpectrometerSector::defineArgs::locToGlobTrf
Amg::Transform3D locToGlobTrf
Transformation to the chamber volume.
Definition: SpectrometerSector.h:113
MuonGMR4::SpectrometerSector::defineArgs::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds
Surrouding box chamber bounds.
Definition: SpectrometerSector.h:111
MuonGMR4::SpectrometerSector::chamberLocation::operator=
chamberLocation & operator=(const chamberLocation &other)=default
Copy assignment.
MuonGMR4::SpectrometerSector::defineArgs::chambers
ChamberSet chambers
List of readout elements in the chamber.
Definition: SpectrometerSector.h:109
MuonGMR4::SpectrometerSector::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds() const
Returns the volume bounds.
Definition: SpectrometerSector.cxx:66
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Chamber.h
MuonGMR4::SpectrometerSector::parameters
const defineArgs & parameters() const
Returns the reference to the defining parameters of the sector.
Definition: SpectrometerSector.cxx:39
MuonGMR4::SpectrometerSector::ChamberSet
std::vector< ChamberPtr > ChamberSet
Definition: SpectrometerSector.h:44
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonGMR4::SpectrometerSector::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Definition: SpectrometerSector.cxx:51
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
MuonGMR4::SpectrometerSector::chamberLocation::insideYZ
bool insideYZ(const Amg::Vector3D &pos) const
Returns whether the external position is inside the boundaries in the y-z plane.
Definition: SpectrometerSector.h:74
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonGMR4::SpectrometerSector::defineArgs::detectorLocs
std::vector< chamberLocation > detectorLocs
Definition: SpectrometerSector.h:115
MuonGMR4::SpectrometerSector::chamberLocation::maxZ
double maxZ() const
Returns the maximum u covered by the chamber location.
Definition: SpectrometerSector.h:85
MuonGMR4::SpectrometerSector::chamberLocation
: Helper struct for fast approximate navigation.
Definition: SpectrometerSector.h:49
MuonReadoutElement.h
MuonGMR4::operator<<
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
Definition: Chamber.cxx:14
MuonGMR4::SpectrometerSector::chamberLocation::m_bounds
BoundPtr_t m_bounds
Pointer to the associated bounds.
Definition: SpectrometerSector.h:104
MuonGMR4::SpectrometerSector::operator=
SpectrometerSector & operator=(const SpectrometerSector &other)=delete
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
MuonGMR4::defineArgs
RpcReadoutElement::defineArgs defineArgs
Definition: RpcReadoutGeomTool.cxx:33
MuonGMR4::SpectrometerSector::operator<
bool operator<(const SpectrometerSector &other) const
Definition: SpectrometerSector.cxx:24
MuonGMR4::SpectrometerSector::chamberLocation::minZ
double minZ() const
Returns the minimum y covered by the chamber location.
Definition: SpectrometerSector.h:83