ATLAS Offline Software
TgcIdHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9  m_module_hashes.fill(-1);
10 }
11 
12 // Initialize dictionary
14  int status = 0;
15 
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  IdDictField* field = m_dict->find_field("tgcGasGap");
40  if (field) {
41  m_GASGAP_INDEX = field->m_index;
42  } else {
43  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'tgcGasGap' field ");
44  status = 1;
45  }
46 
47  field = m_dict->find_field("isStrip");
48  if (field) {
49  m_ISSTRIP_INDEX = field->m_index;
50  } else {
51  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'isStrip' field ");
52  status = 1;
53  }
54 
55  field = m_dict->find_field("channel");
56  if (field) {
57  m_CHANNEL_INDEX = field->m_index;
58  } else {
59  ATH_MSG_ERROR("initLevelsFromDict - unable to find channel' field ");
60  status = 1;
61  }
62 
63  // reinitialize the module ndex
65 
66  // save an index to the first region of tgc
67  IdDictGroup* tgcGroup = m_dict->find_group("tgc");
68  if (!tgcGroup) {
69  ATH_MSG_ERROR("Cannot find tgc group");
70  } else {
71  m_GROUP_INDEX = tgcGroup->regions()[0]->m_index;
72  }
73 
74  const IdDictRegion& region = *m_dict->m_regions[m_GROUP_INDEX];
81 
82  ATH_MSG_DEBUG(" TGC decode index and bit fields for each level: " << std::endl
83  << " muon " << m_muon_impl.show_to_string() << std::endl
84  << " station " << m_sta_impl.show_to_string() << std::endl
85  << " eta " << m_eta_impl.show_to_string() << std::endl
86  << " phi " << m_phi_impl.show_to_string() << std::endl
87  << " technology " << m_tec_impl.show_to_string() << std::endl
88  << " gas gap " << m_gap_impl.show_to_string() << std::endl
89  << " is strip " << m_ist_impl.show_to_string() << std::endl
90  << " channel " << m_cha_impl.show_to_string());
91  // Build multirange for the valid set of identifiers
92  //
93 
94  // Find value for the field MuonSpectrometer
95  int muonField = -1;
96  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
97  if (atlasDict->get_label_value("subdet", "MuonSpectrometer", muonField)) {
98  ATH_MSG_ERROR("Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->m_name);
99  return (1);
100  }
101 
102  // Build MultiRange down to "technology" for all (muon) regions
104  region_id.add(muonField);
105  Range prefix;
106  MultiRange muon_range = m_dict->build_multirange(region_id, prefix, "technology");
107  if (muon_range.size() > 0) {
108  ATH_MSG_INFO("MultiRange built successfully to Technology: "
109  << "MultiRange size is " << muon_range.size());
110  } else {
111  ATH_MSG_ERROR("Muon MultiRange is empty");
112  }
113 
114  // Build MultiRange down to "detector element" for all mdt regions
115 
116  ExpandedIdentifier detectorElement_region;
117  detectorElement_region.add(muonField);
118  Range detectorElement_prefix;
119  MultiRange muon_detectorElement_range = m_dict->build_multirange(detectorElement_region, detectorElement_prefix, "technology");
120  if (muon_detectorElement_range.size() > 0) {
121  ATH_MSG_INFO("MultiRange built successfully to detector element: "
122  << "Multilayer MultiRange size is " << muon_detectorElement_range.size());
123  } else {
124  ATH_MSG_ERROR("Muon TGC detector element MultiRange is empty");
125  }
126 
127  // Build MultiRange down to "channel" for all TGC regions
128  ExpandedIdentifier tgc_region;
129  tgc_region.add(muonField);
130  Range tgc_prefix;
131  MultiRange muon_channel_range = m_dict->build_multirange(tgc_region, tgc_prefix, "channel");
132  if (muon_channel_range.size() > 0) {
133  ATH_MSG_INFO("MultiRange built successfully to channel: "
134  << "MultiRange size is " << muon_channel_range.size());
135  } else {
136  ATH_MSG_ERROR("Muon MultiRange is empty for channels");
137  }
138 
139  // build TGC module ranges
140  // Find the regions that have a "technology field" that matches the TGC and save them
141  int tgcField = -1;
142  status = m_dict->get_label_value("technology", "TGC", tgcField);
143 
144  for (int i = 0; i < (int)muon_range.size(); ++i) {
145  const Range& range = muon_range[i];
146  if (range.fields() > m_TECHNOLOGY_INDEX) {
148  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
150  ATH_MSG_DEBUG("field size is " << (int)range.cardinality() << " field index = " << i);
151  }
152  }
153  }
154 
155  for (int j = 0; j < (int)muon_detectorElement_range.size(); ++j) {
156  const Range& range = muon_detectorElement_range[j];
157  if (range.fields() > m_TECHNOLOGY_INDEX) {
159  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
161  ATH_MSG_DEBUG("detector element field size is " << (int)range.cardinality() << " field index = " << j);
162  }
163  }
164  }
165 
166  for (int j = 0; j < (int)muon_channel_range.size(); ++j) {
167  const Range& range = muon_channel_range[j];
168  if (range.fields() > m_TECHNOLOGY_INDEX) {
170  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
172  ATH_MSG_DEBUG("channel field size is " << (int)range.cardinality() << " field index = " << j);
173  }
174  }
175  }
176 
177  // test to see that the multi range is not empty
178  if (m_full_module_range.size() == 0) {
179  ATH_MSG_ERROR("TGC MultiRange ID is empty for modules");
180  status = 1;
181  }
182 
184 
185  if (m_full_detectorElement_range.size() == 0) {
186  ATH_MSG_ERROR("TGC MultiRange ID is empty for detector elements");
187  status = 1;
188  }
189 
190  // test to see that the multi range is not empty
191  if (m_full_channel_range.size() == 0) {
192  ATH_MSG_ERROR("TGC MultiRange ID is empty for channels");
193  status = 1;
194  }
195 
196  // Setup the hash tables for TGC
197  ATH_MSG_INFO("Initializing TGC hash indices ... ");
198  status = init_hashes();
199  status = init_detectorElement_hashes(); // same as module hash
201 
202  // Setup hash tables for finding neighbors
203  ATH_MSG_INFO("Initializing TGC hash indices for finding neighbors ... ");
205 
206  m_init = true;
207  return (status);
208 }
209 
210 inline unsigned int TgcIdHelper::moduleHashIdx(const Identifier& id) const{
213  constexpr unsigned int C = s_phiDim;
214  constexpr unsigned int BxC = C*s_etaDim;
215  const int stEta = stationEta(id);
216  return (stationName(id) - m_stationShift)*BxC + (stEta + s_etaDim/2 - (stEta>0))*C + (stationPhi(id) -1);
217 }
220 
221  unsigned int hash_max = module_hash_max();
222  for (unsigned int i = 0; i < hash_max; ++i) {
223  const Identifier& id = m_module_vec[i];
224  const unsigned idx = moduleHashIdx(id);
225  if (idx >= m_module_hashes.size() || m_module_hashes[idx] < hash_max){
226  ATH_MSG_FATAL("Failed to assign module hash to "<<show_to_string(id));
227  return 1;
228  }
229  m_module_hashes[idx] = i;
230  }
231  return 0;
232 }
233 
235  const unsigned int idx = moduleHashIdx(id);
236  if (idx >= m_module_hashes.size()) return 1;
237  hash_id = m_module_hashes[idx];
238  return 0;
239 }
240 
242  return get_module_hash(id, hash_id);
243 }
244 
245 void TgcIdHelper::idChannels(const Identifier& id, std::vector<Identifier>& vect) const {
246  vect.clear();
247  Identifier parent = parentID(id);
248  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
249  const Range& range = m_full_channel_range[i];
251  for (const auto &expId : rit) {
252  Identifier child;
253  get_id(expId, child);
254  if (parentID(child) == parent) vect.push_back(child);
255  }
256  }
257 }
258 
260  ExpandedIdentifier expId;
261  IdContext eta_context(expId, 0, m_ETA_INDEX);
262  if (!get_expanded_id(id, expId, &eta_context)) {
263  int result = -999;
264  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
265  const Range& range = m_full_module_range[i];
266  if (range.match(expId)) {
267  const Range::field& eta_field = range[m_ETA_INDEX];
268  if (not eta_field.empty()) {
269  int etamin = eta_field.get_minimum();
270  if (-999 == result) {
271  result = etamin;
272  } else {
273  if (etamin < result) result = etamin;
274  }
275  }
276  }
277  }
278  return (result);
279  }
280  return (999); // default
281 }
282 
284  ExpandedIdentifier expId;
285  IdContext eta_context(expId, 0, m_ETA_INDEX);
286  if (!get_expanded_id(id, expId, &eta_context)) {
287  int result = -999;
288  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
289  const Range& range = m_full_module_range[i];
290  if (range.match(expId)) {
291  const Range::field& eta_field = range[m_ETA_INDEX];
292  if (not eta_field.empty()) {
293  int etamax = eta_field.get_maximum();
294  if (result < etamax) result = etamax;
295  }
296  }
297  }
298  return (result);
299  }
300  return (-999);
301 }
302 
304  ExpandedIdentifier expId;
305  IdContext phi_context(expId, 0, m_PHI_INDEX);
306  if (!get_expanded_id(id, expId, &phi_context)) {
307  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
308  const Range& range = m_full_module_range[i];
309  if (range.match(expId)) {
310  const Range::field& phi_field = range[m_PHI_INDEX];
311  if (not phi_field.empty()) { return (phi_field.get_minimum()); }
312  }
313  }
314  }
315  // Failed to find the min
316  return (999);
317 }
318 
320  ExpandedIdentifier expId;
321  IdContext phi_context(expId, 0, m_PHI_INDEX);
322  if (!get_expanded_id(id, expId, &phi_context)) {
323  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
324  const Range& range = m_full_module_range[i];
325  if (range.match(expId)) {
326  const Range::field& phi_field = range[m_PHI_INDEX];
327  if (not phi_field.empty()) { return (phi_field.get_maximum()); }
328  }
329  }
330  }
331  // Failed to find the max
332  return (-999);
333 }
334 
335 int TgcIdHelper::gasGapMin(const Identifier& id) const {
336  ExpandedIdentifier expId;
337  IdContext gasgap_context(expId, 0, m_GASGAP_INDEX);
338  if (!get_expanded_id(id, expId, &gasgap_context)) {
339  int result = -999;
340  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
341  const Range& range = m_full_channel_range[i];
342  if (range.match(expId)) {
343  const Range::field& gasgap_field = range[m_GASGAP_INDEX];
344  if (not gasgap_field.empty()) {
345  int gasgapmin = gasgap_field.get_minimum();
346  if (-999 == result) {
347  result = gasgapmin;
348  } else {
349  if (gasgapmin < result) result = gasgapmin;
350  }
351  }
352  }
353  }
354  return (result);
355  }
356  return (999);
357 }
358 
359 int TgcIdHelper::gasGapMax(const Identifier& id) const {
360  ExpandedIdentifier expId;
361  IdContext gasgap_context(expId, 0, m_GASGAP_INDEX);
362  if (!get_expanded_id(id, expId, &gasgap_context)) {
363  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
364  const Range& range = m_full_channel_range[i];
365  if (range.match(expId)) {
366  const Range::field& gasgap_field = range[m_GASGAP_INDEX];
367  if (not gasgap_field.empty()) { return (gasgap_field.get_maximum()); }
368  }
369  }
370  }
371  // Failed to find the max
372  return (-999);
373 }
374 
375 int TgcIdHelper::isStripMin(const Identifier& id) const {
376  ExpandedIdentifier expId;
377  IdContext isstrip_context(expId, 0, m_ISSTRIP_INDEX);
378  if (!get_expanded_id(id, expId, &isstrip_context)) {
379  int result = -999;
380  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
381  const Range& range = m_full_channel_range[i];
382  if (range.match(expId)) {
383  const Range::field& isstrip_field = range[m_ISSTRIP_INDEX];
384  if (not isstrip_field.empty()) {
385  int isstripmin = isstrip_field.get_minimum();
386  if (-999 == result) {
387  result = isstripmin;
388  } else {
389  if (isstripmin < result) result = isstripmin;
390  }
391  }
392  }
393  }
394  return (result);
395  }
396  return (999);
397 }
398 
399 int TgcIdHelper::isStripMax(const Identifier& id) const {
400  ExpandedIdentifier expId;
401  IdContext isstrip_context(expId, 0, m_ISSTRIP_INDEX);
402  if (!get_expanded_id(id, expId, &isstrip_context)) {
403  int result = -999;
404  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
405  const Range& range = m_full_channel_range[i];
406  if (range.match(expId)) {
407  const Range::field& isstrip_field = range[m_ISSTRIP_INDEX];
408  if (not isstrip_field.empty()) {
409  int isstripmax = isstrip_field.get_maximum();
410  if (result < isstripmax) result = isstripmax;
411  }
412  }
413  }
414  return (result);
415  }
416  return (-999);
417 }
418 
419 int TgcIdHelper::channelMin(const Identifier& id) const {
420  ExpandedIdentifier expId;
422  if (!get_expanded_id(id, expId, &channel_context)) {
423  int result = -999;
424  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
425  const Range& range = m_full_channel_range[i];
426  if (range.match(expId)) {
427  const Range::field& channel_field = range[m_CHANNEL_INDEX];
428  if (not channel_field.empty()) {
429  int channelmin = channel_field.get_minimum();
430  if (-999 == result) {
431  result = channelmin;
432  } else {
433  if (channelmin < result) result = channelmin;
434  }
435  }
436  }
437  }
438  return (result);
439  }
440  return (999);
441 }
442 
443 int TgcIdHelper::channelMax(const Identifier& id) const {
444  ExpandedIdentifier expId;
446  if (!get_expanded_id(id, expId, &channel_context)) {
447  int result = -999;
448  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
449  const Range& range = m_full_channel_range[i];
450  if (range.match(expId)) {
451  const Range::field& channel_field = range[m_CHANNEL_INDEX];
452  if (not channel_field.empty()) {
453  int channelmax = channel_field.get_maximum();
454  if (result < channelmax) result = channelmax;
455  }
456  }
457  }
458  return (result);
459  }
460  return (-999);
461 }
462 
463 // validation of levels
464 
465 bool TgcIdHelper::valid(const Identifier& id) const {
466  if (!validElement(id)) return false;
467 
468  int station = stationName(id);
469  int gasG = gasGap(id);
470  if (gasG < gasGapMin() || gasG > gasGapMax(tripletChamber(station))) {
471  ATH_MSG_DEBUG("Invalid gasGap=" << gasG << " gasGapMin=" << gasGapMin(id) << " gasGapMax=" << gasGapMax(tripletChamber(station)));
472  return false;
473  }
474 
475  int isstrip = isStrip(id);
476  if (isstrip < isStripMin(id) || isstrip > isStripMax(id)) {
477  ATH_MSG_DEBUG("Invalid isStrip=" << isstrip << " isStripMin=" << isStripMin(id) << " isStripMax=" << isStripMax(id));
478  return false;
479  }
480 
481  int element = channel(id);
482  if (element < channelMin(id) || element > channelMax(id)) {
483  ATH_MSG_DEBUG("Invalid channel=" << element << " channelMin=" << channelMin(id) << " channelMax=" << channelMax(id));
484  return false;
485  }
486  return true;
487 }
488 bool TgcIdHelper::isStNameInTech(const std::string& name) const { return 'T' == name[0]; }
489 bool TgcIdHelper::validElement(const Identifier& id) const {
490  int station = stationName(id);
491  if (!validStation(station)) {
492  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(station));
493  return false;
494  }
495 
496  int eta = stationEta(id);
497  if (eta < stationEtaMin(id) || eta > stationEtaMax(id)) {
498  ATH_MSG_DEBUG("Invalid stationEta=" << eta << " for stationName=" << stationNameString(station) << " stationIndex=" << station
499  << " stationEtaMin=" << stationEtaMin(id) << " stationEtaMax=" << stationEtaMax(id));
500  return false;
501  }
502 
503  int phi = stationPhi(id);
504  if (phi < stationPhiMin(id) || phi > stationPhiMax(id)) {
505  ATH_MSG_DEBUG("Invalid stationPhi=" << phi << " for stationName=" << stationNameString(station) << " stationIndex=" << station
506  << " stationPhiMin=" << stationPhiMin(id) << " stationPhiMax=" << stationPhiMax(id));
507  return false;
508  }
509  return true;
510 }
511 
512 // Private validation of levels
513 
515  if (!validStation(stationName)) {
516  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(stationName));
517  return false;
518  }
519  if (stationEta < stationEtaMin(id) || stationEta > stationEtaMax(id)) {
520  ATH_MSG_DEBUG("Invalid stationEta=" << stationEta << " for stationName=" << stationNameString(stationName)
521  << " stationIndex=" << stationName << " stationEtaMin=" << stationEtaMin(id)
522  << " stationEtaMax=" << stationEtaMax(id));
523  return false;
524  }
525  if (stationPhi < stationPhiMin(id) || stationPhi > stationPhiMax(id)) {
526  ATH_MSG_DEBUG("Invalid stationPhi=" << stationPhi << " for stationName=" << stationNameString(stationName)
527  << " stationIndex=" << stationName << " stationPhiMin=" << stationPhiMin(id)
528  << " stationPhiMax=" << stationPhiMax(id));
529  return false;
530  }
531  return true;
532 }
533 
534 // Check values down to readout channel level
535 
537  int channel) const {
538  if (!validElement(id, stationName, stationEta, stationPhi)) return false;
539 
541  ATH_MSG_DEBUG("Invalid gasGap=" << gasGap << " gasGapMin=" << gasGapMin(id)
542  << " gasGapMax=" << gasGapMax(tripletChamber(stationName)));
543  return false;
544  }
545  if (isStrip < isStripMin(id) || isStrip > isStripMax(id)) {
546  ATH_MSG_DEBUG("Invalid isStrip=" << isStrip << " isStripMin=" << isStripMin(id) << " isStripMax=" << isStripMax(id));
547  return false;
548  }
549  if (channel < channelMin(id) || channel > channelMax(id)) {
550  ATH_MSG_DEBUG("Invalid channel=" << channel << " channelMin=" << channelMin(id) << " channelMax=" << channelMax(id));
551  return false;
552  }
553  return true;
554 }
555 
557  // pack fields independently
564  return result;
565 }
567  try {
570  return result;
571  } catch (const std::out_of_range&) { isValid = false; }
572  return Identifier{0};
573 }
574 
575 Identifier TgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi) const {
576  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi);
577 }
578 Identifier TgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool& isValid) const {
579  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi, isValid);
580 }
581 Identifier TgcIdHelper::elementID(const Identifier& id) const { return parentID(id); }
582 
584  // pack fields independently
594  return result;
595 }
597  bool& isValid) const {
598  try {
601  return result;
602  } catch (const std::out_of_range&) { isValid = false; }
603  return Identifier{0};
604 }
605 Identifier TgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip,
606  int channel) const {
608 }
609 Identifier TgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel,
610  bool& isValid) const {
612 }
613 
615  Identifier result(id);
619  return result;
620 }
621 Identifier TgcIdHelper::channelID(const Identifier& id, int gasGap, int isStrip, int channel, bool& isValid) const {
622  try {
624  isValid = valid(result);
625  return result;
626  } catch (const std::out_of_range&) { isValid = false; }
627  return Identifier{0};
628 }
629 
630 // get parent id from strip or gang identifier
632  assert(is_tgc(id));
633  Identifier result(id);
637  return result;
638 }
639 
640 // Access to components of the ID
641 
642 int TgcIdHelper::gasGap(const Identifier& id) const { return m_gap_impl.unpack(id); }
643 
645 int TgcIdHelper::isStrip(const Identifier& id) const { return m_ist_impl.unpack(id); }
646 
647 bool TgcIdHelper::measuresPhi(const Identifier& id) const { return isStrip(id); }
648 
649 int TgcIdHelper::channel(const Identifier& id) const { return m_cha_impl.unpack(id); }
650 
651 // Access to min and max of level ranges
652 
654 
656 
658 
660 
662 
663 int TgcIdHelper::gasGapMax(bool triplet) { return triplet ? GasGapTripletMax : GasGapDoubletMax; }
664 
666 
668 
670 
673 
675  int tgcField = technologyIndex("TGC");
676  if (m_dict) { tgcField = tgc_field_value(); }
677  return tgcField;
678 }
679 
681  const std::string& name = stationNameString(stationName);
682  return ('E' == name[2]);
683 }
684 
686  const std::string& name = stationNameString(stationName);
687  return ('1' == name[1]);
688 }
689 
690 int TgcIdHelper::chamberType(const std::string& stationName, int stationEta) {
691  if ('1' == stationName[1]) {
692  if ('F' == stationName[2])
693  return 1;
694  else
695  return (std::abs(stationEta) + 1);
696  } else if ('2' == stationName[1]) {
697  if ('F' == stationName[2])
698  return 6;
699  else
700  return (std::abs(stationEta) + 6);
701  } else if ('3' == stationName[1]) {
702  if ('F' == stationName[2])
703  return 12;
704  else
705  return (std::abs(stationEta) + 12);
706  } else if ('4' == stationName[1]) {
707  if ('F' == stationName[2])
708  return 18;
709  else
710  return (std::abs(stationEta) + 18);
711  }
712  assert(0);
713  return -1;
714 }
715 
717  const std::string& name = stationNameString(stationName);
718  return chamberType(name, stationEta);
719 }
TgcIdHelper::stationPhiMin
static int stationPhiMin(bool endcap)
Definition: TgcIdHelper.cxx:657
MuonIdHelper::validStation
bool validStation(int stationName, int technology) const
Definition: MuonIdHelper.cxx:767
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:842
TgcIdHelper::StationPhiEndcapMax
@ StationPhiEndcapMax
Definition: TgcIdHelper.h:189
ConstRangeIterator
Definition: RangeIterator.h:46
TgcIdHelper::m_ist_impl
IdDictFieldImplementation m_ist_impl
Definition: TgcIdHelper.h:165
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:158
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:923
TgcIdHelper::parentID
Identifier parentID(const Identifier &id) const
Definition: TgcIdHelper.cxx:631
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonIdHelper::initLevelsFromDict
int initLevelsFromDict()
Definition: MuonIdHelper.cxx:241
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TgcIdHelper::ChannelMax
@ ChannelMax
Definition: TgcIdHelper.h:198
TgcIdHelper::isStripMin
static int isStripMin()
Definition: TgcIdHelper.cxx:665
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
TgcIdHelper::ChannelMin
@ ChannelMin
Definition: TgcIdHelper.h:197
IdDictGroup
Definition: IdDictDefs.h:341
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TgcIdHelper::chamberType
static int chamberType(const std::string &stationName, int stationEta)
Definition: TgcIdHelper.cxx:690
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:70
MuonIdHelper::technologyIndex
int technologyIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:848
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TgcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: TgcIdHelper.cxx:642
TgcIdHelper::channelMax
static int channelMax()
Definition: TgcIdHelper.cxx:671
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TgcIdHelper::GasGapTripletMax
@ GasGapTripletMax
Definition: TgcIdHelper.h:194
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:44
AtlasDetectorID::muon_field_value
int muon_field_value() const
Definition: AtlasDetectorID.h:620
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonIdHelper::channel_context
IdContext channel_context() const
id for channel
Definition: MuonIdHelper.cxx:741
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TgcIdHelper::channelMin
static int channelMin()
Definition: TgcIdHelper.cxx:669
MultiRange::add
void add(const Range &range)
Definition: MultiRange.cxx:22
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:59
MuonIdHelper::m_sta_impl
IdDictFieldImplementation m_sta_impl
Definition: MuonIdHelper.h:289
DMTest::C
C_v1 C
Definition: C.h:26
TgcIdHelper::validElement
bool validElement(const Identifier &id) const
Definition: TgcIdHelper.cxx:489
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
TgcIdHelper::moduleHashIdx
unsigned int moduleHashIdx(const Identifier &id) const
Definition: TgcIdHelper.cxx:210
TgcIdHelper::StationPhiForwardMin
@ StationPhiForwardMin
Definition: TgcIdHelper.h:190
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:174
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
TgcIdHelper::tgcTechnology
int tgcTechnology() const
Utility methods.
Definition: TgcIdHelper.cxx:674
TgcIdHelper::StationPhiForwardMax
@ StationPhiForwardMax
Definition: TgcIdHelper.h:191
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
TgcIdHelper::StationPhiEndcapMin
@ StationPhiEndcapMin
Definition: TgcIdHelper.h:188
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:800
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:225
TgcIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: TgcIdHelper.cxx:241
MuonIdHelper::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: MuonIdHelper.h:291
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
TgcIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
Definition: TgcIdHelper.cxx:647
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictMgr.cxx:311
TgcIdHelper::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: TgcIdHelper.cxx:13
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictDefs.h:433
MuonIdHelper::is_tgc
bool is_tgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:791
IdDictFieldImplementation::reset
void reset(Identifier &id) const
Definition: IdDictFieldImplementation.h:184
TgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: TgcIdHelper.cxx:649
TgcIdHelper::StationEtaMin
@ StationEtaMin
Definition: TgcIdHelper.h:186
TgcIdHelper::GasGapDoubletMax
@ GasGapDoubletMax
Definition: TgcIdHelper.h:193
TgcIdHelper::m_stationShift
unsigned int m_stationShift
Minimal station index found.
Definition: TgcIdHelper.h:156
IdDictMgr
Definition: IdDictDefs.h:32
IdDictDictionary::find_group
IdDictGroup * find_group(const std::string &group_name) const
Definition: IdDictMgr.cxx:385
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:163
MuonIdHelper
Definition: MuonIdHelper.h:80
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TgcIdHelper::stationEtaMin
static int stationEtaMin()
Definition: TgcIdHelper.cxx:653
IdentifierField::empty
bool empty() const
Definition: IdentifierField.h:114
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonIdHelper::m_module_vec
id_vec m_module_vec
Definition: MuonIdHelper.h:271
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TgcIdHelper::m_cha_impl
IdDictFieldImplementation m_cha_impl
Definition: TgcIdHelper.h:166
TgcIdHelper::stationPhiMax
static int stationPhiMax(bool endcap)
Definition: TgcIdHelper.cxx:659
TgcIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: TgcIdHelper.cxx:234
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TgcIdHelper::tripletChamber
bool tripletChamber(int stationName) const
Definition: TgcIdHelper.cxx:685
MuonIdHelper::m_full_detectorElement_range
MultiRange m_full_detectorElement_range
Definition: MuonIdHelper.h:279
AtlasDetectorID::tgc_field_value
int tgc_field_value() const
Definition: AtlasDetectorID.h:662
TgcIdHelper::isStNameInTech
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
Definition: TgcIdHelper.cxx:488
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:160
TgcIdHelper::IsStripMax
@ IsStripMax
Definition: TgcIdHelper.h:196
TgcIdHelper::GasGapMin
@ GasGapMin
Definition: TgcIdHelper.h:192
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictMgr.cxx:1996
MuonIdHelper::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: MuonIdHelper.h:290
MuonIdHelper::init_hashes
int init_hashes()
Definition: MuonIdHelper.cxx:348
TgcIdHelper::isStrip
int isStrip(const Identifier &id) const
isStrip corresponds to measuresPhi
Definition: TgcIdHelper.cxx:645
TgcIdHelper::gasGapMax
static int gasGapMax(bool triplet)
Definition: TgcIdHelper.cxx:663
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
min
#define min(a, b)
Definition: cfImp.cxx:40
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
TgcIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: TgcIdHelper.cxx:556
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:810
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:340
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:854
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
MuonIdHelper::init_neighbors
int init_neighbors()
Definition: MuonIdHelper.cxx:520
MuonIdHelper::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: MuonIdHelper.h:263
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RangeIterator.h
TgcIdHelper::StationEtaMax
@ StationEtaMax
Definition: TgcIdHelper.h:187
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:805
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
TgcIdHelper::m_module_hashes
std::array< unsigned int, s_modHashDim > m_module_hashes
Definition: TgcIdHelper.h:158
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:748
IdDictDictionary
Definition: IdDictDefs.h:97
TgcIdHelper::validChannel
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:536
MuonIdHelper::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: MuonIdHelper.h:260
TgcIdHelper::endcapChamber
bool endcapChamber(int stationName) const
Definition: TgcIdHelper.cxx:680
TgcIdHelper::init_id_to_hashes
int init_id_to_hashes()
Definition: TgcIdHelper.cxx:218
MuonIdHelper::init_detectorElement_hashes
virtual int init_detectorElement_hashes()
Definition: MuonIdHelper.cxx:394
TgcIdHelper::s_phiDim
static constexpr unsigned int s_phiDim
48 phi stations
Definition: TgcIdHelper.h:150
TgcIdHelper::IsStripMin
@ IsStripMin
Definition: TgcIdHelper.h:195
TgcIdHelper::isStripMax
static int isStripMax()
Definition: TgcIdHelper.cxx:667
TgcIdHelper::m_GASGAP_INDEX
size_type m_GASGAP_INDEX
Definition: TgcIdHelper.h:161
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
MuonIdHelper::m_TECHNOLOGY_INDEX
size_type m_TECHNOLOGY_INDEX
Definition: MuonIdHelper.h:262
IdDictDictionary::m_name
std::string m_name
Definition: IdDictDefs.h:283
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
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
MuonIdHelper::resetAndSet
void resetAndSet(const IdDictFieldImplementation &dict, const int new_val, Identifier &id) const
Definition: MuonIdHelper.h:309
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MuonIdHelper::m_DETECTORELEMENT_INDEX
size_type m_DETECTORELEMENT_INDEX
Definition: MuonIdHelper.h:264
TgcIdHelper::gasGapMin
static int gasGapMin()
Definition: TgcIdHelper.cxx:661
MuonIdHelper::m_tec_impl
IdDictFieldImplementation m_tec_impl
Definition: MuonIdHelper.h:292
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:583
TgcIdHelper.h
merge.status
status
Definition: merge.py:17
IdDictField
Definition: IdDictDefs.h:316
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:156
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
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
TgcIdHelper::idChannels
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
Definition: TgcIdHelper.cxx:245
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
TgcIdHelper::stationEtaMax
static int stationEtaMax()
Definition: TgcIdHelper.cxx:655
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictDefs.h:459
TgcIdHelper::m_ISSTRIP_INDEX
size_type m_ISSTRIP_INDEX
Definition: TgcIdHelper.h:162
MuonIdHelper::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: MuonIdHelper.h:261
TgcIdHelper::s_etaDim
static constexpr unsigned int s_etaDim
Except T2E all stations have 4 associated eta stations.
Definition: TgcIdHelper.h:148
TgcIdHelper::m_gap_impl
IdDictFieldImplementation m_gap_impl
Definition: TgcIdHelper.h:164
TgcIdHelper::valid
bool valid(const Identifier &id) const
Definition: TgcIdHelper.cxx:465
TgcIdHelper::TgcIdHelper
TgcIdHelper()
Definition: TgcIdHelper.cxx:8
MuonIdHelper::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: MuonIdHelper.h:265
Identifier
Definition: IdentifierFieldParser.cxx:14
MuonIdHelper::m_dict
const IdDictDictionary * m_dict
Definition: MuonIdHelper.h:266