ATLAS Offline Software
MuonIdHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 
9 const std::string MuonIdHelper::BAD_NAME = "UNKNOWN";
10 
11 MuonIdHelper::MuonIdHelper(const std::string& logName) :
12  AtlasDetectorID(logName.empty() ? "MuonIdHelper" : logName) {
13 }
14 
16  // Check whether this helper should be reinitialized
17  if (!reinitialize(dict_mgr)) {
18  ATH_MSG_INFO("Request to reinitialize not satisfied - tags have not changed");
19  return 0;
20  } else {
21  ATH_MSG_DEBUG("(Re)initialize");
22  }
23 
24  // init base object
25  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return 1;
26 
27  // Register version of the MuonSpectrometer dictionary
28  if (register_dict_tag(dict_mgr, "MuonSpectrometer")) return 1;
29 
30  m_dict = dict_mgr.find_dictionary("MuonSpectrometer");
31  if (!m_dict) {
32  ATH_MSG_ERROR(" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
33  return 1;
34  }
35 
36  // Initialize some of the field indices
37  if (initLevelsFromDict()) return 1;
38 
39  //
40  // Build multirange for the valid set of identifiers
41  //
42 
43  // Find value for the field MuonSpectrometer
44  int muonField = -1;
45  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
46  if (atlasDict->get_label_value("subdet", "MuonSpectrometer", muonField)) {
47  ATH_MSG_ERROR("Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary ");
48  return 1;
49  }
50 
51  // Build MultiRange down to "technology" for all (muon) regions
53  region_id.add(muonField);
54  Range prefix;
55  MultiRange muon_range = m_dict->build_multirange(region_id, prefix, "technology");
56  if (muon_range.size()) {
57  ATH_MSG_INFO("MultiRange built successfully to Technology "
58  << "MultiRange size is " << muon_range.size());
59 
60  } else {
61  ATH_MSG_ERROR("Muon MultiRange is empty");
62  return 1;
63  }
64 
65  return 0;
66 }
67 
68 // From hash get Identifier
69 int MuonIdHelper::get_id(const IdentifierHash& hash_id, Identifier& id, const IdContext* context) const {
70  int result = 1;
71  id.clear();
72 
73  size_t begin = (context) ? context->begin_index() : 0;
74  // cannot get hash if end is 0:
75  size_t end = (context) ? context->end_index() : 0;
76  if (0 == begin) {
77  // No hashes yet for ids with prefixes
78  if (m_MODULE_INDEX == end) {
79  if (hash_id < (unsigned int)(m_module_vec.end() - m_module_vec.begin())) {
80  id = m_module_vec[hash_id];
81  result = 0;
82  }
83  } else if (m_DETECTORELEMENT_INDEX == end) {
84  if (hash_id < (unsigned int)(m_detectorElement_vec.end() - m_detectorElement_vec.begin())) {
85  id = m_detectorElement_vec[hash_id];
86  result = 0;
87  }
88  } else if (m_CHANNEL_INDEX == end) {
89  if (hash_id < (unsigned int)(m_channel_vec.end() - m_channel_vec.begin())) {
90  id = m_channel_vec[hash_id];
91  result = 0;
92  }
93  }
94  }
95  return (result);
96 }
97 
99  // by binary search - overwritten in the derived classes
100  IdContext context = module_context();
101  hash_id = UINT_MAX;
102  size_t begin = context.begin_index();
103  size_t end = context.end_index();
104 
105  if (0 == begin) {
106  // No hashes yet for ids with prefixes
107  if (m_MODULE_INDEX == end) {
108  id_vec_it it = std::lower_bound(m_module_vec.begin(), m_module_vec.end(), id);
109  if ((it != m_module_vec.end()) && (*it == id)) {
110  hash_id = it - m_module_vec.begin();
111  return 0;
112  }
113  }
114  }
115  ATH_MSG_WARNING("MuonIdHelper::get_module_hash(): Could not determine hash for identifier " << id.get_compact());
116  return 1;
117 }
118 
120  // by binary search - overwritten in the derived classes
121  hash_id = UINT_MAX;
123  size_t begin = context.begin_index();
124  size_t end = context.end_index();
125  if (0 == begin) {
126  if (m_DETECTORELEMENT_INDEX == end) {
127  id_vec_it it = std::lower_bound(m_detectorElement_vec.begin(), m_detectorElement_vec.end(), id);
128  if ((it != m_detectorElement_vec.end()) && (*it == id)) {
129  hash_id = it - m_detectorElement_vec.begin();
130  return 0;
131  }
132  }
133  }
134  ATH_MSG_WARNING("MuonIdHelper::get_detectorElement_hash(): Could not determine hash for identifier " << id.get_compact());
135  return 1;
136 }
137 
139  IdContext context = channel_context();
140  return get_hash(id, hash_id, &context);
141 }
142 
143 int MuonIdHelper::get_hash(const Identifier& id, IdentifierHash& hash_id, const IdContext* context) const {
144  // Get the hash code from either a vec. We convert to compact
145  // and call get_hash again. For the latter, we calculate the hash from the
146  // Identifier.
147 
148  int result = 1;
149  hash_id = 0;
150  size_t begin = (context) ? context->begin_index() : 0;
151  // size_t end = (context) ? context->end_index() : 0;
152  if (0 == begin) {
153  // No hashes yet for ids with prefixes
154  result = get_hash_calc(id, hash_id, context);
155  }
156  return (result);
157 }
158 
159 int MuonIdHelper::get_expanded_id(const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const {
160  return (get_expanded_id_calc(id, exp_id, context));
161 }
162 
163 int MuonIdHelper::get_id(const ExpandedIdentifier& old_id, Identifier& new_id) const {
164  // Copy old_id into new_id and get compact if possible
165  int result = 0;
166  new_id.clear();
167 
168  ExpandedIdentifier dummy_id;
169  IdContext context(dummy_id, 0, old_id.fields() - 1);
170  Identifier compact_id;
171  if (!get_compact_id(old_id, compact_id, &context)) { new_id = compact_id; }
172  return (result);
173 }
174 
175 // From compact, get ExpandedIdentifier
176 int MuonIdHelper::get_expanded_id_calc(const Identifier& compact_id, ExpandedIdentifier& id, const IdContext* context) const {
177  int result = 1;
178  id.clear();
179  if (m_dict) {
180  // some preconditions in the case that the dictionary existd
181  size_t begin = (context) ? context->begin_index() : 0;
182  size_t end = (context) ? context->end_index() : m_CHANNEL_INDEX;
183  assert(end <= m_CHANNEL_INDEX);
184 
185  if (0 == end) {
186  result = 0;
187  } else if (0 == begin) {
189  result = m_dict->unpack(compact_id, empty, end, id);
190  } else {
191  // Non-zero prefix - we assume that the prefix contains
192  // the IdDet level
193  result = m_dict->unpack(compact_id, context->prefix_id(), end, id);
194  }
195  }
196  return result;
197 }
198 
199 int MuonIdHelper::get_compact_id(const ExpandedIdentifier& id, Identifier& compact_id, const IdContext* context) const {
200  // Get compact for all fields provided
201  int result = 1;
202  compact_id = (Identifier::value_type)0;
203  int exp_id[10];
204 
205  for (size_t i = 0; i < id.fields(); i++) exp_id[i] = id[i];
206 
207  if (m_dict && id.fields() > 0) {
208  size_t begin = (context) ? context->begin_index() : 0;
209  size_t end = (context) ? context->end_index() : id.fields() - 1;
210  result = m_dict->pack32(exp_id, begin, end, m_GROUP_INDEX, compact_id);
211  // result = m_dict->pack32(id, begin, end, compact_id);
212  }
213  return (result);
214 }
215 
216 int MuonIdHelper::get_hash_calc(const Identifier& compact_id, IdentifierHash& hash_id, const IdContext* context) const {
217  // Get the hash code from vec (for wafers only).
218  hash_id = UINT_MAX;
219  size_t begin = (context) ? context->begin_index() : 0;
220  size_t end = (context) ? context->end_index() : 0;
221 
222  if (0 == begin) {
223  // No hashes yet for ids with prefixes
224  if (m_MODULE_INDEX == end) {
225  return get_module_hash(compact_id, hash_id);
226  } else if (m_DETECTORELEMENT_INDEX == end) {
227  return get_detectorElement_hash(compact_id, hash_id);
228  } else if (m_CHANNEL_INDEX == end) {
229  id_vec_it it = std::lower_bound(m_channel_vec.begin(), m_channel_vec.end(), compact_id);
230  if ((it != m_channel_vec.end()) && (*it == compact_id)) {
231  hash_id = it - m_channel_vec.begin();
232  return 0;
233  }
234  }
235  }
236  ATH_MSG_WARNING("MuonIdHelper::get_hash_calc(): Could not determine hash for identifier " << compact_id.get_compact());
237  return 1;
238 }
239 
241  if (!m_dict) {
242  ATH_MSG_ERROR(" initLevelsFromDict - dictionary NOT initialized ");
243  return 1;
244  }
245 
246  // Find out which identifier field corresponds to each level. Use
247  // names to find each field/leve.
248 
249  m_MUON_INDEX = 999;
250  m_NAME_INDEX = 999;
251  m_ETA_INDEX = 999;
252  m_PHI_INDEX = 999;
253  m_CHANNEL_INDEX = 999;
254 
255  // Save index to stations for unpacking
258  ATH_MSG_ERROR("initLevelsFromDict - unable to find a muon station index: id, reg"
259  << " " << std::string(id) << " " << m_station_region_index);
260 
261  return 1;
262  }
263 
264  // Find a Muon region
265  IdDictField* field = m_dict->find_field("subdet");
266  if (field) {
267  m_MUON_INDEX = field->m_index;
268  } else {
269  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'subdet' field ");
270  return 1;
271  }
272  field = m_dict->find_field("stationName");
273  if (field) {
274  m_NAME_INDEX = field->m_index;
275 
276  if (m_stationIdxToNameMap.empty()) {
277  // we only need to fill the vectors and sets once
278  for (size_t i = 0; i < field->get_label_number(); i++) {
279  std::string name = field->get_label(i);
280  int index = (int)field->get_label_value(name);
285  // all chambers starting with B are in the barrel except the BEE chambers
286  if ('B' == name[0]) {
287  if (name[1] != 'E')
288  m_isBarrel.insert(index);
289  else
290  m_isSmall.insert(index); // BEE is in the small sector
291  if ('G' == name[2] || 'F' == name[2]) { m_isSmall.insert(index); }
292  } else if ('F' == name[2]) {
293  m_isForward.insert(index);
294  }
295  if ('S' == name[2]) { m_isSmall.insert(index); }
296  }
297  }
298 
299  } else {
300  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'stationName' field ");
301  return 1;
302  }
303  field = m_dict->find_field("stationEta");
304  if (field) {
305  m_ETA_INDEX = field->m_index;
306  } else {
307  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'stationEta' field ");
308  return 1;
309  }
310  field = m_dict->find_field("stationPhi");
311  if (field) {
312  m_PHI_INDEX = field->m_index;
313  } else {
314  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'stationPhi' field ");
315  return 1;
316  }
317  field = m_dict->find_field("technology");
318  if (field) {
319  m_TECHNOLOGY_INDEX = field->m_index;
320 
321  if (m_technologyNameToIdxMap.empty()) {
322  for (size_t i = 0; i < field->get_label_number(); ++i) {
323  std::string name = field->get_label(i);
324  int index = (int)field->get_label_value(name);
328  }
329  }
330 
331  } else {
332  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'technology' field ");
333  return 1;
334  }
336 
337  // Set the field implementations down to the technology
341 
342  // m_stationNameField = m_dict->find_field ("stationName"); // Philipp
343  // m_technologyField = m_dict->find_field ("technology"); // Philipp
344  return 0;
345 }
346 
348  //
349  // create a vector(s) to retrieve the hashes for compact ids. For
350  // the moment, we implement a hash for modules
351  //
352 
353  // module hash
355  ATH_MSG_INFO("The element hash max is " << m_module_hash_max);
357  IdContext context = module_context();
358  unsigned int nids = 0;
359  std::set<Identifier> ids;
360  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
361  const Range& range = m_full_module_range[i];
362  Range::const_identifier_factory first = range.factory_begin();
363  Range::const_identifier_factory last = range.factory_end();
364  for (; first != last; ++first) {
365  Identifier id;
366  get_id((*first), id);
367  if (!(ids.insert(id)).second) {
368  ATH_MSG_ERROR("init_hashes "
369  << " Error: duplicated id for module id. nid " << (int)nids << " compact id " << id << " id ");
370  return 1;
371  }
372  nids++;
373  }
374  }
375  if (ids.size() != m_module_hash_max) {
376  ATH_MSG_ERROR("init_hashes "
377  << " Error: set size NOT EQUAL to element hash max. size " << ids.size() << " hash max " << m_module_hash_max);
378 
379  return 1;
380  }
381 
382  nids = 0;
383  std::set<Identifier>::const_iterator first = ids.begin();
384  std::set<Identifier>::const_iterator last = ids.end();
385  for (; first != last && nids < m_module_vec.size(); ++first) {
386  m_module_vec[nids] = (*first);
387  nids++;
388  }
389  // sort the vector of identifiers to be able to use std::lower_bound to find hashes
390  std::sort(m_module_vec.begin(), m_module_vec.end());
391  return 0;
392 }
393 
395  //
396  // create a vector(s) to retrieve the hashes for compact ids. For
397  // the moment, we implement a hash for readout channels
398  //
399 
400  // detector element hash
402  ATH_MSG_INFO("The detector element hash max is " << m_detectorElement_hash_max);
405  unsigned int nids = 0;
406  std::set<Identifier> ids;
407  for (unsigned int i = 0; i < m_full_detectorElement_range.size(); ++i) {
409  Range::const_identifier_factory first = range.factory_begin();
410  Range::const_identifier_factory last = range.factory_end();
411  for (; first != last; ++first) {
412  Identifier id;
413  get_id((*first), id);
414  if (!(ids.insert(id)).second) {
415  ATH_MSG_ERROR("init_detectorElement_hashes "
416  << " Error: duplicated id for channel id. nid " << nids << " compact id " << id << " id ");
417 
418  return 1;
419  }
420  nids++;
421  }
422  }
423  if (ids.size() != m_detectorElement_hash_max) {
424  ATH_MSG_ERROR("init_hashes "
425  << " Error: set size NOT EQUAL to hash max. size " << ids.size() << " hash max " << m_detectorElement_hash_max);
426  return 1;
427  }
428 
429  nids = 0;
430  std::set<Identifier>::const_iterator first = ids.begin();
431  std::set<Identifier>::const_iterator last = ids.end();
432  for (; first != last && nids < m_detectorElement_vec.size(); ++first) {
433  m_detectorElement_vec[nids] = (*first);
434  nids++;
435  }
436  // sort the vector of identifiers to be able to use std::lower_bound to find hashes
437  std::sort(m_detectorElement_vec.begin(), m_detectorElement_vec.end());
438  return 0;
439 }
440 
442  //
443  // create a vector(s) to retrieve the hashes for compact ids. For
444  // the moment, we implement a hash for readout channels
445  //
446 
447  // readout channel hash
449  ATH_MSG_INFO("The channel hash max is " << m_channel_hash_max);
451  IdContext context = channel_context();
452  unsigned int nids = 0;
453  std::set<Identifier> ids;
454  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
455  const Range& range = m_full_channel_range[i];
456  Range::const_identifier_factory first = range.factory_begin();
457  Range::const_identifier_factory last = range.factory_end();
458  for (; first != last; ++first) {
459  Identifier id;
460  get_id((*first), id);
461 
462  if (!(ids.insert(id)).second) {
463  ATH_MSG_ERROR("init_channel_hashes "
464  << " Error: duplicated id for channel id. nid " << nids << " compact id " << id << " id ");
465  return 1;
466  }
467  m_channel_vec[nids] = id;
468  nids++;
469  }
470  }
471  if (ids.size() != m_channel_hash_max) {
472  ATH_MSG_ERROR("init_hashes "
473  << " Error: set size NOT EQUAL to hash max. size " << ids.size() << " hash max " << m_channel_hash_max);
474 
475  return 1;
476  }
477  // sort the vector of identifiers to be able to use std::lower_bound to find hashes
478  std::sort(m_channel_vec.begin(), m_channel_vec.end());
479  return 0;
480 }
481 
483  unsigned short index = id;
484  if (index < m_prev_phi_module_vec.size()) {
485  if (m_prev_phi_module_vec[index] == NOT_VALID_HASH) return 1;
487  return 0;
488  }
489  return 1;
490 }
491 
493  unsigned short index = id;
494  if (index < m_next_phi_module_vec.size()) {
495  if (m_next_phi_module_vec[index] == NOT_VALID_HASH) return 1;
497  return 0;
498  }
499  return 1;
500 }
501 
503  unsigned short index = id;
504  if (index < m_prev_eta_module_vec.size()) {
505  if (m_prev_eta_module_vec[index] == NOT_VALID_HASH) return 1;
507  return 0;
508  }
509  return 1;
510 }
511 
513  unsigned short index = id;
514  if (index < m_next_eta_module_vec.size()) {
515  if (m_next_eta_module_vec[index] == NOT_VALID_HASH) return 1;
517  return 0;
518  }
519  return 1;
520 }
521 
523  //
524  // create a vector(s) to retrieve the hashes for compact ids for
525  // module neighbors.
526  //
527 
528  ATH_MSG_VERBOSE("MuonIdHelper::init_neighbors ");
533 
534  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
535  const Range& range = m_full_module_range[i];
536  const Range::field& phi_field = range[m_PHI_INDEX];
537  const Range::field& eta_field = range[m_ETA_INDEX];
538  Range::const_identifier_factory first = range.factory_begin();
539  Range::const_identifier_factory last = range.factory_end();
540  for (; first != last; ++first) {
541  const ExpandedIdentifier& id = (*first);
546  bool pphi = phi_field.get_previous(id[m_PHI_INDEX], previous_phi);
547  bool nphi = phi_field.get_next(id[m_PHI_INDEX], next_phi);
548  bool peta = eta_field.get_previous(id[m_ETA_INDEX], previous_eta);
549  bool neta = eta_field.get_next(id[m_ETA_INDEX], next_eta);
550 
551  Identifier compact_id;
552  IdContext wcontext = module_context();
553 
554  // First get primary hash id
555  IdentifierHash hash_id;
556  if (!get_compact_id(id, compact_id, &wcontext)) {
557  // forward to compact -> hash
558  if (get_hash(compact_id, hash_id, &wcontext)) {
559  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get hash, exp/compact "
560  << " " << std::hex << compact_id << std::dec << endmsg);
561  return 1;
562  }
563  } else {
564  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get compact, exp/compact ");
565  return 1;
566  }
567 
568  // index for the subsequent arrays
569  unsigned short index = hash_id;
570  assert(hash_id < m_prev_phi_module_vec.size());
571  assert(hash_id < m_next_phi_module_vec.size());
572  assert(hash_id < m_prev_eta_module_vec.size());
573  assert(hash_id < m_next_eta_module_vec.size());
574 
575  if (pphi) {
576  // Get previous phi hash id
577  ExpandedIdentifier expId = id;
578  expId[m_PHI_INDEX] = previous_phi;
579  if (!get_compact_id(expId, compact_id, &wcontext)) {
580  // forward to compact -> hash
581  if (get_hash(compact_id, hash_id, &wcontext)) {
582  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get previous phi hash, exp/compact "
583  << " " << std::hex << compact_id << std::dec);
584  return 1;
585  }
586  } else {
587  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get previous phi compact, exp/compact ");
588  return 1;
589  }
590  m_prev_phi_module_vec[index] = hash_id;
591  }
592 
593  if (nphi) {
594  // Get next phi hash id
595  ExpandedIdentifier expId = id;
596  expId[m_PHI_INDEX] = next_phi;
597  if (!get_compact_id(expId, compact_id, &wcontext)) {
598  // forward to compact -> hash
599  if (get_hash(compact_id, hash_id, &wcontext)) {
600  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get next phi hash, exp/compact "
601  << " " << std::hex << compact_id << std::dec);
602  return 1;
603  }
604  } else {
605  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get next phi compact, exp/compact ");
606  return 1;
607  }
608  m_next_phi_module_vec[index] = hash_id;
609  }
610 
611  if (peta) {
612  // Get previous eta hash id
613  ExpandedIdentifier expId = id;
614  expId[m_ETA_INDEX] = previous_eta;
615  if (!get_compact_id(expId, compact_id, &wcontext)) {
616  // forward to compact -> hash
617  if (get_hash(compact_id, hash_id, &wcontext)) {
618  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get previous eta hash, exp/compact "
619  << " " << std::hex << compact_id << std::dec);
620  return 1;
621  }
622  } else {
623  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get previous eta compact, exp/compact ");
624  return 1;
625  }
626  m_prev_eta_module_vec[index] = hash_id;
627  }
628 
629  if (neta) {
630  // Get next eta hash id
631  ExpandedIdentifier expId = id;
632  expId[m_ETA_INDEX] = next_eta;
633  if (!get_compact_id(expId, compact_id, &wcontext)) {
634  // forward to compact -> hash
635  if (get_hash(compact_id, hash_id, &wcontext)) {
636  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get next eta hash, exp/compact "
637  << " " << std::hex << compact_id << std::dec);
638  return 1;
639  }
640  } else {
641  ATH_MSG_ERROR(" MuonIdHelper::init_neighbors - unable to get next eta compact, exp/compact ");
642  return 1;
643  }
644  m_next_eta_module_vec[index] = hash_id;
645  }
646  }
647  }
648  ATH_MSG_VERBOSE("Finish init_neighors() ...");
649  return 0;
650 }
651 
653  if (m_dict) {
654  int nids = 0;
655  IdContext context = module_context();
657  const_id_iterator last = m_module_vec.end();
658  for (; first != last; ++first, ++nids) {
659  Identifier compact = (*first);
661  if (get_expanded_id(compact, id, &context)) {
662  ATH_MSG_ERROR("test_module_packing: Unable to get expanded id. Compact id " << compact);
663  continue;
664  }
665  Identifier new_compact;
666  if (get_compact_id(id, new_compact, &context)) {
667  ATH_MSG_ERROR("test_module_packing: Unable to get compact id. Expanded id " << std::string(id));
668  continue;
669  }
670  if (compact != new_compact) {
671  ATH_MSG_ERROR("test_module_packing: new and old compacts not equal "
672  << "New/old/expanded ids " << new_compact << " " << compact << " " << std::string(id));
673  continue;
674  }
675  }
676 
677  ATH_MSG_INFO("test_module_packing: Successful tested " << nids << " ids. ");
678  } else {
679  ATH_MSG_ERROR("Unable to test module is packing - no dictionary has been defined. ");
680  }
681 }
682 
683 void MuonIdHelper::test_id(const Identifier& id, const IdContext& context) const {
684  Identifier compact = id;
685  ExpandedIdentifier new_id;
686  if (get_expanded_id(compact, new_id, &context)) {
687  ATH_MSG_ERROR("Unable to get expanded id. Compact id " << compact);
688  return;
689  }
690  Identifier new_compact;
691  if (get_compact_id(new_id, new_compact, &context)) {
692  ATH_MSG_ERROR("Unable to get compact id. Expanded id " << show_to_string(id));
693  return;
694  }
695  if (compact != new_compact) {
696  ATH_MSG_ERROR("new and old compacts not equal. New/old/expanded ids " << new_compact << " " << compact << " "
697  << show_to_string(id));
698  return;
699  }
700 }
701 
702 // Prepend the station ID
703 
704 void MuonIdHelper::addStationID(Identifier& id, int stationName, int stationEta, int stationPhi, int technology) const {
705  ExpandedIdentifier exp_id;
706  IdContext muon_context(exp_id, 0, m_MUON_INDEX);
707  if (get_expanded_id(id, exp_id, &muon_context)) {
708  ATH_MSG_ERROR(" MUON_ID result is NOT ok. MUON id " << show_to_string(id) << " Fields not appended ");
709  } else {
710  exp_id << stationName << stationEta << stationPhi << technology;
711  get_id(exp_id, id); // Fill output
712  }
713 }
714 
716  std::string name = stationNameString(stationName(id));
717 
718  if ('I' == name[1] || '4' == name[1]) return 0;
719  if ('E' == name[1] || '1' == name[1]) return 1;
720  if ('M' == name[1] || '2' == name[1]) return 2;
721  if ('O' == name[1] || '3' == name[1]) return 3;
722  if (name == "CSS" || name == "CSL") return 0;
723  ATH_MSG_ERROR(" MuonId::stationRegion / id = " << show_to_string(id) << " stationnamestring = " << name);
724  return -1;
725 }
726 
727 /*******************************************************************************/
729 /*******************************************************************************/
732  return (IdContext(id, 0, m_TECHNOLOGY_INDEX));
733 }
734 /*******************************************************************************/
737  return (IdContext(id, 0, m_MODULE_INDEX));
738 }
739 /*******************************************************************************/
742  return (IdContext(id, 0, m_DETECTORELEMENT_INDEX));
743 }
744 /*******************************************************************************/
747  return (IdContext(id, 0, m_CHANNEL_INDEX));
748 }
749 /*******************************************************************************/
751 /*******************************************************************************/
753 /*******************************************************************************/
755 /*******************************************************************************/
756 std::vector<Identifier> MuonIdHelper::idVector(void) const { return m_module_vec; }
757 /*******************************************************************************/
759 /*******************************************************************************/
761 /*******************************************************************************/
763 /*******************************************************************************/
765 
767 /*******************************************************************************/
769 /*******************************************************************************/
770 // Check common station fields
773 bool MuonIdHelper::validTechnology(int technology) const {
775 }
776 
777 /*******************************************************************************/
780 }
781 /*******************************************************************************/
782 // Check if ID for muon system
783 bool MuonIdHelper::is_muon(const Identifier& id) const { return AtlasDetectorID::is_muon(id); }
784 /*******************************************************************************/
785 // Check if ID for MDT
786 bool MuonIdHelper::is_mdt(const Identifier& id) const { return AtlasDetectorID::is_mdt(id); }
787 /*******************************************************************************/
788 // Check if ID for CSC
789 bool MuonIdHelper::is_csc(const Identifier& id) const { return AtlasDetectorID::is_csc(id); }
790 /*******************************************************************************/
791 // Check if ID for RPC
792 bool MuonIdHelper::is_rpc(const Identifier& id) const { return AtlasDetectorID::is_rpc(id); }
793 /*******************************************************************************/
794 // Check if ID for TGC
795 bool MuonIdHelper::is_tgc(const Identifier& id) const { return AtlasDetectorID::is_tgc(id); }
796 /*******************************************************************************/
797 // Check if ID for sTGC
798 bool MuonIdHelper::is_stgc(const Identifier& id) const { return AtlasDetectorID::is_stgc(id); }
799 /*******************************************************************************/
800 // Check if ID for MicroMegas
801 bool MuonIdHelper::is_mm(const Identifier& id) const { return AtlasDetectorID::is_mm(id); }
802 /*******************************************************************************/
803 // Access to components of the ID
804 int MuonIdHelper::stationName(const Identifier& id) const {
805  int result = m_sta_impl.unpack(id);
806  return result;
807 }
808 /*******************************************************************************/
809 int MuonIdHelper::stationEta(const Identifier& id) const {
810  int result = m_eta_impl.unpack(id);
811  return result;
812 }
813 /*******************************************************************************/
814 int MuonIdHelper::stationPhi(const Identifier& id) const {
815  int result = m_phi_impl.unpack(id);
816  return result;
817 }
818 /*******************************************************************************/
819 int MuonIdHelper::technology(const Identifier& id) const {
820  int result = m_tec_impl.unpack(id);
821  return result;
822 }
823 /*******************************************************************************/
825 /*******************************************************************************/
827 /*******************************************************************************/
828 // Methods used by Moore
829 bool MuonIdHelper::isBarrel(const Identifier& id) const { return isBarrel(stationName(id)); }
830 /*******************************************************************************/
831 bool MuonIdHelper::isEndcap(const Identifier& id) const { return isEndcap(stationName(id)); }
832 /*******************************************************************************/
833 bool MuonIdHelper::isForward(const Identifier& id) const { return isForward(stationName(id)); }
834 /*******************************************************************************/
835 bool MuonIdHelper::isSmall(const Identifier& id) const { return isSmall(stationName(id)); }
836 /*******************************************************************************/
837 bool MuonIdHelper::isBarrel(const int& stationNameIndex) const { return (m_isBarrel.count(stationNameIndex) == 1); }
838 /*******************************************************************************/
839 bool MuonIdHelper::isEndcap(const int& stationNameIndex) const { return (m_isBarrel.count(stationNameIndex) == 0); }
840 /*******************************************************************************/
841 bool MuonIdHelper::isForward(const int& stationNameIndex) const { return (m_isForward.count(stationNameIndex) == 1); }
842 /*******************************************************************************/
843 bool MuonIdHelper::isSmall(const int& stationNameIndex) const { return (m_isSmall.count(stationNameIndex) == 1); }
844 /*******************************************************************************/
845 // Access to name and technology maps
846 int MuonIdHelper::stationNameIndex(const std::string& name) const {
847  std::map<std::string, int>::const_iterator itr = m_stationNameToIdxMap.find(name);
848  if (itr != m_stationNameToIdxMap.end()) return itr->second;
849  return -1;
850 }
851 /*******************************************************************************/
852 int MuonIdHelper::technologyIndex(const std::string& name) const {
853  std::map<std::string, int>::const_iterator itr = m_technologyNameToIdxMap.find(name);
854  if (itr != m_technologyNameToIdxMap.end()) return itr->second;
855  return -1;
856 }
857 /*******************************************************************************/
858 const std::string& MuonIdHelper::stationNameString(const int& index) const {
859  assert(index >= 0 && index <= stationNameIndexMax());
860  std::map<int, std::string>::const_iterator itr = m_stationIdxToNameMap.find(index);
861  if (itr != m_stationIdxToNameMap.end()) return itr->second;
862  return BAD_NAME;
863 }
864 /*******************************************************************************/
865 const std::string& MuonIdHelper::technologyString(const int& index) const {
866  assert(index >= 0 && index <= technologyNameIndexMax());
867  std::map<int, std::string>::const_iterator itr = m_technologyIdxToNameMap.find(index);
868  if (itr != m_technologyIdxToNameMap.end()) return itr->second;
869  return BAD_NAME;
870 }
871 /*******************************************************************************/
872 int MuonIdHelper::nStationNames() const { return (int)m_isSmall.size(); }
873 /*******************************************************************************/
874 bool MuonIdHelper::isInitialized() const { return m_init; }
875 /*******************************************************************************/
MuonIdHelper::is_muon
bool is_muon(const Identifier &id) const
Definition: MuonIdHelper.cxx:783
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictMgr.cxx:366
MuonIdHelper::get_prev_in_phi
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Access to hashes for neighbors in phi and eta (return == 0 for neighbor found)
Definition: MuonIdHelper.cxx:482
MuonIdHelper::m_next_eta_module_vec
hash_vec m_next_eta_module_vec
Definition: MuonIdHelper.h:286
Identifier::value_type
IDENTIFIER_TYPE value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:39
MuonIdHelper::validStation
bool validStation(int stationName, int technology) const
Definition: MuonIdHelper.cxx:771
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:846
MuonIdHelper::detectorElement_context
IdContext detectorElement_context() const
id for detector element
Definition: MuonIdHelper.cxx:740
MuonIdHelper.h
MuonIdHelper::multiRange
MultiRange multiRange() const
multirange
Definition: MuonIdHelper.cxx:750
MuonIdHelper::m_technologyIdxToNameMap
std::map< int, std::string > m_technologyIdxToNameMap
Mapping int -> string.
Definition: MuonIdHelper.h:329
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:1048
AtlasDetectorID::is_rpc
bool is_rpc(Identifier id) const
Definition: AtlasDetectorID.h:875
MuonIdHelper::m_prev_eta_module_vec
hash_vec m_prev_eta_module_vec
Definition: MuonIdHelper.h:285
MuonIdHelper::initLevelsFromDict
int initLevelsFromDict()
Definition: MuonIdHelper.cxx:240
MuonIdHelper::test_id
void test_id(const Identifier &id, const IdContext &context) const
Definition: MuonIdHelper.cxx:683
MuonIdHelper::stationRegion
int stationRegion(const Identifier &id) const
Definition: MuonIdHelper.cxx:715
IdDictDictionary::unpack
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
Definition: IdDictMgr.cxx:1510
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:320
MuonIdHelper::m_init
bool m_init
Definition: MuonIdHelper.h:342
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonIdHelper::detectorElement_begin
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
Definition: MuonIdHelper.cxx:762
MuonIdHelper::m_isSmall
std::set< int > m_isSmall
Definition: MuonIdHelper.h:334
MuonIdHelper::is_rpc
bool is_rpc(const Identifier &id) const
Definition: MuonIdHelper.cxx:792
MuonIdHelper::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override
Create compact id from hash id (return == 0 for OK)
Definition: MuonIdHelper.cxx:69
MuonIdHelper::technologyIndex
int technologyIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:852
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AtlasDetectorID::is_csc
bool is_csc(Identifier id) const
Definition: AtlasDetectorID.h:891
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonIdHelper::m_next_phi_module_vec
hash_vec m_next_phi_module_vec
Definition: MuonIdHelper.h:284
MuonIdHelper::m_stationInTech
std::set< int > m_stationInTech
Definition: MuonIdHelper.h:254
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonIdHelper::channel_context
IdContext channel_context() const
id for channel
Definition: MuonIdHelper.cxx:745
MuonIdHelper::is_mdt
bool is_mdt(const Identifier &id) const
Definition: MuonIdHelper.cxx:786
index
Definition: index.py:1
MuonIdHelper::m_detectorElement_hash_max
size_type m_detectorElement_hash_max
Definition: MuonIdHelper.h:280
MuonIdHelper::channel_end
const_id_iterator channel_end() const
Definition: MuonIdHelper.cxx:768
MuonIdHelper::m_sta_impl
IdDictFieldImplementation m_sta_impl
Definition: MuonIdHelper.h:289
MuonIdHelper::m_channel_hash_max
size_type m_channel_hash_max
Definition: MuonIdHelper.h:275
MuonIdHelper::m_technologyNameToIdxMap
std::map< std::string, int > m_technologyNameToIdxMap
Mapping string -> int.
Definition: MuonIdHelper.h:327
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AtlasDetectorID::is_mm
bool is_mm(Identifier id) const
Definition: AtlasDetectorID.h:913
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:108
MuonIdHelper::is_csc
bool is_csc(const Identifier &id) const
Definition: MuonIdHelper.cxx:789
IdContext::end_index
size_type end_index(void) const
Definition: IdContext.h:106
ExpandedIdentifier::fields
size_type fields() const
MuonIdHelper::technologyString
const std::string & technologyString(const int &index) const
Definition: MuonIdHelper.cxx:865
MuonIdHelper::module_end
const_id_iterator module_end() const
Definition: MuonIdHelper.cxx:760
MuonIdHelper::m_prev_phi_module_vec
hash_vec m_prev_phi_module_vec
Definition: MuonIdHelper.h:283
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:804
MuonIdHelper::muon
Identifier muon() const
Definition: MuonIdHelper.cxx:728
MuonIdHelper::detectorElement_end
const_id_iterator detectorElement_end() const
Definition: MuonIdHelper.cxx:764
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonIdHelper::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: MuonIdHelper.h:291
MuonIdHelper::isStNameInTech
virtual bool isStNameInTech(const std::string &stationName) const =0
The valid element checks converted the identifier to a stationName string in order to assess whether ...
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:148
MuonIdHelper::m_full_channel_range
MultiRange m_full_channel_range
Definition: MuonIdHelper.h:274
MuonIdHelper::stationNameIndexMax
int stationNameIndexMax() const
Definition: MuonIdHelper.cxx:824
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
IdDictDictionary::pack32
int pack32(const ExpandedIdentifier &id, size_t index1, size_t index2, Identifier &packedId) const
Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic,...
Definition: IdDictMgr.cxx:1234
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictMgr.cxx:309
MuonIdHelper::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: MuonIdHelper.cxx:15
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictDefs.h:448
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MuonIdHelper::is_tgc
bool is_tgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:795
MuonIdHelper::isSmall
bool isSmall(const Identifier &id) const
Definition: MuonIdHelper.cxx:835
Range::field::get_next
bool get_next(element_type current, element_type &next) const
Definition: DetectorDescription/Identifier/src/Range.cxx:479
MuonIdHelper::m_stationIdxToNameMap
std::map< int, std::string > m_stationIdxToNameMap
Mapping int -> string.
Definition: MuonIdHelper.h:323
MuonIdHelper::is_stgc
bool is_stgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:798
MuonIdHelper::m_technologyIndexMax
int m_technologyIndexMax
Definition: MuonIdHelper.h:330
MuonIdHelper::m_stationIndexMax
int m_stationIndexMax
Definition: MuonIdHelper.h:325
IdDictMgr
Definition: IdDictDefs.h:32
MuonIdHelper::m_stationNameToIdxMap
std::map< std::string, int > m_stationNameToIdxMap
Mapping string -> int.
Definition: MuonIdHelper.h:321
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:161
MuonIdHelper::m_MUON_INDEX
size_type m_MUON_INDEX
Definition: MuonIdHelper.h:257
MuonIdHelper::addStationID
void addStationID(Identifier &id, int stationName, int stationEta, int stationPhi, int technology) const
Definition: MuonIdHelper.cxx:704
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
MuonIdHelper::m_module_vec
id_vec m_module_vec
Definition: MuonIdHelper.h:271
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
AtlasDetectorID::is_tgc
bool is_tgc(Identifier id) const
Definition: AtlasDetectorID.h:902
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonIdHelper::get_prev_in_eta
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Definition: MuonIdHelper.cxx:502
MuonIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:98
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDefs.h:302
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
MuonIdHelper::m_full_detectorElement_range
MultiRange m_full_detectorElement_range
Definition: MuonIdHelper.h:279
MuonIdHelper::isForward
bool isForward(const Identifier &id) const
Definition: MuonIdHelper.cxx:833
MuonIdHelper::id_vec_it
id_vec::const_iterator id_vec_it
Definition: MuonIdHelper.h:230
MuonIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:119
MuonIdHelper::m_full_module_range
MultiRange m_full_module_range
Definition: MuonIdHelper.h:269
MuonIdHelper::get_expanded_id
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
Create expanded id from compact id (return == 0 for OK)
Definition: MuonIdHelper.cxx:159
Range::const_identifier_factory
Definition: DetectorDescription/Identifier/Identifier/Range.h:191
MuonIdHelper::is_mm
bool is_mm(const Identifier &id) const
Definition: MuonIdHelper.cxx:801
MuonIdHelper::get_hash_calc
virtual int get_hash_calc(const Identifier &compact_id, IdentifierHash &hash_id, const IdContext *context) const
Definition: MuonIdHelper.cxx:216
MuonIdHelper::technologyNameIndexMax
int technologyNameIndexMax() const
Definition: MuonIdHelper.cxx:826
MuonIdHelper::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: MuonIdHelper.h:290
MuonIdHelper::init_hashes
int init_hashes()
Definition: MuonIdHelper.cxx:347
MuonIdHelper::m_NAME_INDEX
size_type m_NAME_INDEX
Definition: MuonIdHelper.h:259
MuonIdHelper::MuonIdHelper
MuonIdHelper(const std::string &logName)
Definition: MuonIdHelper.cxx:11
MuonIdHelper::m_muon_impl
IdDictFieldImplementation m_muon_impl
Definition: MuonIdHelper.h:288
MuonIdHelper::m_GROUP_INDEX
size_t m_GROUP_INDEX
Definition: MuonIdHelper.h:258
MuonIdHelper::nStationNames
int nStationNames() const
Definition: MuonIdHelper.cxx:872
MuonIdHelper::get_next_in_phi
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Definition: MuonIdHelper.cxx:492
AtlasDetectorID::register_dict_tag
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
Definition: AtlasDetectorID.cxx:266
Identifier::clear
void clear()
Reset to invalid state.
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:814
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:338
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:858
IdContext::begin_index
size_type begin_index(void) const
Definition: IdContext.h:100
MuonIdHelper::get_channel_hash
virtual int get_channel_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:138
MuonIdHelper::init_neighbors
int init_neighbors()
Definition: MuonIdHelper.cxx:522
MuonIdHelper::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: MuonIdHelper.h:263
MultiRange
A MultiRange combines several Ranges.
Definition: DetectorDescription/Identifier/Identifier/Range.h:351
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
MuonIdHelper::m_detectorElement_vec
id_vec m_detectorElement_vec
Definition: MuonIdHelper.h:281
MuonIdHelper::isBarrel
bool isBarrel(const Identifier &id) const
Definition: MuonIdHelper.cxx:829
AtlasDetectorID::muon_exp
ExpandedIdentifier muon_exp(void) const
Definition: AtlasDetectorID.h:506
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:27
MuonIdHelper::m_isBarrel
std::set< int > m_isBarrel
Definition: MuonIdHelper.h:333
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:752
IdDictDictionary
Definition: IdDictDefs.h:97
MuonIdHelper::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: MuonIdHelper.h:260
MuonIdHelper::m_module_hash_max
size_type m_module_hash_max
Definition: MuonIdHelper.h:270
MuonIdHelper::isEndcap
bool isEndcap(const Identifier &id) const
Definition: MuonIdHelper.cxx:831
MuonIdHelper::init_detectorElement_hashes
virtual int init_detectorElement_hashes()
Definition: MuonIdHelper.cxx:394
MuonIdHelper::m_station_region_index
size_type m_station_region_index
Definition: MuonIdHelper.h:256
DeMoScan.index
string index
Definition: DeMoScan.py:362
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:284
Range::field::get_previous
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
Definition: DetectorDescription/Identifier/src/Range.cxx:414
MuonIdHelper::m_TECHNOLOGY_INDEX
size_type m_TECHNOLOGY_INDEX
Definition: MuonIdHelper.h:262
AtlasDetectorID::is_muon
bool is_muon(Identifier id) const
Definition: AtlasDetectorID.h:701
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
MuonIdHelper::test_module_packing
void test_module_packing() const
Tests of packing.
Definition: MuonIdHelper.cxx:652
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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:143
MuonIdHelper::technology
int technology(const Identifier &id) const
Definition: MuonIdHelper.cxx:819
MultiRange::size
size_type size() const
Definition: DetectorDescription/Identifier/src/Range.cxx:2488
AtlasDetectorID::muon
Identifier muon(void) const
Definition: AtlasDetectorID.cxx:54
DeMoScan.first
bool first
Definition: DeMoScan.py:534
MuonIdHelper::size_type
Identifier::size_type size_type
Definition: MuonIdHelper.h:141
MuonIdHelper::get_expanded_id_calc
int get_expanded_id_calc(const Identifier &compact_id, ExpandedIdentifier &id, const IdContext *context) const
Definition: MuonIdHelper.cxx:176
MuonIdHelper::channel_begin
const_id_iterator channel_begin() const
Iterators over full set of ids.
Definition: MuonIdHelper.cxx:766
MuonIdHelper::module_context
IdContext module_context() const
id for module
Definition: MuonIdHelper.cxx:735
MuonIdHelper::m_DETECTORELEMENT_INDEX
size_type m_DETECTORELEMENT_INDEX
Definition: MuonIdHelper.h:264
MuonIdHelper::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: MuonIdHelper.h:143
MuonIdHelper::m_tec_impl
IdDictFieldImplementation m_tec_impl
Definition: MuonIdHelper.h:292
MuonIdHelper::get_next_in_eta
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Definition: MuonIdHelper.cxx:512
AtlasDetectorID::is_stgc
bool is_stgc(Identifier id) const
Definition: AtlasDetectorID.h:924
MuonIdHelper::m_channel_vec
id_vec m_channel_vec
Definition: MuonIdHelper.h:276
MuonIdHelper::init_channel_hashes
int init_channel_hashes()
Definition: MuonIdHelper.cxx:441
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:116
MuonIdHelper::NOT_VALID_HASH
static constexpr int NOT_VALID_HASH
Definition: MuonIdHelper.h:227
IdContext::prefix_id
const ExpandedIdentifier & prefix_id(void) const
Definition: IdContext.h:94
Range::field
This is the individual specification for the range of one ExpandedIdentifier field.
Definition: DetectorDescription/Identifier/Identifier/Range.h:37
CaloCondBlobAlgs_fillNoiseFromASCII.fields
fields
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:106
IdDictField
Definition: IdDictDefs.h:318
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: DetectorDescription/Identifier/src/Range.cxx:2503
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
MuonIdHelper::module_begin
const_id_iterator module_begin() const
Iterators over full set of ids.
Definition: MuonIdHelper.cxx:758
IdentifierHash
Definition: IdentifierHash.h:38
MuonIdHelper::m_isForward
std::set< int > m_isForward
Definition: MuonIdHelper.h:335
MuonIdHelper::get_compact_id
int get_compact_id(const ExpandedIdentifier &id, Identifier &compact_id, const IdContext *context) const
Definition: MuonIdHelper.cxx:199
IdContext
class IdContext
Definition: IdContext.h:34
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictDefs.h:474
MuonIdHelper::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: MuonIdHelper.h:261
MuonIdHelper::validTechnology
bool validTechnology(int technology) const
Definition: MuonIdHelper.cxx:773
MuonIdHelper::technology_context
IdContext technology_context() const
access to IdContext's which define which levels or fields are contained in the Muon id
Definition: MuonIdHelper.cxx:730
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
MuonIdHelper::idVector
std::vector< Identifier > idVector() const
the id's
Definition: MuonIdHelper.cxx:756
MuonIdHelper::isInitialized
bool isInitialized() const
Definition: MuonIdHelper.cxx:874
AtlasDetectorID::is_mdt
bool is_mdt(Identifier id) const
Definition: AtlasDetectorID.h:859
MuonIdHelper::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: MuonIdHelper.h:265
MuonIdHelper::BAD_NAME
static const std::string BAD_NAME
Definition: MuonIdHelper.h:224
MuonIdHelper::channel_hash_max
size_type channel_hash_max() const
Definition: MuonIdHelper.cxx:754
MuonIdHelper::m_dict
const IdDictDictionary * m_dict
Definition: MuonIdHelper.h:266