ATLAS Offline Software
Chamber.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef SIMULATIONBASE
7 
8 #include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
9 #include <format>
10 
11 namespace MuonGMR4{
12  using BoundEnums = Acts::TrapezoidVolumeBounds::BoundValues;
13 
14  std::ostream& operator<<(std::ostream& ostr,
15  const Chamber::defineArgs& args) {
16  ostr<<"halfX (S/L): "<<args.bounds->get(BoundEnums::eHalfLengthXnegY)
17  <<"/"<<args.bounds->get(BoundEnums::eHalfLengthXposY)<<" [mm], ";
18  ostr<<"halfY: "<<args.bounds->get(BoundEnums::eHalfLengthY)<<" [mm], ";
19  ostr<<"halfZ: "<<args.bounds->get(BoundEnums::eHalfLengthZ)<<" [mm], ";
20  ostr<<"loc -> global: "<<Amg::toString(args.locToGlobTrf, 2);
21  return ostr;
22  }
23  std::ostream& operator<<(std::ostream& ostr,
24  const Chamber& chamber) {
25 
26  ostr<<chamber.identString()<<" "<<chamber.parameters();
27  return ostr;
28  }
29 
31  m_args{std::move(args)} {}
32 
33  bool Chamber::operator<(const Chamber& other) const {
34  if (stationName() != other.stationName()) {
35  return stationName() < other.stationName();
36  }
37  if (stationEta() != other.stationEta()) {
38  return stationEta() < other.stationEta();
39  }
40  return stationPhi() < other.stationPhi();
41  }
42  std::string Chamber::identString() const {
43  return std::format("MS chamber {:} eta {:02} phi {:02}",
44  idHelperSvc()->stationNameString(readoutEles().front()->identify()),
45  stationEta(), stationPhi());
46  }
47  bool Chamber::barrel() const {
48  return !idHelperSvc()->isEndcap(readoutEles().front()->identify());
49  }
51  return readoutEles().front()->idHelperSvc();
52  }
54  return readoutEles().front()->chamberIndex();
55  }
56  double Chamber::halfXLong() const { return m_args.bounds->get(BoundEnums::eHalfLengthXposY); }
57  double Chamber::halfXShort() const { return m_args.bounds->get(BoundEnums::eHalfLengthXnegY); }
58  double Chamber::halfY() const { return m_args.bounds->get(BoundEnums::eHalfLengthY); }
59  double Chamber::halfZ() const { return m_args.bounds->get(BoundEnums::eHalfLengthZ); }
60 
61  std::shared_ptr<Acts::Volume> Chamber::boundingVolume(const ActsGeometryContext& gctx) const {
62  return std::make_shared<Acts::Volume>(localToGlobalTrans(gctx), bounds());
63  }
64  std::shared_ptr<Acts::TrapezoidVolumeBounds> Chamber::bounds() const {
65  return m_args.bounds;
66  }
67  int Chamber::stationPhi() const{ return readoutEles().front()->stationPhi(); }
68  int Chamber::stationEta() const{ return readoutEles().front()->stationEta(); }
69  int Chamber::stationName() const{ return readoutEles().front()->stationName(); }
70  int Chamber::sector() const{ return idHelperSvc()->sector(readoutEles().front()->identify()); }
71  const Chamber::defineArgs& Chamber::parameters() const { return m_args; }
73  return m_args.detEles;
74  }
76  return m_args.locToGlobTrf;
77  }
79  return localToGlobalTrans(gctx).inverse();
80  }
81  const SpectrometerSector* Chamber::parent() const { return m_parent; }
83 }
84 #endif
MuonGMR4::Chamber::identString
std::string identString() const
Define a string of the chamber used for debugging.
Definition: Chamber.cxx:42
MuonGMR4::Chamber::Chamber
Chamber(defineArgs &&args)
Standard constructor taking the defineArgs.
Definition: Chamber.cxx:30
MuonGMR4::Chamber::parent
const SpectrometerSector * parent() const
Returns the pointer to the MS sector enclosing the chamber.
Definition: Chamber.cxx:81
MuonGMR4::Chamber::defineArgs::detEles
ReadoutSet detEles
List of associated readout elements.
Definition: Chamber.h:30
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:39
vtune_athena.format
format
Definition: vtune_athena.py:14
calibdata.chamber
chamber
Definition: calibdata.py:32
MuonGMR4::Chamber::halfY
double halfY() const
Extend of the chamber in the y-direction.
Definition: Chamber.cxx:58
MuonGMR4::Chamber::boundingVolume
std::shared_ptr< Acts::Volume > boundingVolume(const ActsGeometryContext &gctx) const
Returns the Acts::Volume representation of the chamber.
Definition: Chamber.cxx:61
xAOD::identify
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
MuonGMR4::Chamber::sector
int sector() const
Returns the MS sector of the chamber.
Definition: Chamber.cxx:70
MuonGMR4::Chamber::halfXShort
double halfXShort() const
Short extend of the chamber in the x-direction at negative Y.
Definition: Chamber.cxx:57
MuonGMR4::Chamber::m_parent
const SpectrometerSector * m_parent
Definition: Chamber.h:87
SpectrometerSector.h
MuonGMR4::BoundEnums
Acts::TrapezoidVolumeBounds::BoundValues BoundEnums
Definition: Chamber.cxx:12
MuonGMR4::Chamber::defineArgs
Definition: Chamber.h:26
MuonGMR4::Chamber::stationEta
int stationEta() const
Returns the station eta of the chamber.
Definition: Chamber.cxx:68
MuonGMR4::Chamber
Definition: Chamber.h:22
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
MuonGMR4::Chamber::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Definition: Chamber.cxx:53
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::Chamber::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &gctx) const
Returns the transformation chamber frame -> global transformation.
Definition: Chamber.cxx:75
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::Chamber::stationPhi
int stationPhi() const
Returns the station phi of the chamber.
Definition: Chamber.cxx:67
MuonGMR4::Chamber::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the idHelperSvc.
Definition: Chamber.cxx:50
MuonGMR4::Chamber::readoutEles
const ReadoutSet & readoutEles() const
Returns the list of contained readout elements.
Definition: Chamber.cxx:72
MuonGMR4::Chamber::operator<
bool operator<(const Chamber &other) const
Comparison operator for set ordering.
Definition: Chamber.cxx:33
Muon::IMuonIdHelperSvc::isEndcap
virtual bool isEndcap(const Identifier &id) const =0
returns whether this is an endcap Identifier or not
MuonGMR4::Chamber::m_args
defineArgs m_args
Definition: Chamber.h:86
Chamber.h
MuonGMR4::Chamber::barrel
bool barrel() const
Returns whether the chamber is placed in the barrel.
Definition: Chamber.cxx:47
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonGMR4::Chamber::halfXLong
double halfXLong() const
Long-extend of the chamber in the x-direction at positive Y.
Definition: Chamber.cxx:56
MuonGMR4::Chamber::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds() const
Returns the volume bounds.
Definition: Chamber.cxx:64
MuonGMR4::Chamber::parameters
const defineArgs & parameters() const
Returns the reference to the defining parameters of the chamber.
Definition: Chamber.cxx:71
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonGMR4::Chamber::defineArgs::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds
Chamber volume bounds.
Definition: Chamber.h:32
MuonGMR4::Chamber::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation.
Definition: Chamber.cxx:78
Muon::IMuonIdHelperSvc::sector
virtual int sector(const Identifier &id) const =0
return sector number 1-16, odd=large, even=small
MuonGMR4::Chamber::stationName
int stationName() const
Returns an integer representing the stationName.
Definition: Chamber.cxx:69
MuonGMR4::Chamber::setParent
void setParent(const SpectrometerSector *parent)
Sets the connection to the MS sector enclosing the chamber.
Definition: Chamber.cxx:82
MuonGMR4::Chamber::halfZ
double halfZ() const
Thickness of the chamber in the z-direction.
Definition: Chamber.cxx:59
MuonGMR4::operator<<
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
Definition: Chamber.cxx:14
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
MuonGMR4::Chamber::defineArgs::locToGlobTrf
Amg::Transform3D locToGlobTrf
Transformation of the chamber.
Definition: Chamber.h:28