ATLAS Offline Software
TgcIdHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8  m_module_hashes.fill(-1);
9 }
10 
11 // Initialize dictionary
13  int status = 0;
14 
15  // Check whether this helper should be reinitialized
16  if (!reinitialize(dict_mgr)) {
17  ATH_MSG_INFO("Request to reinitialize not satisfied - tags have not changed");
18  return 0;
19  } else {
20  ATH_MSG_DEBUG("(Re)initialize");
21  }
22 
23  // init base object
24  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return (1);
25 
26  // Register version of the MuonSpectrometer dictionary
27  if (register_dict_tag(dict_mgr, "MuonSpectrometer")) return (1);
28 
29  m_dict = dict_mgr.find_dictionary("MuonSpectrometer");
30  if (!m_dict) {
31  ATH_MSG_ERROR(" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
32  return 1;
33  }
34 
35  // Initialize some of the field indices
36  if (initLevelsFromDict()) return (1);
37 
38  IdDictField* field = m_dict->find_field("tgcGasGap");
39  if (field) {
40  m_GASGAP_INDEX = field->m_index;
41  } else {
42  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'tgcGasGap' field ");
43  status = 1;
44  }
45 
46  field = m_dict->find_field("isStrip");
47  if (field) {
48  m_ISSTRIP_INDEX = field->m_index;
49  } else {
50  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'isStrip' field ");
51  status = 1;
52  }
53 
54  field = m_dict->find_field("channel");
55  if (field) {
56  m_CHANNEL_INDEX = field->m_index;
57  } else {
58  ATH_MSG_ERROR("initLevelsFromDict - unable to find channel' field ");
59  status = 1;
60  }
61 
62  // reinitialize the module ndex
64 
65  // save an index to the first region of tgc
66  IdDictGroup* tgcGroup = m_dict->find_group("tgc");
67  if (!tgcGroup) {
68  ATH_MSG_ERROR("Cannot find tgc group");
69  } else {
70  m_GROUP_INDEX = tgcGroup->regions()[0]->m_index;
71  }
72 
73  const IdDictRegion& region = *m_dict->m_regions[m_GROUP_INDEX];
80 
81  ATH_MSG_DEBUG(" TGC decode index and bit fields for each level: " << std::endl
82  << " muon " << m_muon_impl.show_to_string() << std::endl
83  << " station " << m_sta_impl.show_to_string() << std::endl
84  << " eta " << m_eta_impl.show_to_string() << std::endl
85  << " phi " << m_phi_impl.show_to_string() << std::endl
86  << " technology " << m_tec_impl.show_to_string() << std::endl
87  << " gas gap " << m_gap_impl.show_to_string() << std::endl
88  << " is strip " << m_ist_impl.show_to_string() << std::endl
89  << " channel " << m_cha_impl.show_to_string());
90  // Build multirange for the valid set of identifiers
91  //
92 
93  // Find value for the field MuonSpectrometer
94  int muonField = -1;
95  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
96  if (atlasDict->get_label_value("subdet", "MuonSpectrometer", muonField)) {
97  ATH_MSG_ERROR("Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->m_name);
98  return (1);
99  }
100 
101  // Build MultiRange down to "technology" for all (muon) regions
103  region_id.add(muonField);
104  Range prefix;
105  MultiRange muon_range = m_dict->build_multirange(region_id, prefix, "technology");
106  if (muon_range.size() > 0) {
107  ATH_MSG_INFO("MultiRange built successfully to Technology: "
108  << "MultiRange size is " << muon_range.size());
109  } else {
110  ATH_MSG_ERROR("Muon MultiRange is empty");
111  }
112 
113  // Build MultiRange down to "detector element" for all mdt regions
114 
115  ExpandedIdentifier detectorElement_region;
116  detectorElement_region.add(muonField);
117  Range detectorElement_prefix;
118  MultiRange muon_detectorElement_range = m_dict->build_multirange(detectorElement_region, detectorElement_prefix, "technology");
119  if (muon_detectorElement_range.size() > 0) {
120  ATH_MSG_INFO("MultiRange built successfully to detector element: "
121  << "Multilayer MultiRange size is " << muon_detectorElement_range.size());
122  } else {
123  ATH_MSG_ERROR("Muon TGC detector element MultiRange is empty");
124  }
125 
126  // Build MultiRange down to "channel" for all TGC regions
127  ExpandedIdentifier tgc_region;
128  tgc_region.add(muonField);
129  Range tgc_prefix;
130  MultiRange muon_channel_range = m_dict->build_multirange(tgc_region, tgc_prefix, "channel");
131  if (muon_channel_range.size() > 0) {
132  ATH_MSG_INFO("MultiRange built successfully to channel: "
133  << "MultiRange size is " << muon_channel_range.size());
134  } else {
135  ATH_MSG_ERROR("Muon MultiRange is empty for channels");
136  }
137 
138  // build TGC module ranges
139  // Find the regions that have a "technology field" that matches the TGC and save them
140  int tgcField = -1;
141  status = m_dict->get_label_value("technology", "TGC", tgcField);
142 
143  for (int i = 0; i < (int)muon_range.size(); ++i) {
144  const Range& range = muon_range[i];
145  if (range.fields() > m_TECHNOLOGY_INDEX) {
147  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
149  ATH_MSG_DEBUG("field size is " << (int)range.cardinality() << " field index = " << i);
150  }
151  }
152  }
153 
154  for (int j = 0; j < (int)muon_detectorElement_range.size(); ++j) {
155  const Range& range = muon_detectorElement_range[j];
156  if (range.fields() > m_TECHNOLOGY_INDEX) {
158  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
160  ATH_MSG_DEBUG("detector element field size is " << (int)range.cardinality() << " field index = " << j);
161  }
162  }
163  }
164 
165  for (int j = 0; j < (int)muon_channel_range.size(); ++j) {
166  const Range& range = muon_channel_range[j];
167  if (range.fields() > m_TECHNOLOGY_INDEX) {
169  if (field.match((ExpandedIdentifier::element_type)tgcField)) {
171  ATH_MSG_DEBUG("channel field size is " << (int)range.cardinality() << " field index = " << j);
172  }
173  }
174  }
175 
176  // test to see that the multi range is not empty
177  if (m_full_module_range.size() == 0) {
178  ATH_MSG_ERROR("TGC MultiRange ID is empty for modules");
179  status = 1;
180  }
181 
183 
184  if (m_full_detectorElement_range.size() == 0) {
185  ATH_MSG_ERROR("TGC MultiRange ID is empty for detector elements");
186  status = 1;
187  }
188 
189  // test to see that the multi range is not empty
190  if (m_full_channel_range.size() == 0) {
191  ATH_MSG_ERROR("TGC MultiRange ID is empty for channels");
192  status = 1;
193  }
194 
195  // Setup the hash tables for TGC
196  ATH_MSG_INFO("Initializing TGC hash indices ... ");
197  status = init_hashes();
198  status = init_detectorElement_hashes(); // same as module hash
200 
201  // Setup hash tables for finding neighbors
202  ATH_MSG_INFO("Initializing TGC hash indices for finding neighbors ... ");
204 
205  m_init = true;
206  return (status);
207 }
208 
209 inline unsigned int TgcIdHelper::moduleHashIdx(const Identifier& id) const{
212  constexpr unsigned int C = s_phiDim;
213  constexpr unsigned int BxC = C*s_etaDim;
214  const int stEta = stationEta(id);
215  return (stationName(id) - m_stationShift)*BxC + (stEta + s_etaDim/2 - (stEta>0))*C + (stationPhi(id) -1);
216 }
219 
220  unsigned int hash_max = module_hash_max();
221  for (unsigned int i = 0; i < hash_max; ++i) {
222  const Identifier& id = m_module_vec[i];
223  const unsigned idx = moduleHashIdx(id);
224  if (idx >= m_module_hashes.size() || m_module_hashes[idx] < hash_max){
225  ATH_MSG_FATAL("Failed to assign module hash to "<<show_to_string(id));
226  return 1;
227  }
228  m_module_hashes[idx] = i;
229  }
230  return 0;
231 }
232 
234  const unsigned int idx = moduleHashIdx(id);
235  if (idx >= m_module_hashes.size()) return 1;
236  hash_id = m_module_hashes[idx];
237  return 0;
238 }
239 
241  return get_module_hash(id, hash_id);
242 }
243 
244 void TgcIdHelper::idChannels(const Identifier& id, std::vector<Identifier>& vect) const {
245  vect.clear();
246  Identifier parent = parentID(id);
247  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
248  const Range& range = m_full_channel_range[i];
249  Range::const_identifier_factory first = range.factory_begin();
250  Range::const_identifier_factory last = range.factory_end();
251  for (; first != last; ++first) {
252  Identifier child;
253  get_id((*first), 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 (eta_field.has_minimum()) {
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 (eta_field.has_maximum()) {
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 (phi_field.has_minimum()) { 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 (phi_field.has_maximum()) { 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 (gasgap_field.has_minimum()) {
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 (gasgap_field.has_maximum()) { 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 (isstrip_field.has_minimum()) {
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 (isstrip_field.has_maximum()) {
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 (channel_field.has_minimum()) {
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 (channel_field.has_maximum()) {
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
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
TgcIdHelper::StationPhiEndcapMax
@ StationPhiEndcapMax
Definition: TgcIdHelper.h:189
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:129
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:1048
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:240
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:355
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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:69
MuonIdHelper::technologyIndex
int technologyIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:852
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:57
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:745
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TgcIdHelper::channelMin
static int channelMin()
Definition: TgcIdHelper.cxx:669
MultiRange::add
void add(const Range &range)
Definition: DetectorDescription/Identifier/src/Range.cxx:2410
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)
TgcIdHelper::moduleHashIdx
unsigned int moduleHashIdx(const Identifier &id) const
Definition: TgcIdHelper.cxx:209
TgcIdHelper::StationPhiForwardMin
@ StationPhiForwardMin
Definition: TgcIdHelper.h:190
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:108
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:174
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:804
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
TgcIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: TgcIdHelper.cxx:240
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:83
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictMgr.cxx:309
TgcIdHelper::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: TgcIdHelper.cxx:12
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictDefs.h:448
MuonIdHelper::is_tgc
bool is_tgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:795
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:383
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:161
MuonIdHelper
Definition: MuonIdHelper.h:80
Range::field::has_minimum
bool has_minimum() const
Definition: DetectorDescription/Identifier/src/Range.cxx:390
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TgcIdHelper::stationEtaMin
static int stationEtaMin()
Definition: TgcIdHelper.cxx:653
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
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:233
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:159
Range::const_identifier_factory
Definition: DetectorDescription/Identifier/Identifier/Range.h:191
TgcIdHelper::IsStripMax
@ IsStripMax
Definition: TgcIdHelper.h:196
TgcIdHelper::GasGapMin
@ GasGapMin
Definition: TgcIdHelper.h:192
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictMgr.cxx:2272
MuonIdHelper::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: MuonIdHelper.h:290
Range::field::get_minimum
element_type get_minimum() const
Definition: DetectorDescription/Identifier/Identifier/Range.h:524
MuonIdHelper::init_hashes
int init_hashes()
Definition: MuonIdHelper.cxx:347
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
Range::field::has_maximum
bool has_maximum() const
Definition: DetectorDescription/Identifier/src/Range.cxx:398
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: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
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TgcIdHelper::StationEtaMax
@ StationEtaMax
Definition: TgcIdHelper.h:187
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
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:752
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
Range::field::get_maximum
element_type get_maximum() const
Definition: DetectorDescription/Identifier/Identifier/Range.h:531
TgcIdHelper::init_id_to_hashes
int init_id_to_hashes()
Definition: TgcIdHelper.cxx:217
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: DetectorDescription/Identifier/src/Range.cxx:2488
DeMoScan.first
bool first
Definition: DeMoScan.py:534
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
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
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:116
Range::field
This is the individual specification for the range of one ExpandedIdentifier field.
Definition: DetectorDescription/Identifier/Identifier/Range.h:37
IdDictField
Definition: IdDictDefs.h:318
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
IdentifierHash
Definition: IdentifierHash.h:38
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
TgcIdHelper::idChannels
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
Definition: TgcIdHelper.cxx:244
TgcIdHelper::stationEtaMax
static int stationEtaMax()
Definition: TgcIdHelper.cxx:655
IdContext
class IdContext
Definition: IdContext.h:34
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictDefs.h:474
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:7
MuonIdHelper::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: MuonIdHelper.h:265
MuonIdHelper::m_dict
const IdDictDictionary * m_dict
Definition: MuonIdHelper.h:266