ATLAS Offline Software
SCT_ID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 /***************************************************************************
6  Inner Detector identifier package
7  -------------------------------------------
8 ***************************************************************************/
9 
10 
11 #include "GaudiKernel/MsgStream.h"
12 
13 #include "InDetIdentifier/SCT_ID.h"
16 #include "IdDict/IdDictDefs.h"
17 #include <set>
18 #include <algorithm>
19 #include <iostream>
20 
21 namespace{
22  std::ostream & operator<<(std::ostream & out, const MSG::Level l){
23  constexpr std::array<std::string_view, MSG::Level::NUM_LEVELS> lvl{"NIL ", "VERBOSE ",
24  "DEBUG ", "INFO ", "WARNING ", "ERROR ", "FATAL ", "ALWAYS "};
25  out<<lvl[l];
26  return out;
27  }
28 }
29 
30 namespace{
31  const IdentifierHash invalidHash;
32  const std::array<IdentifierHash, 5> invalidHashes{invalidHash, invalidHash, invalidHash,
33  invalidHash, invalidHash};
34  const std::function< IdentifierHash(const IdentifierHash &)>
35  invalidHashFunc = ([](const IdentifierHash &){return IdentifierHash{};});
36 }
37 
38 
39 
41  :
42  m_neighboursByEta{invalidHashFunc, invalidHashFunc, invalidHashFunc , invalidHashFunc, invalidHashFunc},
43  m_dict(nullptr),
44  m_wafer_hash_max(0),
45  m_strip_hash_max(0),
46  m_barrel_field(0),
47  m_hasRows(false) {
48 
49 }
50 
51 void
53  int layer_disk,
54  int phi_module,
55  int eta_module,
56  int side) const {
57  // Check that id is within allowed range
58 
59  // Fill expanded id
61 
64 
65  if (!m_full_wafer_range.match(id)) { // module range check is sufficient
66  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_wafer_range);
67  localMessage(errMsg, __func__, MSG::ERROR);
68  }
69 }
70 
71 void
73  int layer_disk,
74  int phi_module,
75  int eta_module,
76  int side,
77  int strip) const {
78  // Check that id is within allowed range
79 
80  // Fill expanded id
82 
85 
86  if (!m_full_strip_range.match(id)) {
87  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range);
88  localMessage(errMsg, __func__, MSG::ERROR);
89  }
90 }
91 
92 void
94  if (not m_hasRows){
96  expId[m_indices[LAYER_DISK]],
97  expId[m_indices[PHI]],
98  expId[m_indices[ETA]],
99  expId[m_indices[SIDE]],
100  expId[m_indices[STRIP]]);
101  } else {
103  expId[m_indices[LAYER_DISK]],
104  expId[m_indices[PHI]],
105  expId[m_indices[ETA]],
106  expId[m_indices[SIDE]],
107  expId[m_indices[ROW]],
108  expId[m_indices[STRIP]]);
109  }
110 }
111 
112 void
114  int layer_disk,
115  int phi_module,
116  int eta_module,
117  int side,
118  int row,
119  int strip) const {
120  // Check that id is within allowed range
121 
122  // Fill expanded id
124 
126  << barrel_ec << layer_disk << phi_module << eta_module << side << row << strip;
127 
128 
129  if (!m_full_strip_range.match(id)) {
130  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range);
131  localMessage(errMsg, __func__, MSG::ERROR);
132  }
133 }
134 
135 int
136 SCT_ID::getMaxField(const Identifier & id, const ExpandedIdIndices &fieldIndx) const{
137  // get max from dictionary
138  ExpandedIdentifier expId;
139  int result(-999);
140  const IdContext context = (fieldIndx == LAYER_DISK) ? wafer_context():IdContext(expId, 0, m_indices[LAYER_DISK]) ;
141  get_expanded_id(id, expId, &context);
142  const auto & useRange = (fieldIndx == STRIP)? m_full_strip_range : m_full_wafer_range;
143  for (unsigned int i = 0; i != useRange.size(); ++i) {
144  const Range& range = useRange[i];
145  if (range.match(expId)) {
146  const Range::field& thisField = range[m_indices[fieldIndx]];
147  if (not thisField.empty()) {
148  auto thisMax= thisField.get_maximum();
149  if (fieldIndx == ETA or fieldIndx == STRIP){
150  result = std::max(result, thisMax);
151  } else {
152  return thisMax;
153  }
154  }
155  }
156  }
157  return result; // default
158 }
159 
160 int
162  return getMaxField(id, LAYER_DISK);
163 }
164 
165 int
167  // get min from dictionary - note that eta modules skip 0 for
168  // sct, so we must search for absolute min
169  ExpandedIdentifier expId;
170  IdContext layer_context(expId, 0, m_indices[LAYER_DISK]);
171  get_expanded_id(id, expId, &layer_context);
172  int result = -999;
173  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
174  const Range& range = m_full_wafer_range[i];
175  if (range.match(expId)) {
176  const Range::field& eta_field = range[m_indices[ETA]];
177  if (not eta_field.empty()) {
178  int etamin = eta_field.get_minimum();
179  if (-999 == result) {
180  result = etamin;
181  } else {
182  if (etamin < result) result = etamin;
183  }
184  }
185  }
186  }
187  return(result);
188 }
189 
190 int
192  return getMaxField(id, ETA);
193 }
194 
195 int
196 SCT_ID::strip_max(const Identifier& id) const {
197  return getMaxField(id, STRIP);
198 }
199 
200 bool
202  // get min from dictionary
203  return(eta_module(id) == eta_module_min(id));
204 }
205 
206 bool
208  // get max from dictionary
209  return(eta_module(id) == eta_module_max(id));
210 }
211 
212 int
214  return getMaxField(id, PHI);
215 }
216 
217 bool
219  // get max from dictionary
220  return(phi_module(id) == phi_module_max(id));
221 }
222 
223 int
225  localMessage("", __func__, MSG::INFO);
226 
227  // Check whether this helper should be reinitialized
228  if (!reinitialize(dict_mgr)) {
229  localMessage("Request to reinitialize not satisfied - tags have not changed", __func__, MSG::INFO);
230  return(0);
231  } else {
232  localMessage("(Re)initialize", __func__, MSG::DEBUG);
233  }
234 
235  // init base object
236  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return(2);
237 
238  // Register version of InnerDetector dictionary
239  if (register_dict_tag(dict_mgr, "InnerDetector")) return(1);
240 
241  m_dict = dict_mgr.find_dictionary("InnerDetector");
242  if (!m_dict) {
243  localMessage( " - cannot access InnerDetector dictionary ",__func__, MSG::ERROR);
244  return 1;
245  }
246 
247  // Initialize the field indices
248  if (initLevelsFromDict()) return(1);
249 
250  //
251  // Set barrel field for testing is_barrel
252  //
253  int barrel_value;
254  if (m_dict->get_label_value("barrel_endcap", "barrel", barrel_value)) {
255  const std::string errMsg = "Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary " + m_dict->m_name;
256  localMessage(errMsg, __func__, MSG::ERROR);
257  return(1);
258  }
260  m_barrel_field.add_value(barrel_value);
261  std::string dbgMsg = "Set barrel field values: " + std::string(m_barrel_field);
262  localMessage(dbgMsg, __func__, MSG::DEBUG);
263 
264 
265 
266  //
267  // Build multirange for the valid set of identifiers
268  //
269 
270 
271  // Find value for the field InnerDetector
272  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
273  int inDetField = -1;
274  if (atlasDict->get_label_value("subdet", "InnerDetector", inDetField)) {
275  const std::string errMsg = "Could not get value for label 'InnerDetector' of field 'subdet' in dictionary " + atlasDict->m_name;
276  localMessage(errMsg, __func__, MSG::ERROR);
277  return(1);
278  }
279 
280  // Find value for the field SCT
281  int sctField = -1;
282  if (m_dict->get_label_value("part", "SCT", sctField)) {
283  const std::string errMsg= "Could not get value for label 'SCT' of field 'part' in dictionary " + m_dict->m_name;
284  localMessage(errMsg, __func__, MSG::ERROR);
285  return(1);
286  }
287  dbgMsg = "Found field values: SCT " + std::to_string(sctField);
288  localMessage(dbgMsg, __func__, MSG::DEBUG);
289 
290  // Set up id for region and range prefix
292  region_id.add(inDetField);
293  region_id.add(sctField);
294  Range prefix;
297 
298  // Setup the hash tables
299  if (init_hashes()) return(1);
300 
301  // Setup hash tables for finding neighbors
302  if (init_neighbors()) return(1);
303  dbgMsg = "Wafer range -> " + std::string( m_full_wafer_range) + "\n";
304  dbgMsg += "Strip range -> " + std::string(m_full_strip_range);
305  localMessage(dbgMsg, __func__, MSG::DEBUG);
308  [this](const IdentifierHash & id){return this->get_other_side(id);},
309  [this](const IdentifierHash & id){return this->get_prev_in_eta(id);},
310  [this](const IdentifierHash & id){return this->get_next_in_eta(id);},
311  [this](const IdentifierHash & id){return this->get_prev_in_phi(id);},
312  [this](const IdentifierHash & id){return this->get_next_in_phi(id);}
313  };
314  return 0;
315 }
316 
317 int
319  //
320  // create a vector(s) to retrieve the hashes for compact ids. For
321  // the moment, we implement a hash for wafers but NOT for strips
322  // (too many)
323  //
324 
325  // wafer hash
328  unsigned int nids = 0;
329  std::set<Identifier> ids;
330  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
331  const Range& range = m_full_wafer_range[i];
333  for (const auto & exp_id : rit) {
334  Identifier id = wafer_id(exp_id);
335  if (!(ids.insert(id)).second) {
336  const std::string errMsg = "Error: duplicated id for wafer id. nid " + std::to_string(nids) + " compact id " + id.getString() + " id " + std::string(exp_id);
337  localMessage(errMsg, __func__, MSG::ERROR);
338  return(1);
339  }
340  nids++;
341  }
342  }
343  if (ids.size() != m_wafer_hash_max) {
344  const std::string errMsg = "Error: set size NOT EQUAL to hash max. size " + std::to_string(ids.size()) + " hash max " +std::to_string( m_wafer_hash_max);
345  localMessage(errMsg, __func__, MSG::ERROR);
346  return(1);
347  }
348 
349  nids = 0;
350  std::set<Identifier>::const_iterator first = ids.begin();
351  std::set<Identifier>::const_iterator last = ids.end();
352  for (; first != last && nids < m_wafer_vec.size(); ++first) {
353  m_wafer_vec[nids] = (*first);
354  nids++;
355  }
356 
357  // strip hash - we do not keep a vec for the strips - too large
359 
360  return(0);
361 }
362 
366 }
371 }
376 }
381 }
385  if (m_dict) {
386  // get max from dictionary
387  Identifier id;
388  const IdContext & wafer_context1 = wafer_context();
389  if (!get_id(hashId, id, &wafer_context1)) {
390  return( side(id) ? hashId - 1 : hashId + 1);
391  }
392  }
393  return IdentifierHash{};
394 }
395 //
396 const std::array<std::function< IdentifierHash(const IdentifierHash &)>, 5 >&
398  return m_neighboursByEta;
399 }
400 
401 
402 int
404  const auto result = nextInSequence(id, m_prev_phi_wafer_vec);
405  if (result.is_valid()) {
406  prev = result;
407  return 0;
408  }
409  return 1;
410 }
411 
412 int
414  const auto result = nextInSequence(id, m_next_phi_wafer_vec);
415  if (result.is_valid()) {
416  next = result;
417  return 0;
418  }
419  return 1;
420 }
421 
422 int
424  const auto result = nextInSequence(id, m_prev_eta_wafer_vec);
425  if (result.is_valid()) {
426  prev = result;
427  return 0;
428  }
429  return 1;
430 }
431 
432 int
434  const auto result = nextInSequence(id, m_next_eta_wafer_vec);
435  if (result.is_valid()) {
436  next = result;
437  return 0;
438  }
439  return 1;
440 }
441 
442 int
444  if (m_dict) {
445  // get max from dictionary
446  Identifier id;
447  IdContext wafer_context1 = wafer_context();
448  if (!get_id(hashId, id, &wafer_context1)) {
449  other = side(id) ? hashId - 1 : hashId + 1;
450  return(0);
451  }
452  }
453  return(1);
454 }
455 
456  Identifier
457  SCT_ID::wafer_id(const ExpandedIdentifier & expId) const{
458  return wafer_id(expId[m_indices[BARREL_EC]],
459  expId[m_indices[LAYER_DISK]],
460  expId[m_indices[PHI]],
461  expId[m_indices[ETA]],
462  expId[m_indices[SIDE]]);
463  }
464 
465 int
467  //
468  // create a vector(s) to retrieve the hashes for compact ids for
469  // wafer neighbors.
470  //
471 
472  localMessage("", __func__, MSG::DEBUG);
473  const IdentifierHash invalidHash;
474  m_prev_phi_wafer_vec.resize(m_wafer_hash_max, invalidHash);
475  m_next_phi_wafer_vec.resize(m_wafer_hash_max, invalidHash);
476  m_prev_eta_wafer_vec.resize(m_wafer_hash_max, invalidHash);
477  m_next_eta_wafer_vec.resize(m_wafer_hash_max, invalidHash);
478 
479  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
480  const Range& range = m_full_wafer_range[i];
481  const Range::field& phi_field = range[m_indices[PHI]];
482  const Range::field& eta_field = range[m_indices[ETA]];
484  for (const auto & exp_id : rit) {
489  bool pphi = phi_field.get_previous(exp_id[m_indices[PHI]], previous_phi);
490  bool nphi = phi_field.get_next(exp_id[m_indices[PHI]], next_phi);
491  bool peta = eta_field.get_previous(exp_id[m_indices[ETA]], previous_eta);
492  bool neta = eta_field.get_next(exp_id[m_indices[ETA]], next_eta);
493 
494  IdContext wcontext = wafer_context();
495 
496  // First get primary hash id
497  IdentifierHash hash_id;
498  Identifier id = wafer_id(exp_id);
499  if (get_hash(id, hash_id, &wcontext)) {
500  const std::string errMsg = "- unable to get hash, exp/compact " + show_to_string(id, &wcontext) + std::string(m_full_wafer_range);
501  localMessage(errMsg, __func__, MSG::ERROR);
502  return(1);
503  }
504 
505  // index for the subsequent arrays
506  unsigned short index = hash_id;
507  assert(hash_id < m_prev_phi_wafer_vec.size());
508  assert(hash_id < m_next_phi_wafer_vec.size());
509  assert(hash_id < m_prev_eta_wafer_vec.size());
510  assert(hash_id < m_next_eta_wafer_vec.size());
511 
512  if (pphi) {
513  // Get previous phi hash id
514  ExpandedIdentifier expId = exp_id;
515  expId[m_indices[PHI]] = previous_phi;
516  Identifier id = wafer_id(expId);
517  if (get_hash(id, hash_id, &wcontext)) {
518  const std::string errMsg = "- unable to get previous phi hash, exp/compact " + id.getString();
519  localMessage(errMsg, __func__, MSG::ERROR);
520  return(1);
521  }
522  m_prev_phi_wafer_vec[index] = hash_id;
523  }
524 
525  if (nphi) {
526  // Get next phi hash id
527  ExpandedIdentifier expId = exp_id;
528  expId[m_indices[PHI]] = next_phi;
529  Identifier id = wafer_id(expId);
530  if (get_hash(id, hash_id, &wcontext)) {
531  const std::string errMsg = "- unable to get next phi hash, exp/compact " + id.getString();
532  localMessage(errMsg, __func__, MSG::ERROR);
533  return(1);
534  }
535  m_next_phi_wafer_vec[index] = hash_id;
536  }
537 
538  if (peta) {
539  // Get previous eta hash id
540  ExpandedIdentifier expId = exp_id;
541  expId[m_indices[ETA]] = previous_eta;
542  Identifier id = wafer_id(expId);
543  if (get_hash(id, hash_id, &wcontext)) {
544  const std::string errMsg = "- unable to get previous eta hash, exp/compact " + id.getString();
545  localMessage(errMsg, __func__, MSG::ERROR);
546  return(1);
547  }
548  m_prev_eta_wafer_vec[index] = hash_id;
549  }
550 
551  if (neta) {
552  // Get next eta hash id
553  ExpandedIdentifier expId = exp_id;
554  expId[m_indices[ETA]] = next_eta;
555  Identifier id = wafer_id(expId);
556  if (get_hash(id, hash_id, &wcontext)) {
557  const std::string errMsg = "- unable to get next eta hash, exp/compact " + id.getString();
558  localMessage(errMsg, __func__, MSG::ERROR);
559  return(1);
560  }
561  m_next_eta_wafer_vec[index] = hash_id;
562  }
563  }
564  }
565  return(0);
566 }
567 
568 int
570  if (!m_dict) {
571  localMessage("- dictionary NOT initialized", __func__, MSG::ERROR);
572  return(1);
573  }
574  // Find out which identifier field corresponds to each level. Use
575  // names to find each field/leve.
576  m_indices.fill(999);
577  m_hasRows = false;
578  // Save index to a SCT region for unpacking
580  id << indet_field_value() << sct_field_value();
581 
582 
584  const std::string errMsg = "- unable to find sct region index: id, reg " + std::string(id) + " " + std::to_string(m_sct_region_index);
585  localMessage(errMsg, __func__, MSG::ERROR);
586  return(1);
587  }
588 
589  auto findField = [this](const std::string &name, const size_t indx){
590  IdDictField* pField = m_dict->find_field(name);
591  if (pField) {
592  m_indices[indx] = pField->m_index;
593  return true;
594  }
595  const auto lvl = (indx == ROW) ? MSG::DEBUG : MSG::ERROR;
596  localMessage("- unable to find '" + name +"' field ", __func__, lvl);
597  return false;
598  };
599 
600  // Find an SCT region
601  if (not findField("subdet", INDET)) return 1;
602  if (not findField("part", SCT)) return 1;
603  if (not findField("barrel_endcap", BARREL_EC)) return 1;
604  if (not findField("layer", LAYER_DISK)) return 1;
605  if (not findField("phi_module", PHI)) return 1;
606  if (not findField("eta_module", ETA)) return 1;
607  if (not findField("side", SIDE)) return 1;
608  m_hasRows = (findField("row", ROW));
609  if (not findField("strip", STRIP)) return 1;
610 
611  // Set the field implementations: for bec, lay/disk, eta/phi mod
612 
613  const IdDictRegion& region = *m_dict->m_regions[m_sct_region_index];
614 
622  if (m_hasRows) {
624  }
626  localMessage("decode index and bit fields for each level: ", __func__, MSG::DEBUG);
627  localMessage("indet " + m_indet_impl.show_to_string(), __func__, MSG::DEBUG);
628  localMessage("sct " + m_sct_impl.show_to_string(), __func__, MSG::DEBUG);
629  localMessage("bec " + m_bec_impl.show_to_string(), __func__, MSG::DEBUG);
630  localMessage("lay_disk " + m_lay_disk_impl.show_to_string(), __func__, MSG::DEBUG);
631  localMessage("phi_mod " + m_phi_mod_impl.show_to_string(), __func__, MSG::DEBUG);
632  localMessage("eta_mod " + m_eta_mod_impl.show_to_string(), __func__, MSG::DEBUG);
633  localMessage("side " + m_side_impl.show_to_string(), __func__, MSG::DEBUG);
634  if (m_hasRows) {
635  localMessage("row " + m_row_impl.show_to_string(), __func__, MSG::DEBUG);
636  }
637  localMessage("strip " + m_strip_impl.show_to_string(), __func__, MSG::DEBUG);
638 
639 
640 
641  return(0);
642 }
643 
646  return m_wafer_hash_max;
647 }
648 
651  return m_strip_hash_max;
652 }
653 
655  return(m_wafer_vec.begin());
656 }
657 
659  return(m_wafer_vec.end());
660 }
661 
664 }
665 
668 }
669 
670 // From hash get Identifier
671 int
673  Identifier& id,
674  const IdContext* context) const {
675  int result = 1;
676  id.clear();
677  size_t begin = (context) ? context->begin_index() : 0;
678  // cannot get hash if end is 0:
679  size_t end = (context) ? context->end_index() : 0;
680  if (0 == begin) {
681  // No hashes yet for ids with prefixes
682  if (m_indices[SIDE] == end) {
683  if (hash_id < m_wafer_vec.size()) {
684  id = m_wafer_vec[hash_id];
685  result = 0;
686  }
687  } else if (m_indices[STRIP] == end) {
688  // Do not know how to calculate strip id from hash yet!!
689  localMessage( "Do not know how to calculate strip id from hash yet!!", __func__, MSG::ERROR );
690  }
691  }
692  return(result);
693 }
694 
695 void
697  ExpandedIdentifier& exp_id,
698  const IdContext* context) const {
699  exp_id.clear();
700  exp_id << indet_field_value()
701  << sct_field_value()
702  << barrel_ec(id)
703  << layer_disk(id)
704  << phi_module(id)
705  << eta_module(id)
706  << side(id);
707  if (!context || context->end_index() == m_indices[STRIP]) {
708  if (m_hasRows) {
709  exp_id << row(id) << strip(id);
710  } else {
711  exp_id << strip(id);
712  }
713  }
714 }
715 
716 int
718  IdentifierHash& hash_id,
719  const IdContext* context) const {
720  // Get the hash code from either a vec (for wafers) or calculate
721  // it (strips). For the former, we convert to compact and call
722  // get_hash again. For the latter, we calculate the hash from the
723  // Identifier.
724 
725  int result = 1;
726 
727  hash_id = 0;
728  size_t begin = (context) ? context->begin_index() : 0;
729  size_t end = (context) ? context->end_index() : 0;
730  if (0 == begin) {
731  // No hashes yet for ids with prefixes
732  if (m_indices[SIDE] == end) {
733  hash_id = wafer_hash(id);
734  if (hash_id.is_valid()) result = 0;
735  } else if (context && context->end_index() == m_indices[STRIP]) {
736  // Must calculate for strip hash
737  ExpandedIdentifier new_id;
738  get_expanded_id(id, new_id);
739  hash_id = m_full_strip_range.cardinalityUpTo(new_id);
740  result = 0;
741  }
742  }
743  return(result);
744 }
745 void
746 SCT_ID::localMessage(const std::string & msgTxt, const std::string &func, const MSG::Level & lvl) const{
747  if (m_msgSvc){
748  MsgStream log(m_msgSvc, "SCT_ID");
749  log << lvl << msgTxt << endmsg;
750  } else {
751  #ifdef NDEBUG
752  if (lvl > MSG::DEBUG) std::cout<<lvl<<"SCT_ID::"<<func<<" "<<msgTxt<<std::endl;
753  #else
754  std::cout<<lvl<<"SCT_ID::"<<func<<" "<<msgTxt<<std::endl;
755  #endif
756  }
757 
758 }
759 
760 //all neighbours: opposite and then eta direction first
761 std::array<IdentifierHash, 5>
763  if (size_type index = idh; index<m_wafer_hash_max) return std::array<IdentifierHash, 5>{
764  get_other_side(idh),
767  };
768  else return invalidHashes;
769 }
770 
771 //all neighbours: opposite and then phi direction first
772 std::array<IdentifierHash, 5>
774  if (size_type index = idh; index<m_wafer_hash_max) return std::array<IdentifierHash, 5>{
775  get_other_side(idh),
778  };
779  else return invalidHashes;
780 }
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictDictionary.cxx:101
SCT_ID::m_full_wafer_range
MultiRange m_full_wafer_range
Definition: SCT_ID.h:361
query_example.row
row
Definition: query_example.py:24
AtlasDetectorID::indet_field_value
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
Definition: AtlasDetectorID.h:611
IdDictField::m_index
size_t m_index
Definition: IdDictField.h:30
ConstRangeIterator
Definition: RangeIterator.h:46
SCT_ID::get_next_in_phi
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
Definition: SCT_ID.cxx:413
SCT_ID::SCT_ID
SCT_ID(void)
Definition: SCT_ID.cxx:40
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:299
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:320
get_generator_info.result
result
Definition: get_generator_info.py:21
SCT_ID::m_eta_mod_impl
IdDictFieldImplementation m_eta_mod_impl
Definition: SCT_ID.h:378
SCT_ID::m_prev_phi_wafer_vec
hash_vec m_prev_phi_wafer_vec
Definition: SCT_ID.h:367
SCT_ID::strip_begin
const_expanded_id_iterator strip_begin(void) const
For strip ids, only expanded id iterators are available.
Definition: SCT_ID.cxx:662
SCT_ID::SIDE
@ SIDE
Definition: SCT_ID.h:310
SCT_ID::get_prev_in_phi
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Definition: SCT_ID.cxx:403
MultiRange::factory_begin
identifier_factory factory_begin()
Definition: MultiRange.cxx:112
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
index
Definition: index.py:1
MultiRange::factory_end
identifier_factory factory_end()
Definition: MultiRange.cxx:124
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:59
SCT_ID::init_hashes
int init_hashes(void)
Definition: SCT_ID.cxx:318
MultiRange::cardinalityUpTo
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
Definition: MultiRange.cxx:88
SCT_ID::strip_end
const_expanded_id_iterator strip_end(void) const
Definition: SCT_ID.cxx:666
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
SCT_ID::LAYER_DISK
@ LAYER_DISK
Definition: SCT_ID.h:310
SCT_ID::m_side_impl
IdDictFieldImplementation m_side_impl
Definition: SCT_ID.h:379
SCT_ID::m_wafer_hash_max
size_type m_wafer_hash_max
Definition: SCT_ID.h:363
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
SCT_ID::m_sct_region_index
size_type m_sct_region_index
Definition: SCT_ID.h:357
SCT_ID::wafer_begin
const_id_iterator wafer_begin(void) const
Iterators over full set of ids. Wafer iterator is sorted.
Definition: SCT_ID.cxx:654
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SCT_ID::ETA
@ ETA
Definition: SCT_ID.h:310
SCT_ID::eta_module_max
int eta_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:191
SCT_ID::STRIP
@ STRIP
Definition: SCT_ID.h:310
IdentifierField::clear
void clear()
Set methods.
Definition: IdentifierField.cxx:224
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
SCT_ID::INDET
@ INDET
Definition: SCT_ID.h:310
SCT_ID::m_prev_eta_wafer_vec
hash_vec m_prev_eta_wafer_vec
Definition: SCT_ID.h:369
SCT_ID::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: SCT_ID.h:73
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
SCT_ID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Initialization from the identifier dictionary.
Definition: SCT_ID.cxx:224
SCT_ID::strip_hash_max
size_type strip_hash_max(void) const
Definition: SCT_ID.cxx:650
SCT_ID::phi_module_max
int phi_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:213
SCT_ID::m_sct_impl
IdDictFieldImplementation m_sct_impl
Definition: SCT_ID.h:374
SCT_ID::get_expanded_id
void get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context=0) const
Create expanded id from compact id (return == 0 for OK)
Definition: SCT_ID.cxx:696
SCT_ID::m_indet_impl
IdDictFieldImplementation m_indet_impl
Definition: SCT_ID.h:373
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
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SCT_ID::m_wafer_vec
id_vec m_wafer_vec
Definition: SCT_ID.h:366
SCT_ID::m_neighboursByEta
std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > m_neighboursByEta
Definition: SCT_ID.h:311
SCT_ID::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override final
Create compact id from hash id (return == 0 for OK)
Definition: SCT_ID.cxx:672
TRT::Hit::side
@ side
Definition: HitInfo.h:83
IdDictDefs.h
SCT_ID::m_hasRows
bool m_hasRows
Definition: SCT_ID.h:371
SCT_ID::neighbour_calls_by_eta
const std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > & neighbour_calls_by_eta() const
return functions to give neighbours in order: opposite, eta minus, eta plus, phi minus,...
Definition: SCT_ID.cxx:397
AtlasDetectorID::size_type
Identifier::size_type size_type
Definition: AtlasDetectorID.h:384
SCT_ID::m_next_eta_wafer_vec
hash_vec m_next_eta_wafer_vec
Definition: SCT_ID.h:370
SCT_ID::m_full_strip_range
MultiRange m_full_strip_range
Definition: SCT_ID.h:362
IdDictMgr
Definition: IdDictMgr.h:14
SCT_ID::m_strip_impl
IdDictFieldImplementation m_strip_impl
Definition: SCT_ID.h:381
SCT_ID::m_barrel_field
Range::field m_barrel_field
Definition: SCT_ID.h:365
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
SCT_ID::m_next_phi_wafer_vec
hash_vec m_next_phi_wafer_vec
Definition: SCT_ID.h:368
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
SCT_ID::initLevelsFromDict
int initLevelsFromDict(void)
Definition: SCT_ID.cxx:569
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
IdentifierField::empty
bool empty() const
Definition: IdentifierField.h:114
SCT_ID::m_row_impl
IdDictFieldImplementation m_row_impl
Definition: SCT_ID.h:380
SCT_ID::m_phi_mod_impl
IdDictFieldImplementation m_phi_mod_impl
Definition: SCT_ID.h:377
MultiRange::const_identifier_factory
Definition: MultiRange.h:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_ID::SCT
@ SCT
Definition: SCT_ID.h:310
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
SCT_ID::get_hash
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override final
Create hash id from compact id (return == 0 for OK)
Definition: SCT_ID.cxx:717
SCT_ID::size_type
Identifier::size_type size_type
Definition: SCT_ID.h:72
SCT_ID::m_lay_disk_impl
IdDictFieldImplementation m_lay_disk_impl
Definition: SCT_ID.h:376
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDictionary.h:235
SCT_ID::m_bec_impl
IdDictFieldImplementation m_bec_impl
Definition: SCT_ID.h:375
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
SCT_ID::PHI
@ PHI
Definition: SCT_ID.h:310
IdentifierField::get_next
bool get_next(element_type current, element_type &next) const
Definition: IdentifierField.cxx:149
SCT_ID::wafer_context
IdContext wafer_context(void) const
Definition: SCT_ID.h:705
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
SCT_ID::get_other_side
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
Definition: SCT_ID.cxx:443
SCT_ID::nextInSequence
IdentifierHash nextInSequence(const IdentifierHash &id, const hash_vec &vectorOfHashes) const
Definition: SCT_ID.h:769
SCT_ID::neighbours_by_phi
std::array< IdentifierHash, 5 > neighbours_by_phi(const IdentifierHash &idh) const
Definition: SCT_ID.cxx:773
IdentifierHash::is_valid
bool is_valid() const
Check if id is in a valid state.
SCT
Definition: SCT_ChipUtils.h:14
AtlasDetectorID::sct_field_value
int sct_field_value() const
Definition: AtlasDetectorID.h:629
SCT_ID::ExpandedIdIndices
ExpandedIdIndices
Definition: SCT_ID.h:310
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
lumiFormat.array
array
Definition: lumiFormat.py:91
SCT_ID::eta_module_min
int eta_module_min(const Identifier &id) const
Definition: SCT_ID.cxx:166
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:73
SCT_ID::m_dict
const IdDictDictionary * m_dict
Definition: SCT_ID.h:360
SCT_ID::neighbours_by_eta
std::array< IdentifierHash, 5 > neighbours_by_eta(const IdentifierHash &idh) const
Definition: SCT_ID.cxx:762
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: SCT_ID.cxx:645
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
IdentifierHash.h
RangeIterator.h
SCT_ID::localMessage
void localMessage(const std::string &msgTxt, const std::string &func, const MSG::Level &lvl) const
Definition: SCT_ID.cxx:746
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
SCT_ID::BARREL_EC
@ BARREL_EC
Definition: SCT_ID.h:310
operator<<
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
Definition: TestGaudiProperty.cxx:69
SCT_ID::wafer_id_checks
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
Definition: SCT_ID.cxx:52
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
SCT_ID::layer_disk_max
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (-999 == failure)
Definition: SCT_ID.cxx:161
SCT_ID::is_eta_module_min
bool is_eta_module_min(const Identifier &id) const
For the barrel.
Definition: SCT_ID.cxx:201
SCT_ID::get_prev_in_eta
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
Definition: SCT_ID.cxx:423
IdDictDictionary
Definition: IdDictDictionary.h:30
SCT_ID::get_next_in_eta
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
Definition: SCT_ID.cxx:433
SCT_ID::is_eta_module_max
bool is_eta_module_max(const Identifier &id) const
For the barrel.
Definition: SCT_ID.cxx:207
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
DeMoScan.index
string index
Definition: DeMoScan.py:364
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
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
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
SCT_ID::getMaxField
int getMaxField(const Identifier &id, const ExpandedIdIndices &fieldIndx) const
Definition: SCT_ID.cxx:136
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
SCT_ID::strip_max
int strip_max(const Identifier &id) const
Definition: SCT_ID.cxx:196
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
ExpandedIdentifier::clear
void clear()
Erase all fields.
SCT_ID::m_strip_hash_max
size_type m_strip_hash_max
Definition: SCT_ID.h:364
IdentifierField::get_previous
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
Definition: IdentifierField.cxx:106
SCT_ID::m_indices
std::array< size_t, NUM_INDICES > m_indices
Definition: SCT_ID.h:359
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
SCT_ID::ROW
@ ROW
Definition: SCT_ID.h:310
SCT_ID::wafer_end
const_id_iterator wafer_end(void) const
Definition: SCT_ID.cxx:658
SCT_ID::is_phi_module_max
bool is_phi_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:218
SCT_ID::init_neighbors
int init_neighbors(void)
Definition: SCT_ID.cxx:466
SIDE
SIDE
Definition: CellClusterLinkTool.h:52
IdDictField
Definition: IdDictField.h:15
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: MultiRange.cxx:82
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
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
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
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
IdentifierField::add_value
void add_value(element_type value)
Definition: IdentifierField.cxx:250
SCT_ID::strip_id_checks
void strip_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
Definition: SCT_ID.cxx:72
Identifier
Definition: IdentifierFieldParser.cxx:14