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