ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegment_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// EDM include(s):
8
9// Local include(s):
11
12namespace {
13 using namespace Muon::MuonStationIndex;
14}
15
16namespace xAOD {
17
18
20 return Amg::Vector3D{x(), y(), z()};
21 }
23 return Amg::Vector3D{px(), py(), pz()};
24 }
25
29
30 void MuonSegment_v1::setPosition(float x, float y, float z) {
31 static const Accessor<float> accX( "x" );
32 static const Accessor<float> accY( "y" );
33 static const Accessor<float> accZ( "z" );
34
35 accX( *this ) = x;
36 accY( *this ) = y;
37 accZ( *this ) = z;
38 }
39
43
44 void MuonSegment_v1::setDirection(float px, float py, float pz) {
45 static const Accessor<float> accX( "px" );
46 static const Accessor<float> accY( "py" );
47 static const Accessor<float> accZ( "pz" );
48 accX(*this) = px;
49 accY(*this) = py;
50 accZ(*this) = pz;
51 }
52
55
56 void MuonSegment_v1::setT0Error(float t0, float t0error) {
57 static const Accessor<float> acc1("t0");
58 static const Accessor<float> acc2("t0error");
59 acc1( *this ) = t0;
60 acc2( *this ) = t0error;
61 }
62
63 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, chiSquared )
64 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, numberDoF )
65
67 static const Accessor<float> acc1( "chiSquared" );
68 static const Accessor<float> acc2( "numberDoF" );
69 acc1( *this ) = chiSquared;
70 acc2( *this ) = numberDoF;
71 }
72
77
80 const std::int8_t etaIndex,
82 static const Accessor<int> acc1( "sector" );
83 static const Accessor<int> acc2( "chamberIndex" );
84 static const Accessor<int> acc3( "etaIndex" );
85 static const Accessor<int> acc4( "technology" );
86 acc1(*this) = sector;
87 acc2(*this) = toInt(chamberIndex);
88 acc3(*this) = etaIndex;
89 acc4(*this) = toInt(technology);
90 }
91
92 AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( MuonSegment_v1, int, std::uint8_t, nPrecisionHits )
93 AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( MuonSegment_v1, int, std::uint8_t, nPhiLayers )
94 AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( MuonSegment_v1, int, std::uint8_t, nTrigEtaLayers )
95
99 static const Accessor<int> acc1{"nPrecisionHits"};
100 static const Accessor<int> acc2{"nPhiLayers"};
101 static const Accessor<int> acc3{"nTrigEtaLayers"};
102
103 acc1(*this) = nPrecisionHits;
104 acc2(*this) = nPhiLayers;
105 acc3(*this) = nTrigEtaLayers;
106 }
107
108
109 void MuonSegment_v1::setNOutliers(const std::uint8_t nPrecOutliers,
110 const std::uint8_t nTrigPhiOutliers,
111 const std::uint8_t nTrigEtaOutliers) {
112
113 static const Accessor<std::uint8_t> acc_prec{"nPrecisionOutliers"};
114 static const Accessor<std::uint8_t> acc_trigEta{"nTriggerPhiOutliers"};
115 static const Accessor<std::uint8_t> acc_trigPhi{"nTriggerEtaOutliers"};
116
117 acc_prec(*this) = nPrecOutliers;
118 acc_trigEta(*this) = nTrigEtaOutliers;
119 acc_trigPhi(*this) = nTrigPhiOutliers;
120 }
121
122 void MuonSegment_v1::setNHoles(const std::uint8_t nPrecHoles,
123 const std::uint8_t nTrigPhiHoles,
124 const std::uint8_t nTrigEtaHoles) {
125 static const Accessor<std::uint8_t> acc_prec{"nPrecisionHoles"};
126 static const Accessor<std::uint8_t> acc_trigEta{"nTriggerPhiHoles"};
127 static const Accessor<std::uint8_t> acc_trigPhi{"nTriggerEtaHoles"};
128
129 acc_prec(*this) = nPrecHoles;
130 acc_trigEta(*this) = nTrigEtaHoles;
131 acc_trigPhi(*this) = nTrigPhiHoles;
132 }
133 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nPrecisionOutliers)
134 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nTriggerPhiOutliers)
135 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nTriggerEtaOutliers)
136
137 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nPrecisionHoles)
138 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nTriggerPhiHoles)
139 AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, std::uint8_t, nTriggerEtaHoles)
140
141
142
143 #if !(defined(GENERATIONBASE) || defined(XAOD_ANALYSIS))
145 #endif // not XAOD_ANALYSIS or GENERATIONBASE
146
147} // namespace xAOD
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
static Double_t t0
#define y
#define x
#define z
Class to describe a Segment reconstructed in the MuonSpectrometer.
void setDirection(float px, float py, float pz)
Sets the direction.
float px() const
float y() const
Returns the x position.
std::uint8_t nTrigEtaLayers() const
Returns the number of trigger eta hits.
float pz() const
Returns the pz.
float t0() const
float numberDoF() const
Returns the numberDoF.
MuonSegment_v1()=default
Default constructor.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
void setT0Error(float t0, float t0Error)
Sets the time error.
void setNHits(const std::uint8_t nPrecisionHits, const std::uint8_t nPhiLayers, const std::uint8_t nTrigEtaLayers)
Assign the segment hit summary.
void setNOutliers(const std::uint8_t nPrecOutliers, const std::uint8_t nTrigPhiOutliers, const std::uint8_t nTrigEtaOutliers)
Assign the number of hits with a large pull per hit category.
void setNHoles(const std::uint8_t nPrecHoles, const std::uint8_t nTrigPhiHoles, const std::uint8_t nTrigEtaHoles)
Assign the number of expected but missing hits.
float chiSquared() const
std::uint8_t nPrecisionHits() const
Returns the number of precision hits.
float py() const
Returns the py.
void setPosition(float x, float y, float z)
Sets the global position.
::Muon::MuonStationIndex::TechnologyIndex technology() const
Returns the main technology of the segment.
void setIdentifier(const std::uint8_t sector, const ::Muon::MuonStationIndex::ChIndex chamberIndex, const std::int8_t etaIndex, const ::Muon::MuonStationIndex::TechnologyIndex technology)
Set the Identifier fields of the Segment.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
int etaIndex() const
Returns the eta index, which corresponds to stationEta in the offline identifiers (and the ).
float t0error() const
Returns the time error.
std::uint8_t nPhiLayers() const
Returns the number of trigger phi hits.
float z() const
Returns the y position.
Eigen::Matrix< double, 3, 1 > Vector3D
TechnologyIndex
enum to classify the different layers in the muon spectrometer
constexpr int toInt(const EnumType enumVal)
ChIndex
enum to classify the different chamber layers in the muon spectrometer
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.