ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuonCalib::NtupleStationId Class Reference

#include <NtupleStationId.h>

Collaboration diagram for MuonCalib::NtupleStationId:

Public Member Functions

 NtupleStationId ()
 Default constructor. More...
 
 NtupleStationId (const MuonFixedId &id)
 Initializing Constructor. More...
 
 NtupleStationId (const std::string &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
 Initializing Constructor. More...
 
void Initialize (const MuonFixedId &id)
 initialize function More...
 
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 More...
 
void SetStation (const std::string &station)
 set station, eta or phi seperately More...
 
void SetPhi (const int &phi)
 set phi More...
 
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 More...
 
bool operator> (const NtupleStationId &other) const
 
bool operator== (const MuonFixedId &id) const
 return true if icdentifier matches selection More...
 
bool operator== (const NtupleStationId &id) const
 return true if the regions are the same More...
 
std::string regionId () const
 return the region id string More...
 
bool InitializeGeometry (const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr)
 initialize geometry information More...
 
int GetStation () const
 get station eta and phi More...
 
int GetEta () const
 
int GetPhi () const
 
int GetMl () const
 
const int & GetAuthor () const
 
int NMultilayers () const
 return geometry information More...
 
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 More...
 
int m_eta {}
 
int m_phi {}
 
int m_ml {}
 
int m_author {}
 
int m_region_hash {}
 geo model information More...
 
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

Default constructor.

Definition at line 39 of file NtupleStationId.h.

39  :
40  m_station(-1),
41  m_eta(-99),
42  m_phi(-1),
43  m_ml(0),
44  m_author(0),
45  m_region_hash(0),
46  m_n_ml(-1),
47  m_geom_ok(false) {
48  ResetVectors();
49  }

◆ 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) {
54  ResetVectors();
55  Initialize(id);
56  }

◆ 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  }

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;
82  m_author = author;
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;
27  m_author = author;
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();
56  m_n_layer[i] = m_layer_max[i] - m_layer_min[i] + 1;
57  m_tube_min[i] = 1;
58  m_tube_max[i] = detEl_ml->getNtubesperlayer();
59  m_n_tubes[i] = m_tube_max[i] - m_tube_min[i] + 1;
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  }

◆ 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.

◆ m_eta

int MuonCalib::NtupleStationId::m_eta {}
private

Definition at line 209 of file NtupleStationId.h.

◆ m_geom_ok

bool MuonCalib::NtupleStationId::m_geom_ok {}
private

Definition at line 215 of file NtupleStationId.h.

◆ m_layer_max

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

Definition at line 213 of file NtupleStationId.h.

◆ m_layer_min

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

Definition at line 213 of file NtupleStationId.h.

◆ m_ml

int MuonCalib::NtupleStationId::m_ml {}
private

Definition at line 209 of file NtupleStationId.h.

◆ m_n_layer

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

Definition at line 212 of file NtupleStationId.h.

◆ m_n_ml

int MuonCalib::NtupleStationId::m_n_ml {}
private

Definition at line 212 of file NtupleStationId.h.

◆ m_n_tubes

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

Definition at line 212 of file NtupleStationId.h.

◆ m_phi

int MuonCalib::NtupleStationId::m_phi {}
private

Definition at line 209 of file NtupleStationId.h.

◆ m_region_hash

int MuonCalib::NtupleStationId::m_region_hash {}
private

geo model information

Definition at line 212 of file NtupleStationId.h.

◆ m_station

int MuonCalib::NtupleStationId::m_station {}
private

id

Definition at line 209 of file NtupleStationId.h.

◆ m_tube_max

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

Definition at line 214 of file NtupleStationId.h.

◆ m_tube_min

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

Definition at line 214 of file NtupleStationId.h.


The documentation for this class was generated from the following files:
test_pyathena.eta
eta
Definition: test_pyathena.py:10
MuonGM::MdtReadoutElement::getNLayers
int getNLayers() const
Returns the number of tube layers inside the multilayer.
MuonCalib::NtupleStationId::Initialize
void Initialize(const MuonFixedId &id)
initialize function
Definition: NtupleStationId.h:69
MdtIdHelper::numberOfMultilayers
int numberOfMultilayers(const Identifier &id) const
Definition: MdtIdHelper.cxx:496
MuonCalib::NtupleStationId::regionId
std::string regionId() const
return the region id string
Definition: NtupleStationId.cxx:69
MuonCalib::NtupleStationId::m_layer_min
int m_layer_min[2]
Definition: NtupleStationId.h:213
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonCalib::NtupleStationId::m_layer_max
int m_layer_max[2]
Definition: NtupleStationId.h:213
MuonCalib::NtupleStationId::m_n_ml
int m_n_ml
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::m_tube_min
int m_tube_min[2]
Definition: NtupleStationId.h:214
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
MuonCalib::NtupleStationId::m_author
int m_author
Definition: NtupleStationId.h:210
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
MuonCalib::NtupleStationId::m_eta
int m_eta
Definition: NtupleStationId.h:209
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
MuonCalib::NtupleStationId::m_region_hash
int m_region_hash
geo model information
Definition: NtupleStationId.h:212
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib::NtupleStationId::ResetVectors
void ResetVectors()
Definition: NtupleStationId.h:85
MuonCalib::NtupleStationId::m_n_tubes
int m_n_tubes[2]
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::m_phi
int m_phi
Definition: NtupleStationId.h:209
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:630
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonCalib::NtupleStationId::m_tube_max
int m_tube_max[2]
Definition: NtupleStationId.h:214
MuonCalib::MdtBasicRegionHash
IdentifierHash MdtBasicRegionHash
define type MdtBasicRegionHash for the smallest possible MDT calibration region
Definition: NtupleStationId.h:26
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
MuonIdHelper::get_hash
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)
Definition: MuonIdHelper.cxx:144
MuonCalib::NtupleStationId::m_geom_ok
bool m_geom_ok
Definition: NtupleStationId.h:215
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonIdHelper::module_context
IdContext module_context() const
id for module
Definition: MuonIdHelper.cxx:731
createDCubeDigitHistograms.mdtMultilayer
mdtMultilayer
Definition: createDCubeDigitHistograms.py:112
MuonCalib::NtupleStationId::m_ml
int m_ml
Definition: NtupleStationId.h:209
MuonCalib::NtupleStationId::m_n_layer
int m_n_layer[2]
Definition: NtupleStationId.h:212
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
MuonCalib::NtupleStationId::m_station
int m_station
id
Definition: NtupleStationId.h:209
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
Identifier
Definition: IdentifierFieldParser.cxx:14