ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::NtupleStationId Class Reference

Station Identifier for sorting calibration data. More...

#include <NtupleStationId.h>

Collaboration diagram for MuonCalib::NtupleStationId:

Public Member Functions

 NtupleStationId ()
 Default constructor.
 NtupleStationId (const MuonFixedId &id)
 Initializing Constructor.
 NtupleStationId (const std::string &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
 Initializing Constructor.
void Initialize (const MuonFixedId &id)
 initialize function
void Initialize (const int &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
void ResetVectors ()
bool Initialize (const std::string &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
 initialize function
void SetStation (const std::string &station)
 set station, eta or phi seperately
void SetPhi (const int &phi)
 set phi
void SetEta (const int &eta)
void SetMultilayer (const int &ml)
void SetAuthor (const int &author)
bool operator< (const NtupleStationId &other) const
 comparision operators for the use as map ids
bool operator> (const NtupleStationId &other) const
bool operator== (const MuonFixedId &id) const
 return true if icdentifier matches selection
bool operator== (const NtupleStationId &id) const
 return true if the regions are the same
std::string regionId () const
 return the region id string
bool InitializeGeometry (const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr)
 initialize geometry information
int GetStation () const
 get station eta and phi
int GetEta () const
int GetPhi () const
int GetMl () const
const int & GetAuthor () const
int NMultilayers () const
 return geometry information
int NLayers (int ml) const
int NTubes (int ml) const
int LayerMin (int ml) const
int LayerMax (int ml) const
int TubeMin (int ml) const
int TubeMax (int ml) const
int RegionHash () const
int FixedId () const

Private Attributes

int m_station {}
 id
int m_eta {}
int m_phi {}
int m_ml {}
int m_author {}
int m_region_hash {}
 geo model information
int m_n_ml {}
int m_n_layer [2] {}
int m_n_tubes [2] {}
int m_layer_min [2] {}
int m_layer_max [2] {}
int m_tube_min [2] {}
int m_tube_max [2] {}
bool m_geom_ok {}

Detailed Description

Station Identifier for sorting calibration data.

Author
rausc.nosp@m.her@.nosp@m.cern..nosp@m.ch

Definition at line 36 of file NtupleStationId.h.

Constructor & Destructor Documentation

◆ NtupleStationId() [1/3]

MuonCalib::NtupleStationId::NtupleStationId ( )
inline

◆ NtupleStationId() [2/3]

MuonCalib::NtupleStationId::NtupleStationId ( const MuonFixedId & id)
inline

Initializing Constructor.

Parameters
idMuonFixedId identifier

Definition at line 53 of file NtupleStationId.h.

53 : m_region_hash(0), m_n_ml(-1) {
55 Initialize(id);
56 }
void Initialize(const MuonFixedId &id)
initialize function

◆ NtupleStationId() [3/3]

MuonCalib::NtupleStationId::NtupleStationId ( const std::string & station,
const int & eta,
const int & phi,
const int & ml = 0,
const int & author = 0 )
inline

Initializing Constructor.

Parameters
stationstation name
etastation eta
phistation phi

Definition at line 62 of file NtupleStationId.h.

62 :
63 m_region_hash(0), m_n_ml(-1) {
64 Initialize(station, eta, phi, ml, author);
65 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method

Member Function Documentation

◆ FixedId()

int MuonCalib::NtupleStationId::FixedId ( ) const

Definition at line 93 of file NtupleStationId.cxx.

93 {
94 if (m_station < 0 || m_eta == -99 || m_phi < 0) return -1;
95 MuonFixedId id;
96 id.set_mdt();
97 if (!id.setStationName(m_station)) return -1;
98 if (!id.setStationEta(m_eta)) return -1;
99 if (!id.setStationPhi(m_phi)) return -1;
100 return id.mdtChamberId().getIdInt();
101 }

◆ GetAuthor()

const int & MuonCalib::NtupleStationId::GetAuthor ( ) const
inline

Definition at line 171 of file NtupleStationId.h.

171{ return m_author; }

◆ GetEta()

int MuonCalib::NtupleStationId::GetEta ( ) const
inline

Definition at line 168 of file NtupleStationId.h.

168{ return m_eta; }

◆ GetMl()

int MuonCalib::NtupleStationId::GetMl ( ) const
inline

Definition at line 170 of file NtupleStationId.h.

170{ return m_ml; }

◆ GetPhi()

int MuonCalib::NtupleStationId::GetPhi ( ) const
inline

Definition at line 169 of file NtupleStationId.h.

169{ return m_phi; }

◆ GetStation()

int MuonCalib::NtupleStationId::GetStation ( ) const
inline

get station eta and phi

Definition at line 167 of file NtupleStationId.h.

167{ return m_station; }

◆ Initialize() [1/3]

void MuonCalib::NtupleStationId::Initialize ( const int & station,
const int & eta,
const int & phi,
const int & ml = 0,
const int & author = 0 )
inline

Definition at line 77 of file NtupleStationId.h.

77 {
78 m_station = station;
79 m_eta = eta;
80 m_phi = phi;
81 m_ml = ml;
83 m_geom_ok = false;
84 }

◆ Initialize() [2/3]

void MuonCalib::NtupleStationId::Initialize ( const MuonFixedId & id)
inline

initialize function

Parameters
idMuonFixedId identifier

Definition at line 69 of file NtupleStationId.h.

69 {
70 m_station = id.stationName();
71 m_eta = id.eta();
72 m_phi = id.phi();
73 m_ml = id.mdtMultilayer();
74 m_author = 0;
75 m_geom_ok = false;
76 }

◆ Initialize() [3/3]

bool MuonCalib::NtupleStationId::Initialize ( const std::string & station,
const int & eta,
const int & phi,
const int & ml = 0,
const int & author = 0 )

initialize function

Parameters
stationstation name
etastation eta
phistation phi

Definition at line 16 of file NtupleStationId.cxx.

16 {
17 MuonFixedId id;
18 if (station == "ANY") {
19 m_station = -1;
20 } else {
21 m_station = id.stationStringToFixedStationNumber(station);
22 if (m_station < 0) return false;
23 }
24 m_eta = eta;
25 m_phi = phi;
26 m_ml = ml;
28 m_geom_ok = false;
29 return true;
30 }

◆ InitializeGeometry()

bool MuonCalib::NtupleStationId::InitializeGeometry ( const MdtIdHelper & mdtIdHelper,
const MuonGM::MuonDetectorManager * detMgr )

initialize geometry information

Definition at line 37 of file NtupleStationId.cxx.

37 {
38 MuonFixedId fid;
39 MsgStream log(Athena::getMessageSvc(), "NtupleStationId");
40 if (m_station == -1 || m_phi < 0 || m_eta == -99) {
41 log << MSG::WARNING << "NtupleStationId::InitializeGeometry: Cannot initialize geometry for multi station id" << endmsg;
42 m_geom_ok = false;
43 return false;
44 }
45 Identifier id(mdtIdHelper.elementID(fid.stationNumberToFixedStationString(m_station), m_eta, m_phi));
46 m_n_ml = mdtIdHelper.numberOfMultilayers(id);
47 // loop on multilayers
48 for (int i = 0; i < m_n_ml; i++) {
49 const MuonGM::MdtReadoutElement* detEl_ml = detMgr->getMdtReadoutElement(mdtIdHelper.channelID(id, 1 + i, 1, 1));
50 m_layer_min[i] = 1;
51 if (!detEl_ml) {
52 log << MSG::WARNING << regionId() << " ml " << i << "does not exist in current geometry" << endmsg;
53 return false;
54 }
55 m_layer_max[i] = detEl_ml->getNLayers();
57 m_tube_min[i] = 1;
58 m_tube_max[i] = detEl_ml->getNtubesperlayer();
60 }
62 IdContext idCont = mdtIdHelper.module_context();
63 mdtIdHelper.get_hash(id, hash, &idCont);
64 m_region_hash = static_cast<int>(hash);
65 m_geom_ok = true;
66 return true;
67 }
#define endmsg
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int numberOfMultilayers(const Identifier &id) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
std::string regionId() const
return the region id string
int getNLayers() const
Returns the number of tube layers inside the multilayer.
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
IdContext module_context() const
id for module
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override
Create hash id from compact id (return == 0 for OK)
IMessageSvc * getMessageSvc(bool quiet=false)
IdentifierHash MdtBasicRegionHash
define type MdtBasicRegionHash for the smallest possible MDT calibration region

◆ LayerMax()

int MuonCalib::NtupleStationId::LayerMax ( int ml) const
inline

Definition at line 189 of file NtupleStationId.h.

189 {
190 if (!m_geom_ok || ml >= m_n_ml) return -1;
191 return m_layer_max[ml];
192 }

◆ LayerMin()

int MuonCalib::NtupleStationId::LayerMin ( int ml) const
inline

Definition at line 185 of file NtupleStationId.h.

185 {
186 if (!m_geom_ok || ml >= m_n_ml) return -1;
187 return m_layer_min[ml];
188 }

◆ NLayers()

int MuonCalib::NtupleStationId::NLayers ( int ml) const
inline

Definition at line 177 of file NtupleStationId.h.

177 {
178 if (!m_geom_ok || ml >= m_n_ml) return -1;
179 return m_n_layer[ml];
180 }

◆ NMultilayers()

int MuonCalib::NtupleStationId::NMultilayers ( ) const
inline

return geometry information

Definition at line 173 of file NtupleStationId.h.

173 {
174 if (!m_geom_ok) return -1;
175 return m_n_ml;
176 }

◆ NTubes()

int MuonCalib::NtupleStationId::NTubes ( int ml) const
inline

Definition at line 181 of file NtupleStationId.h.

181 {
182 if (!m_geom_ok || ml >= m_n_ml) return -1;
183 return m_n_tubes[ml];
184 }

◆ operator<()

bool MuonCalib::NtupleStationId::operator< ( const NtupleStationId & other) const
inline

comparision operators for the use as map ids

Definition at line 115 of file NtupleStationId.h.

115 {
116 if (m_station < other.m_station) return true;
117 if (m_station > other.m_station) return false;
118 if (m_eta < other.m_eta) return true;
119 if (m_eta > other.m_eta) return false;
120 if (m_phi < other.m_phi) return true;
121 if (m_phi > other.m_phi) return false;
122 if (m_ml < other.m_ml) return true;
123 if (m_ml > other.m_ml) return false;
124 if (m_author < other.m_author) return true;
125 return false;
126 }

◆ operator==() [1/2]

bool MuonCalib::NtupleStationId::operator== ( const MuonFixedId & id) const
inline

return true if icdentifier matches selection

Definition at line 140 of file NtupleStationId.h.

140 {
141 if (m_station >= 0)
142 if (id.stationName() != m_station) return false;
143 if (m_eta != -99)
144 if (id.eta() != m_eta) return false;
145 if (m_phi >= 0)
146 if (id.phi() != m_phi) return false;
147 if (m_ml > 0)
148 if (id.mdtMultilayer() != m_ml) return false;
149 return true;
150 }

◆ operator==() [2/2]

bool MuonCalib::NtupleStationId::operator== ( const NtupleStationId & id) const
inline

return true if the regions are the same

Definition at line 152 of file NtupleStationId.h.

152 {
153 if (m_station != id.m_station) return false;
154 if (m_eta != id.m_eta) return false;
155 if (m_phi != id.m_phi) return false;
156 if (m_ml && id.m_ml)
157 if (m_ml != id.m_ml) return false;
158 if (m_author && id.m_author)
159 if (m_author != id.m_author) return false;
160 return true;
161 }

◆ operator>()

bool MuonCalib::NtupleStationId::operator> ( const NtupleStationId & other) const
inline

Definition at line 127 of file NtupleStationId.h.

127 {
128 if (m_station > other.m_station) return true;
129 if (m_station < other.m_station) return false;
130 if (m_eta > other.m_eta) return true;
131 if (m_eta < other.m_eta) return false;
132 if (m_phi > other.m_phi) return true;
133 if (m_phi < other.m_phi) return false;
134 if (m_ml > other.m_ml) return true;
135 if (m_ml < other.m_ml) return false;
136 if (m_author > other.m_author) return true;
137 return false;
138 }

◆ RegionHash()

int MuonCalib::NtupleStationId::RegionHash ( ) const
inline

Definition at line 201 of file NtupleStationId.h.

201 {
202 if (!m_geom_ok) return -1;
203 return m_region_hash;
204 }

◆ regionId()

std::string MuonCalib::NtupleStationId::regionId ( ) const

return the region id string

Definition at line 69 of file NtupleStationId.cxx.

69 {
70 MuonFixedId id;
71 std::ostringstream id_stream;
72 if (m_station < 0) {
73 id_stream << "ANY";
74 } else {
75 id_stream << id.stationNumberToFixedStationString(m_station);
76 }
77 id_stream << "_";
78 if (m_phi >= 0) {
79 id_stream << m_phi;
80 } else {
81 id_stream << "ANY";
82 }
83 id_stream << "_";
84 if (m_eta != -99) {
85 id_stream << m_eta;
86 } else {
87 id_stream << "ANY";
88 }
89 if (m_ml > 0) { id_stream << "_" << m_ml; }
90 return id_stream.str();
91 }

◆ ResetVectors()

void MuonCalib::NtupleStationId::ResetVectors ( )
inline

Definition at line 85 of file NtupleStationId.h.

85 {
86 for (unsigned int ii = 0; ii < 2; ii++) {
87 m_n_layer[ii] = -1;
88 m_n_tubes[ii] = -1;
89 m_layer_min[ii] = -1;
90 m_layer_max[ii] = -1;
91 m_tube_min[ii] = -1;
92 m_tube_max[ii] = -1;
93 }
94 }

◆ SetAuthor()

void MuonCalib::NtupleStationId::SetAuthor ( const int & author)
inline

Definition at line 113 of file NtupleStationId.h.

113{ m_author = author; }

◆ SetEta()

void MuonCalib::NtupleStationId::SetEta ( const int & eta)
inline

Definition at line 107 of file NtupleStationId.h.

107 {
108 m_eta = eta;
109 }

◆ SetMultilayer()

void MuonCalib::NtupleStationId::SetMultilayer ( const int & ml)
inline

Definition at line 110 of file NtupleStationId.h.

110 {
111 m_ml = ml;
112 }

◆ SetPhi()

void MuonCalib::NtupleStationId::SetPhi ( const int & phi)
inline

set phi

Definition at line 104 of file NtupleStationId.h.

104 {
105 m_phi = phi;
106 }

◆ SetStation()

void MuonCalib::NtupleStationId::SetStation ( const std::string & station)

set station, eta or phi seperately

Definition at line 32 of file NtupleStationId.cxx.

32 {
33 MuonFixedId id;
34 m_station = id.stationStringToFixedStationNumber(station);
35 }

◆ TubeMax()

int MuonCalib::NtupleStationId::TubeMax ( int ml) const
inline

Definition at line 197 of file NtupleStationId.h.

197 {
198 if (!m_geom_ok || ml >= m_n_ml) return -1;
199 return m_tube_max[ml];
200 }

◆ TubeMin()

int MuonCalib::NtupleStationId::TubeMin ( int ml) const
inline

Definition at line 193 of file NtupleStationId.h.

193 {
194 if (!m_geom_ok || ml >= m_n_ml) return -1;
195 return m_tube_min[ml];
196 }

Member Data Documentation

◆ m_author

int MuonCalib::NtupleStationId::m_author {}
private

Definition at line 210 of file NtupleStationId.h.

210{};

◆ m_eta

int MuonCalib::NtupleStationId::m_eta {}
private

Definition at line 209 of file NtupleStationId.h.

209{}, m_eta{}, m_phi{}, m_ml{};

◆ m_geom_ok

bool MuonCalib::NtupleStationId::m_geom_ok {}
private

Definition at line 215 of file NtupleStationId.h.

215{};

◆ m_layer_max

int MuonCalib::NtupleStationId::m_layer_max[2] {}
private

Definition at line 213 of file NtupleStationId.h.

213{}, m_layer_max[2]{};

◆ m_layer_min

int MuonCalib::NtupleStationId::m_layer_min[2] {}
private

Definition at line 213 of file NtupleStationId.h.

213{}, m_layer_max[2]{};

◆ m_ml

int MuonCalib::NtupleStationId::m_ml {}
private

Definition at line 209 of file NtupleStationId.h.

209{}, m_eta{}, m_phi{}, m_ml{};

◆ m_n_layer

int MuonCalib::NtupleStationId::m_n_layer[2] {}
private

Definition at line 212 of file NtupleStationId.h.

212{}, m_n_ml{}, m_n_layer[2]{}, m_n_tubes[2]{};

◆ m_n_ml

int MuonCalib::NtupleStationId::m_n_ml {}
private

Definition at line 212 of file NtupleStationId.h.

212{}, m_n_ml{}, m_n_layer[2]{}, m_n_tubes[2]{};

◆ m_n_tubes

int MuonCalib::NtupleStationId::m_n_tubes[2] {}
private

Definition at line 212 of file NtupleStationId.h.

212{}, m_n_ml{}, m_n_layer[2]{}, m_n_tubes[2]{};

◆ m_phi

int MuonCalib::NtupleStationId::m_phi {}
private

Definition at line 209 of file NtupleStationId.h.

209{}, m_eta{}, m_phi{}, m_ml{};

◆ m_region_hash

int MuonCalib::NtupleStationId::m_region_hash {}
private

geo model information

Definition at line 212 of file NtupleStationId.h.

212{}, m_n_ml{}, m_n_layer[2]{}, m_n_tubes[2]{};

◆ m_station

int MuonCalib::NtupleStationId::m_station {}
private

id

Definition at line 209 of file NtupleStationId.h.

209{}, m_eta{}, m_phi{}, m_ml{};

◆ m_tube_max

int MuonCalib::NtupleStationId::m_tube_max[2] {}
private

Definition at line 214 of file NtupleStationId.h.

214{}, m_tube_max[2]{};

◆ m_tube_min

int MuonCalib::NtupleStationId::m_tube_min[2] {}
private

Definition at line 214 of file NtupleStationId.h.

214{}, m_tube_max[2]{};

The documentation for this class was generated from the following files: