ATLAS Offline Software
MdtIdHelper.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_detectorElement_hashes
10  m_module_hashes.fill(-1);
11  m_detectorElement_hashes.fill(-1);
12 }
13 
16  int status = 0;
17 
18  // Check whether this helper should be reinitialized
19  if (!reinitialize(dict_mgr)) {
20  ATH_MSG_INFO("Request to reinitialize not satisfied - tags have not changed");
21  return 0;
22  } else {
23  ATH_MSG_DEBUG("(Re)initialize");
24  }
25 
27  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return 1;
28 
29  // Register version of the MuonSpectrometer dictionary
30  if (register_dict_tag(dict_mgr, "MuonSpectrometer")) return 1;
31 
32  m_dict = dict_mgr.find_dictionary("MuonSpectrometer");
33 
34  if (!m_dict) {
35  ATH_MSG_ERROR(" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
36  return 1;
37  }
38 
40 
41  if (initLevelsFromDict()) return 1;
42 
43  IdDictField* field = m_dict->find_field("multiLayer");
44  if (field) {
45  m_DETECTORELEMENT_INDEX = field->m_index;
46  } else {
47  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'multiLayer' field ");
48  status = 1;
49  }
50 
51  field = m_dict->find_field("tubeLayer");
52  if (field) {
53  m_TUBELAYER_INDEX = field->m_index;
54  } else {
55  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'tubeLayer' field ");
56  status = 1;
57  }
58 
59  field = m_dict->find_field("tube");
60  if (field) {
61  m_CHANNEL_INDEX = field->m_index;
62  } else {
63  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'tube' field ");
64  status = 1;
65  }
66 
67  // save an index to the first region of mdt
68 
69  IdDictGroup* mdtGroup = m_dict->find_group("mdt");
70  if (!mdtGroup) {
71  ATH_MSG_ERROR("Cannot find mdt group");
72  } else {
73  m_GROUP_INDEX = mdtGroup->regions()[0]->m_index;
74  }
75 
76  const IdDictRegion& region = *m_dict->m_regions[m_GROUP_INDEX];
83 
84  ATH_MSG_DEBUG(" MDT decode index and bit fields for each level: " << std::endl
85  << " muon " << m_muon_impl.show_to_string() << std::endl
86  << " station " << m_sta_impl.show_to_string() << std::endl
87  << " eta " << m_eta_impl.show_to_string() << std::endl
88  << " phi " << m_phi_impl.show_to_string() << std::endl
89  << " technology " << m_tec_impl.show_to_string() << std::endl
90  << " multilayer " << m_mla_impl.show_to_string() << std::endl
91  << " layer " << m_lay_impl.show_to_string() << std::endl
92  << " tube " << m_tub_impl.show_to_string() << std::endl);
93 
98 
100  int muonField = -1;
101  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
102  if (atlasDict->get_label_value("subdet", "MuonSpectrometer", muonField)) {
103  ATH_MSG_ERROR("Could not get value for label 'MuonSpectrometer' of field "
104  << "'subdet' in dictionary " << atlasDict->m_name);
105  return 1;
106  }
107 
108  // Build MultiRange down to "technology" for all (muon) regions
109 
111  region_id.add(muonField);
112  Range prefix;
113  MultiRange muon_range = m_dict->build_multirange(region_id, prefix, "technology");
114  if (muon_range.size() > 0) {
115  ATH_MSG_INFO("MultiRange built successfully to Technology: "
116  << "MultiRange size is " << muon_range.size());
117  } else {
118  ATH_MSG_ERROR("Muon MultiRange is empty");
119  }
120 
121  // Build MultiRange down to "detector element" for all mdt regions
122 
123  ExpandedIdentifier detectorElement_region;
124  detectorElement_region.add(muonField);
125  Range detectorElement_prefix;
126  MultiRange muon_detectorElement_range = m_dict->build_multirange(detectorElement_region, detectorElement_prefix, "multiLayer");
127  if (muon_detectorElement_range.size() > 0) {
128  ATH_MSG_INFO("MultiRange built successfully to detector element: "
129  << "Multilayer MultiRange size is " << muon_detectorElement_range.size());
130  } else {
131  ATH_MSG_ERROR("Muon MDT detector element MultiRange is empty");
132  }
133 
134  // Build MultiRange down to "tube" for all mdt regions
135 
136  ExpandedIdentifier mdt_region;
137  mdt_region.add(muonField);
138  Range mdt_prefix;
139  MultiRange muon_channel_range = m_dict->build_multirange(mdt_region, mdt_prefix, "tube");
140  if (muon_channel_range.size() > 0) {
141  ATH_MSG_INFO("MultiRange built successfully to tube: "
142  << "MultiRange size is " << muon_channel_range.size());
143  } else {
144  ATH_MSG_ERROR("Muon MDT channel MultiRange is empty");
145  }
146 
154  int mdtField = -1;
155  status = m_dict->get_label_value("technology", "MDT", mdtField);
156 
157  for (int i = 0; i < (int)muon_range.size(); ++i) {
158  const Range& range = muon_range[i];
159  if (range.fields() > m_TECHNOLOGY_INDEX) {
161  if (field.match((ExpandedIdentifier::element_type)mdtField)) {
163  ATH_MSG_DEBUG("module field size is " << (int)range.cardinality() << " field index = " << i);
164  }
165  }
166  }
167 
168  for (int j = 0; j < (int)muon_detectorElement_range.size(); ++j) {
169  const Range& range = muon_detectorElement_range[j];
170  if (range.fields() > m_TECHNOLOGY_INDEX) {
172  if (field.match((ExpandedIdentifier::element_type)mdtField)) {
174  ATH_MSG_DEBUG("detector element field size is " << (int)range.cardinality() << " field index = " << j);
175  }
176  }
177  }
178 
179  for (int k = 0; k < (int)muon_channel_range.size(); ++k) {
180  const Range& range = muon_channel_range[k];
181  if (range.fields() > m_TECHNOLOGY_INDEX) {
183  if (field.match((ExpandedIdentifier::element_type)mdtField)) {
185  ATH_MSG_DEBUG("channel field size is " << (int)range.cardinality() << " field index = " << k);
186  }
187  }
188  }
189 
191 
192  if (m_full_module_range.size() == 0) {
193  ATH_MSG_ERROR("MDT MultiRange ID is empty for modules");
194  status = 1;
195  }
196 
198 
199  if (m_full_detectorElement_range.size() == 0) {
200  ATH_MSG_ERROR("MDT MultiRange ID is empty for detector elements");
201  status = 1;
202  }
203 
205 
206  if (m_full_channel_range.size() == 0) {
207  ATH_MSG_ERROR("MDT MultiRange ID is empty for channels");
208  status = 1;
209  }
210 
211  // To speed up the range scans needed by the MinMax functions,
212  // keep indices of ranges by station name.
213 
215  for (const Range& r : m_full_module_range) {
216  const Range::field& station_f = r[m_NAME_INDEX];
217  assert (not station_f.empty() &&
218  station_f.get_minimum() == station_f.get_maximum());
219  unsigned int station = station_f.get_minimum();
220  if (station >= m_module_ranges_by_station.size()) {
221  m_module_ranges_by_station.resize (station+1);
222  }
223  m_module_ranges_by_station[station].push_back (&r);
224  }
225 
227  for (const Range& r : m_full_channel_range) {
228  const Range::field& station_f = r[m_NAME_INDEX];
229  assert (not station_f.empty() &&
230  station_f.get_minimum() == station_f.get_maximum());
231  unsigned int station = station_f.get_minimum();
232  if (station >= m_channel_ranges_by_station.size()) {
233  m_channel_ranges_by_station.resize (station+1);
234  }
235  m_channel_ranges_by_station[station].push_back (&r);
236  }
237 
238  // Setup the hash tables for MDT
239 
240  ATH_MSG_INFO("Initializing MDT hash indices ... ");
241  status = init_hashes();
244 
245  // Setup hash tables for finding neighbors
246 
247  ATH_MSG_INFO("Initializing MDT hash indices for finding neighbors ... ");
249 
250  // retrieve the maximum number of tubes in any chamber
251  ExpandedIdentifier expId;
253  for (const auto& id : m_detectorElement_vec) {
254  if (!get_expanded_id(id, expId, &channel_context)) {
255  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
256  const Range& range = m_full_channel_range[i];
257  if (range.match(expId)) {
258  const Range::field& channel_field = range[m_CHANNEL_INDEX];
259  if (not channel_field.empty()) {
260  unsigned int max = channel_field.get_maximum();
261  if (m_tubesMax == UINT_MAX)
262  m_tubesMax = max;
263  else if (max > m_tubesMax)
264  m_tubesMax = max;
265  }
266  }
267  }
268  }
269  }
270  if (m_tubesMax == UINT_MAX) {
271  ATH_MSG_ERROR("No maximum number of MDT tubes was retrieved");
272  status = 1;
273  } else {
274  ATH_MSG_DEBUG(" Maximum number of MDT tubes is " << m_tubesMax);
275  }
276  m_init = true;
277  m_BME_stat = stationNameIndex("BME");
278  m_BMG_stat = stationNameIndex("BMG");
279  return status;
280 }
281 
283  unsigned int hash_max = this->module_hash_max();
284  for (unsigned int i = 0; i < hash_max; ++i) {
285  const Identifier& id = m_module_vec[i];
286  const unsigned int idx = moduleHashIdx(id);
287  if (idx >= m_module_hashes.size() || m_module_hashes[idx] < hash_max){
288  ATH_MSG_FATAL("Failed to initialize module hash dict for "<<show_to_string(id)<<" index: "<<idx<<"/"<<m_module_hashes.size());
289  return 1;
290  }
291  m_module_hashes[idx] = i;
292  }
293 
294  hash_max = this->detectorElement_hash_max();
295  for (unsigned int i = 0; i < hash_max; ++i) {
296  const Identifier& id = m_detectorElement_vec[i];
297  const unsigned int idx = detEleHashIdx(id);
298  if (idx >= m_detectorElement_hashes.size() || m_detectorElement_hashes[idx] < hash_max){
299  ATH_MSG_FATAL("Failed to initialize detector element hash dict for "<<show_to_string(id));
300  return 1;
301  }
303  }
304  return 0;
305 }
306 inline unsigned int MdtIdHelper::moduleHashIdx(const Identifier& id) const {
309  constexpr unsigned int C = s_phiDim;
310  constexpr unsigned int BxC = C*s_etaDim;
312  const int stEta = stationEta(id);
313  return stationName(id)*BxC + (stEta + (s_etaDim/2))*C + (stationPhi(id)-1);
314 
315 }
316 inline unsigned int MdtIdHelper::detEleHashIdx(const Identifier& id) const {
317  return moduleHashIdx(id) *s_mlDim + (multilayer(id) -1);
318 }
320  const unsigned int idx = moduleHashIdx(id);
321  if (idx >= m_module_hashes.size()) return -1;
322  hash_id = m_module_hashes[idx];
323  return 0;
324 }
325 
327  const unsigned int idx = detEleHashIdx(id);
328  if (idx >= m_detectorElement_hashes.size()) return -1;
329  hash_id = m_detectorElement_hashes[idx];
330  return 0;
331 }
332 
334  assert(is_mdt(channelID));
338  return result;
339 }
340 
341 Identifier MdtIdHelper::multilayerID(const Identifier& moduleID, int multilayer) const {
342  Identifier result{moduleID};
344  return result;
345 }
346 
347 Identifier MdtIdHelper::multilayerID(const Identifier& moduleID, int multilayer, bool& isValid) const {
348  try {
349  const Identifier result = multilayerID(moduleID, multilayer);
351  return result;
352  } catch (const std::out_of_range&) { isValid = false; }
353  return Identifier{0};
354 }
355 void MdtIdHelper::idChannels(const Identifier& id, std::vector<Identifier>& vect) const {
356  vect.clear();
357  Identifier parent = parentID(id);
358  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
359  const Range& range = m_full_channel_range[i];
361  for (const auto & expId: rit) {
362  Identifier child;
363  get_id(expId, child);
364  if (parentID(child) == parent) vect.push_back(child);
365  }
366  }
367 }
368 
370 
372 {
373  return stationEtaMinMax(id).first;
374 }
376 {
377  return stationEtaMinMax(id).second;
378 }
379 
381 {
382  return stationPhiMinMax(id).first;
383 }
385 {
386  return stationPhiMinMax(id).second;
387 }
388 
390 {
391  return multilayerMinMax(id).first;
392 }
394 {
395  return multilayerMinMax(id).second;
396 }
397 
399 {
400  return tubeLayerMinMax(id).first;
401 }
403 {
404  return tubeLayerMinMax(id).second;
405 }
406 
407 int MdtIdHelper::tubeMin(const Identifier& id) const
408 {
409  return tubeMinMax(id).first;
410 }
411 int MdtIdHelper::tubeMax(const Identifier& id) const
412 {
413  return tubeMinMax(id).second;
414 }
415 
416 std::pair<int, int>
418  const size_type field_index,
419  const ranges_by_station_t& ranges_by_station) const {
420  int resultMin = 999;
421  int resultMax = -999;
422  ExpandedIdentifier expId;
423  IdContext eta_context(expId, 0, field_index);
424  if (!get_expanded_id(id, expId, &eta_context)) {
425  unsigned int station = expId[m_NAME_INDEX];
426  for (const Range* range : ranges_by_station.at (station)) {
427  if (range->match(expId)) {
428  const Range::field& field = (*range)[field_index];
429  if (not field.empty()) {
430  resultMin = std::min (resultMin, field.get_minimum());
431  }
432  if (not field.empty()) {
433  resultMax = std::max (resultMax, field.get_maximum());
434  }
435  }
436  }
437  }
438  return std::make_pair (resultMin, resultMax);
439 }
440 
441 
442 std::pair<int, int>
445 }
446 
447 std::pair<int, int>
450 }
451 
452 std::tuple<int, int, int, int>
454  int stationEtaMin = 999;
455  int stationEtaMax = -999;
456  int stationPhiMin = 999;
457  int stationPhiMax = -999;
458 
459  ExpandedIdentifier expIdEta;
460  ExpandedIdentifier expIdPhi;
461  IdContext contextEta(expIdEta, 0, m_ETA_INDEX);
462  IdContext contextPhi(expIdPhi, 0, m_PHI_INDEX);
463  if (!get_expanded_id(id, expIdEta, &contextEta) &&
464  !get_expanded_id(id, expIdPhi, &contextPhi)) {
465  unsigned int station = expIdEta[m_NAME_INDEX];
466  for (const Range* range : m_module_ranges_by_station.at (station)) {
467  if (range->match(expIdEta)) {
468  const Range::field& eta_field = (*range)[m_ETA_INDEX];
469  if (not eta_field.empty()) {
471  eta_field.get_minimum());
472  }
473  if (not eta_field.empty()) {
475  eta_field.get_maximum());
476  }
477 
478  if (range->match(expIdPhi)) {
479  const Range::field& phi_field = (*range)[m_PHI_INDEX];
480  if (not phi_field.empty()) {
482  phi_field.get_minimum());
483  }
484  if (not phi_field.empty()) {
486  phi_field.get_maximum());
487  }
488  }
489  }
490  }
491  }
492  return std::make_tuple (stationEtaMin, stationEtaMax,
494 }
495 
497  int result = -999;
498  ExpandedIdentifier expId;
499  IdContext context = technology_context();
500  if (!get_expanded_id(id, expId, &context)) {
501  unsigned int station = expId[m_NAME_INDEX];
502  for (const Range* range : m_channel_ranges_by_station.at (station)) {
503  if (range->match(expId)) {
504  const Range::field& multilayer_field = (*range)[m_DETECTORELEMENT_INDEX];
505  if (not multilayer_field.empty()) {
506  result = std::max (result, multilayer_field.get_maximum());
507  }
508  }
509  }
510  }
511  return result;
512 }
513 
514 std::pair<int, int>
517 }
518 
519 std::pair<int, int>
522 }
523 
524 std::pair<int, int>
527 }
528 
530 
531 bool MdtIdHelper::valid(const Identifier& id) const {
532  if (!validElement(id)) return false;
533 
534  int mlayer = multilayer(id);
536  if (mlayer < multilayerMin || mlayer > multilayerMax) {
537  ATH_MSG_DEBUG("Invalid multilayer=" << mlayer << " multilayerMin=" << multilayerMin << " multilayerMax=" << multilayerMax);
538  return false;
539  }
540 
541  int layer = tubeLayer(id);
543  if (layer < tubeLayerMin || layer > tubeLayerMax) {
544  ATH_MSG_DEBUG("Invalid tubeLayer=" << layer << " tubeLayerMin=" << tubeLayerMin << " tubeLayerMax=" << tubeLayerMax);
545  return false;
546  }
547 
548  int tb = tube(id);
549  auto [tubeMin, tubeMax ] = tubeMinMax (id);
550  if (tb < tubeMin || tb > tubeMax) {
551  ATH_MSG_DEBUG("Invalid tube=" << tb << " tubeMin=" << tubeMin << " tubeMax=" << tubeMax);
552  return false;
553  }
554  return true;
555 }
556 bool MdtIdHelper::isStNameInTech(const std::string& name) const { return 'B' == name[0] || 'E' == name[0]; }
557 bool MdtIdHelper::validElement(const Identifier& id) const {
558  int station = stationName(id);
559  if (!validStation(station)) {
560  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(station));
561  return false;
562  }
563 
565  stationEtaPhiMinMax (id);
566  int eta = stationEta(id);
567  if (eta < stationEtaMin || eta > stationEtaMax) {
568  ATH_MSG_DEBUG("Invalid stationEta=" << eta << " for stationName=" << stationNameString(station)
569  << " stationEtaMin=" << stationEtaMin << " stationEtaMax=" << stationEtaMax);
570  return false;
571  }
572 
573  int phi = stationPhi(id);
574  if (phi < stationPhiMin || phi > stationPhiMax) {
575  ATH_MSG_DEBUG("Invalid stationPhi=" << phi << " for stationName=" << stationNameString(station)
576  << " stationPhiMin=" << stationPhiMin << " stationPhiMax=" << stationPhiMax);
577  return false;
578  }
579  return true;
580 }
581 
583 
585  if (!validStation(stationName)) {
586  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(stationName));
587  return false;
588  }
589 
591  stationEtaPhiMinMax (id);
592  if (stationEta < stationEtaMin || stationEta > stationEtaMax) {
593  ATH_MSG_DEBUG("Invalid stationEta=" << stationEta << " for stationName=" << stationNameString(stationName)
594  << " stationEtaMin=" << stationEtaMin << " stationEtaMax=" << stationEtaMax);
595  return false;
596  }
597 
598  if (stationPhi < stationPhiMin || stationPhi > stationPhiMax) {
599  ATH_MSG_DEBUG("Invalid stationPhi=" << stationPhi << " for stationName=" << stationNameString(stationName)
600  << " stationPhiMin=" << stationPhiMin << " stationPhiMax=" << stationPhiMax);
601  return false;
602  }
603  return true;
604 }
605 
606 bool MdtIdHelper::validChannel(const Identifier& id, int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer,
607  int tube) const {
608  if (!validElement(id, stationName, stationEta, stationPhi)) return false;
609 
611  if (multilayer < multilayerMin || multilayer > multilayerMax) {
612  ATH_MSG_DEBUG("Invalid multilayer=" << multilayer << " multilayerMin=" << multilayerMin
613  << " multilayerMax=" << multilayerMax);
614  return false;
615  }
616 
618  if (tubeLayer < tubeLayerMin || tubeLayer > tubeLayerMax) {
619  ATH_MSG_DEBUG("Invalid tubeLayer=" << tubeLayer << " tubeLayerMin=" << tubeLayerMin << " tubeLayerMax=" << tubeLayerMax);
620  return false;
621  }
622  auto [tubeMin, tubeMax ] = tubeMinMax (id);
623  if (tube < tubeMin || tube > tubeMax) {
624  ATH_MSG_DEBUG("Invalid tube=" << tube << " tubeMin=" << tubeMin << " tubeMax=" << tubeMax);
625  return false;
626  }
627  return true;
628 }
629 
631  if (stationName < 0) { return Identifier{-1}; }
632  // pack fields independently
639  return result;
640 }
642  try {
645  return result;
646  } catch (const std::out_of_range&) { isValid = false; }
647  return Identifier{0};
648 }
649 
650 Identifier MdtIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi) const {
651  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi);
652 }
653 Identifier MdtIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool& isValid) const {
654  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi, isValid);
655 }
656 
657 Identifier MdtIdHelper::elementID(const Identifier& id) const { return parentID(id); }
658 
659 Identifier MdtIdHelper::channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const {
660  if (stationName < 0) { return Identifier{-1}; }
661 
662  // pack fields independently
672  return result;
673 }
674 Identifier MdtIdHelper::channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube,
675  bool& isValid) const {
676  try{
679  return result;
680  } catch (const std::out_of_range&) { isValid = false; }
681  return Identifier{0};
682 }
683 
684 Identifier MdtIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int tubeLayer,
685  int tube) const {
687 }
688 Identifier MdtIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int tubeLayer,
689  int tube, bool& isValid) const {
691 }
692 
693 Identifier MdtIdHelper::channelID(const Identifier& id, int multilayer, int tubeLayer, int tube) const {
694  Identifier result(id);
698  return result;
699 }
700 Identifier MdtIdHelper::channelID(const Identifier& id, int multilayer, int tubeLayer, int tube, bool& isValid) const {
701  try {
703  isValid = valid(result);
704  return result;
705  } catch (const std::out_of_range&) { isValid = false; }
706  return Identifier{0};
707 }
708 
710 
712  assert(is_mdt(id));
713  Identifier result(id);
717  return result;
718 }
719 
721 
722 int MdtIdHelper::multilayer(const Identifier& id) const { return m_mla_impl.unpack(id); }
723 
724 int MdtIdHelper::tubeLayer(const Identifier& id) const { return m_lay_impl.unpack(id); }
725 
726 int MdtIdHelper::tube(const Identifier& id) const { return m_tub_impl.unpack(id); }
727 
728 int MdtIdHelper::gasGap(const Identifier& id) const { return tubeLayer(id); }
729 
730 bool MdtIdHelper::measuresPhi(const Identifier& /*id*/) const { return false; }
731 
732 bool MdtIdHelper::isBME(const Identifier& id) const { return m_BME_stat == stationName(id); }
733 
734 bool MdtIdHelper::isBMG(const Identifier& id) const { return m_BMG_stat == stationName(id); }
735 
736 int MdtIdHelper::channel(const Identifier& id) const { return tube(id); }
737 
739 
740 int MdtIdHelper::stationEtaMin(bool barrel) {
741  if (barrel) {
742  return StationEtaBarrelMin;
743  } else {
744  return StationEtaEndcapMin;
745  }
746 }
747 
748 int MdtIdHelper::stationEtaMax(bool barrel) {
749  if (barrel) {
750  return StationEtaBarrelMax;
751  } else {
752  return StationEtaEndcapMax;
753  }
754 }
755 
757 
759 
761 
763 
765 
767 
768 int MdtIdHelper::tubeMin() { return TubeMin; }
769 
770 int MdtIdHelper::tubeMax() const { return m_tubesMax; }
772 
774  int mdtField = technologyIndex("MDT");
775  if (m_dict) { mdtField = mdt_field_value(); }
776  return mdtField;
777 }
MdtIdHelper::isBMG
bool isBMG(const Identifier &id) const
is this a BMG chamber
Definition: MdtIdHelper.cxx:734
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
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
beamspotman.r
def r
Definition: beamspotman.py:676
MdtIdHelper::validElement
bool validElement(const Identifier &id) const
Definition: MdtIdHelper.cxx:557
ConstRangeIterator
Definition: RangeIterator.h:46
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:299
MdtIdHelper::m_lay_impl
IdDictFieldImplementation m_lay_impl
Definition: MdtIdHelper.h:194
MuonIdHelper::initLevelsFromDict
int initLevelsFromDict()
Definition: MuonIdHelper.cxx:241
MdtIdHelper::tubeMax
int tubeMax() const
Definition: MdtIdHelper.cxx:770
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
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
MdtIdHelper::stationEtaMin
static int stationEtaMin(bool barrel)
Access to min and max of level ranges.
Definition: MdtIdHelper.cxx:740
IdDictGroup
Definition: IdDictGroup.h:19
MdtIdHelper::numberOfMultilayers
int numberOfMultilayers(const Identifier &id) const
Definition: MdtIdHelper.cxx:496
MdtIdHelper::MultilayerMax
@ MultilayerMax
Definition: MdtIdHelper.h:220
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
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
MdtIdHelper::StationPhiMax
@ StationPhiMax
Definition: MdtIdHelper.h:218
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
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
MuonIdHelper::is_mdt
bool is_mdt(const Identifier &id) const
Definition: MuonIdHelper.cxx:782
MdtIdHelper::StationEtaEndcapMax
@ StationEtaEndcapMax
Definition: MdtIdHelper.h:216
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:186
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
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MdtIdHelper::s_etaDim
static constexpr unsigned s_etaDim
Definition: MdtIdHelper.h:179
MuonIdHelper::m_sta_impl
IdDictFieldImplementation m_sta_impl
Definition: MuonIdHelper.h:289
MdtIdHelper::m_module_hashes
std::array< unsigned int, s_modHash > m_module_hashes
Definition: MdtIdHelper.h:188
DMTest::C
C_v1 C
Definition: C.h:26
MdtIdHelper::StationPhiMin
@ StationPhiMin
Definition: MdtIdHelper.h:217
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:173
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
MdtIdHelper::TubeMin
@ TubeMin
Definition: MdtIdHelper.h:223
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:800
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
MuonIdHelper::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: MuonIdHelper.h:291
MdtIdHelper::multilayerMinMax
std::pair< int, int > multilayerMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:515
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:274
MdtIdHelper::m_TUBELAYER_INDEX
size_type m_TUBELAYER_INDEX
Definition: MdtIdHelper.h:192
MdtIdHelper::TubeLayerMax
@ TubeLayerMax
Definition: MdtIdHelper.h:222
MdtIdHelper::m_detectorElement_hashes
std::array< unsigned int, s_detDim > m_detectorElement_hashes
Definition: MdtIdHelper.h:189
MdtIdHelper::moduleHashIdx
unsigned int moduleHashIdx(const Identifier &id) const
Definition: MdtIdHelper.cxx:306
MdtIdHelper::findMinMax
std::pair< int, int > findMinMax(const Identifier &id, const size_type field_index, const ranges_by_station_t &ranges_by_station) const
Definition: MdtIdHelper.cxx:417
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:45
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictRegion.h:20
MdtIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
always false for MDTs
Definition: MdtIdHelper.cxx:730
MdtIdHelper::multilayerMax
static int multilayerMax()
Definition: MdtIdHelper.cxx:762
IdDictFieldImplementation::reset
void reset(Identifier &id) const
Definition: IdDictFieldImplementation.h:183
MdtIdHelper::tubeMinMax
std::pair< int, int > tubeMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:525
MdtIdHelper::StationEtaEndcapMin
@ StationEtaEndcapMin
Definition: MdtIdHelper.h:215
MdtIdHelper::s_phiDim
static constexpr unsigned s_phiDim
Definition: MdtIdHelper.h:180
MdtIdHelper::multilayerMin
static int multilayerMin()
Definition: MdtIdHelper.cxx:760
MdtIdHelper::tubeLayerMinMax
std::pair< int, int > tubeLayerMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:520
AtlasDetectorID::size_type
Identifier::size_type size_type
Definition: AtlasDetectorID.h:384
Execution.tb
tb
Definition: Execution.py:15
MdtIdHelper::tubeLayerMax
static int tubeLayerMax()
Definition: MdtIdHelper.cxx:766
IdDictMgr
Definition: IdDictMgr.h:14
MdtIdHelper::m_BMG_stat
int m_BMG_stat
Definition: MdtIdHelper.h:229
MdtIdHelper::m_BME_stat
int m_BME_stat
Definition: MdtIdHelper.h:228
IdDictDictionary::find_group
IdDictGroup * find_group(const std::string &group_name) const
Definition: IdDictDictionary.cxx:115
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
MuonIdHelper
Definition: MuonIdHelper.h:80
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AtlasDetectorID::mdt_field_value
int mdt_field_value() const
Definition: AtlasDetectorID.h:653
IdentifierField::empty
bool empty() const
Definition: IdentifierField.h:114
lumiFormat.i
int i
Definition: lumiFormat.py:85
MdtIdHelper::stationEtaMax
static int stationEtaMax(bool barrel)
Definition: MdtIdHelper.cxx:748
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
MdtIdHelper::channel
int channel(const Identifier &id) const override
Definition: MdtIdHelper.cxx:736
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MdtIdHelper::TubeLayerMin
@ TubeLayerMin
Definition: MdtIdHelper.h:221
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDictionary.h:235
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
MdtIdHelper::tube
int tube(const Identifier &id) const
Definition: MdtIdHelper.cxx:726
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonIdHelper::m_full_detectorElement_range
MultiRange m_full_detectorElement_range
Definition: MuonIdHelper.h:279
MdtIdHelper::StationEtaBarrelMin
@ StationEtaBarrelMin
Definition: MdtIdHelper.h:213
MdtIdHelper.h
MdtIdHelper::validChannel
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:606
MdtIdHelper::s_mlDim
static constexpr unsigned s_mlDim
Definition: MdtIdHelper.h:181
MuonIdHelper::m_full_module_range
MultiRange m_full_module_range
Definition: MuonIdHelper.h:269
MdtIdHelper::init_id_to_hashes
int init_id_to_hashes()
Definition: MdtIdHelper.cxx:282
MdtIdHelper::stationEtaPhiMinMax
std::tuple< int, int, int, int > stationEtaPhiMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:453
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
MdtIdHelper::stationEtaMinMax
std::pair< int, int > stationEtaMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:443
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictGroup.cxx:44
MuonIdHelper::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: MuonIdHelper.h:290
MuonIdHelper::init_hashes
int init_hashes()
Definition: MuonIdHelper.cxx:348
MuonIdHelper::m_NAME_INDEX
size_type m_NAME_INDEX
Definition: MuonIdHelper.h:259
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
MdtIdHelper::tubeMin
static int tubeMin()
Definition: MdtIdHelper.cxx:768
MuonIdHelper::nStationNames
int nStationNames() const
Definition: MuonIdHelper.cxx:868
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
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:810
MdtIdHelper::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: MdtIdHelper.cxx:15
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:73
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:854
MdtIdHelper::stationPhiMinMax
std::pair< int, int > stationPhiMinMax(const Identifier &id) const
Definition: MdtIdHelper.cxx:448
MuonIdHelper::init_neighbors
int init_neighbors()
Definition: MuonIdHelper.cxx:520
MdtIdHelper::detEleHashIdx
unsigned int detEleHashIdx(const Identifier &id) const
Definition: MdtIdHelper.cxx:316
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
MdtIdHelper::m_module_ranges_by_station
ranges_by_station_t m_module_ranges_by_station
Definition: MdtIdHelper.h:234
RangeIterator.h
MuonIdHelper::m_detectorElement_vec
id_vec m_detectorElement_vec
Definition: MuonIdHelper.h:281
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
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:748
MdtIdHelper::isBME
bool isBME(const Identifier &id) const
is this a BME chamber
Definition: MdtIdHelper.cxx:732
IdDictDictionary
Definition: IdDictDictionary.h:30
MuonIdHelper::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: MuonIdHelper.h:260
MdtIdHelper::MdtIdHelper
MdtIdHelper()
Definition: MdtIdHelper.cxx:8
MdtIdHelper::m_tub_impl
IdDictFieldImplementation m_tub_impl
Definition: MdtIdHelper.h:195
MuonIdHelper::init_detectorElement_hashes
virtual int init_detectorElement_hashes()
Definition: MuonIdHelper.cxx:394
MdtIdHelper::valid
bool valid(const Identifier &id) const
Public validation of levels.
Definition: MdtIdHelper.cxx:531
MdtIdHelper::MultilayerMin
@ MultilayerMin
Definition: MdtIdHelper.h:219
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:630
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: IdDictDictionary.h:216
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
MdtIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: MdtIdHelper.cxx:326
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
DetectorZone::barrel
@ barrel
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
MdtIdHelper::stationPhiMax
static int stationPhiMax()
Definition: MdtIdHelper.cxx:758
MuonIdHelper::m_tec_impl
IdDictFieldImplementation m_tec_impl
Definition: MuonIdHelper.h:292
MdtIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: MdtIdHelper.cxx:333
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
merge.status
status
Definition: merge.py:17
MdtIdHelper::gasGap
int gasGap(const Identifier &id) const override
the gas-gap function for the MDT's returns the tube layer
Definition: MdtIdHelper.cxx:728
MdtIdHelper::StationEtaBarrelMax
@ StationEtaBarrelMax
Definition: MdtIdHelper.h:214
MdtIdHelper::m_mla_impl
IdDictFieldImplementation m_mla_impl
Definition: MdtIdHelper.h:193
MdtIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: MdtIdHelper.cxx:319
IdDictField
Definition: IdDictField.h:15
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
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
MdtIdHelper::ranges_by_station_t
std::vector< std::vector< const Range * > > ranges_by_station_t
Definition: MdtIdHelper.h:233
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
MdtIdHelper::stationPhiMin
static int stationPhiMin()
Definition: MdtIdHelper.cxx:756
MdtIdHelper::mdtTechnology
int mdtTechnology() const
Utility methods.
Definition: MdtIdHelper.cxx:773
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: IdDictRegion.h:42
MuonIdHelper::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: MuonIdHelper.h:261
calibdata.tube
tube
Definition: calibdata.py:31
MdtIdHelper::m_channel_ranges_by_station
ranges_by_station_t m_channel_ranges_by_station
Definition: MdtIdHelper.h:235
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:726
MdtIdHelper::tubeLayerMin
static int tubeLayerMin()
Definition: MdtIdHelper.cxx:764
MdtIdHelper::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: MdtIdHelper.cxx:556
fitman.k
k
Definition: fitman.py:528
MdtIdHelper::parentID
Identifier parentID(const Identifier &id) const
get parent id from channel id
Definition: MdtIdHelper.cxx:711
MdtIdHelper::idChannels
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
Definition: MdtIdHelper.cxx:355
MuonIdHelper::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: MuonIdHelper.h:265
Identifier
Definition: IdentifierFieldParser.cxx:14
MdtIdHelper::m_tubesMax
unsigned int m_tubesMax
Definition: MdtIdHelper.h:226
MuonIdHelper::m_dict
const IdDictDictionary * m_dict
Definition: MuonIdHelper.h:266