ATLAS Offline Software
SpectrometerSector.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
6 #include <Acts/Geometry/TrapezoidVolumeBounds.hpp>
7 #include <Acts/Geometry/Volume.hpp>
9 
10 #include <format>
11 
12 namespace MuonGMR4 {
13 
15 using BoundEnums = Acts::TrapezoidVolumeBounds::BoundValues;
16 
18  m_args{std::move(args)} {
19  for (auto & chamber : m_args.chambers) {
20  chamber->setParent(this);
21  }
22  }
23 
25  if (side() != other.side()) {
26  return side() < other.side();
27  }
28  if (sector() != other.sector()) {
29  return sector() < other.sector();
30  }
31  if (other.chamberIndex() != chamberIndex()) {
32  return chamberIndex() < other.chamberIndex();
33  }
34  return (*m_args.chambers.front()) < (*other.m_args.chambers.front());
35 }
36 int8_t SpectrometerSector::side() const {
37  return m_args.chambers.front()->stationEta() > 0 ? 1 : -1;
38 }
40 const Muon::IMuonIdHelperSvc* SpectrometerSector::idHelperSvc() const { return m_args.chambers.front()->idHelperSvc();}
42 int SpectrometerSector::stationPhi() const { return m_args.chambers.front()->stationPhi(); }
43 int SpectrometerSector::sector() const {return m_args.chambers.front()->sector(); }
44 bool SpectrometerSector::barrel() const { return m_args.chambers.front()->barrel(); }
45 std::string SpectrometerSector::identString() const {
46  return std::format("{:} {:}-side sector: {:2}",
48  side() == 1 ? 'A' : 'C' , sector());
49 }
52  return m_args.locToGlobTrf;
53 }
55  return localToGlobalTrans(gctx).inverse();
56 }
57 double SpectrometerSector::halfXLong() const { return m_args.bounds->get(BoundEnums::eHalfLengthXposY); }
58 double SpectrometerSector::halfXShort() const { return m_args.bounds->get(BoundEnums::eHalfLengthXnegY); }
59 double SpectrometerSector::halfY() const { return m_args.bounds->get(BoundEnums::eHalfLengthY); }
60 double SpectrometerSector::halfZ() const { return m_args.bounds->get(BoundEnums::eHalfLengthZ); }
61 
62 
63 std::shared_ptr<Acts::Volume> SpectrometerSector::boundingVolume(const ActsGeometryContext& gctx) const {
64  return std::make_shared<Acts::Volume>(localToGlobalTrans(gctx), bounds());
65 }
66 std::shared_ptr<Acts::TrapezoidVolumeBounds> SpectrometerSector::bounds() const {
67  return std::make_shared<Acts::TrapezoidVolumeBounds>(halfXShort(), halfXLong(), halfY(), halfZ());
68 }
70  Chamber::ReadoutSet toReturn{};
71  for (const ChamberPtr& ch : chambers()) {
72  toReturn.insert(toReturn.end(), ch->readoutEles().begin(), ch->readoutEles().end());
73  }
74  return toReturn;
75 }
76 const std::vector<SpectrometerSector::chamberLocation> & SpectrometerSector::chamberLocations() const{
77  return m_args.chamberLocs;
78 
79 }
80 std::ostream& operator<<(std::ostream& ostr,
82  ostr<<std::endl
83  <<"halfX (S/L): "<<args.bounds->get(BoundEnums::eHalfLengthXnegY)
84  <<"/"<<args.bounds->get(BoundEnums::eHalfLengthXposY)<<" [mm], ";
85  ostr<<"halfY: "<<args.bounds->get(BoundEnums::eHalfLengthY)<<" [mm], ";
86  ostr<<"halfZ: "<<args.bounds->get(BoundEnums::eHalfLengthZ)<<" [mm], ";
87  ostr<<"loc -> global: "<<Amg::toString(args.locToGlobTrf, 2)<<std::endl;
88  ostr<<"************************************************************************"<<std::endl;
89  for (const SpectrometerSector::ChamberPtr& ch : args.chambers) {
90  ostr<<" --- "<<(*ch)<<std::endl;
91  }
92  return ostr;
93 }
94 std::ostream& operator<<(std::ostream& ostr, const SpectrometerSector& chamber) {
95  ostr<<"MS sector "<<chamber.identString()<<" "<<chamber.parameters();
96  return ostr;
97 }
98 
99 }
100 #endif
Muon::MuonStationIndex::chName
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:157
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
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
MuonGMR4::SpectrometerSector::sector
int sector() const
Returns the sector of the MS-sector.
Definition: SpectrometerSector.cxx:43
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
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:40
vtune_athena.format
format
Definition: vtune_athena.py:14
MuonGMR4::SpectrometerSector::stationPhi
int stationPhi() const
: Returns the station phi of the sector
Definition: SpectrometerSector.cxx:42
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:118
MuonGMR4::SpectrometerSector::readoutEles
Chamber::ReadoutSet readoutEles() const
Returns the list of all associated readout elements.
Definition: SpectrometerSector.cxx:69
MuonGMR4::SpectrometerSector::defineArgs
Definition: SpectrometerSector.h:56
MuonGMR4::SpectrometerSector::halfXShort
double halfXShort() const
Short extend of the chamber in the x-direction at negative Y.
Definition: SpectrometerSector.cxx:58
MuonGMR4::SpectrometerSector::halfZ
double halfZ() const
Thickness of the chamber in the z-direction.
Definition: SpectrometerSector.cxx:60
SpectrometerSector.h
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::BoundEnums
Acts::TrapezoidVolumeBounds::BoundValues BoundEnums
Definition: Chamber.cxx:12
MuonGMR4::ChamberSet
SpectrometerSector::ChamberSet ChamberSet
Definition: SpectrometerSector.cxx:14
MuonGMR4::SpectrometerSector::halfY
double halfY() const
Extend of the chamber in the y-direction.
Definition: SpectrometerSector.cxx: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
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::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
NoDeletePtr.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::defineArgs::chamberLocs
std::vector< chamberLocation > chamberLocs
Definition: SpectrometerSector.h:64
MuonGMR4::SpectrometerSector::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the IdHelpeSvc.
Definition: SpectrometerSector.cxx:40
MuonGMR4::SpectrometerSector::defineArgs::locToGlobTrf
Amg::Transform3D locToGlobTrf
Transformation to the chamber volume.
Definition: SpectrometerSector.h:62
MuonGMR4::SpectrometerSector::defineArgs::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds
Surrouding box chamber bounds.
Definition: SpectrometerSector.h:60
MuonGMR4::SpectrometerSector::defineArgs::chambers
ChamberSet chambers
List of readout elements in the chamber.
Definition: SpectrometerSector.h:58
MuonGMR4::SpectrometerSector::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds() const
Returns the volume bounds.
Definition: SpectrometerSector.cxx:66
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:43
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
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
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::SpectrometerSector::operator<
bool operator<(const SpectrometerSector &other) const
Definition: SpectrometerSector.cxx:24