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  const IdentifierHash invalidHash;
23  const std::array<IdentifierHash, 5> invalidHashes{invalidHash, invalidHash, invalidHash,
24  invalidHash, invalidHash};
25  const std::function< IdentifierHash(const IdentifierHash &)>
26  invalidHashFunc = ([](const IdentifierHash &){return IdentifierHash{};});
27 }
28 
29 
30 
32  :
33  m_neighboursByEta{invalidHashFunc, invalidHashFunc, invalidHashFunc , invalidHashFunc, invalidHashFunc},
34  m_dict(nullptr),
35  m_wafer_hash_max(0),
36  m_strip_hash_max(0),
37  m_barrel_field(0),
38  m_hasRows(false) {
39 
40 }
41 
42 void
44  int layer_disk,
45  int phi_module,
46  int eta_module,
47  int side) const {
48  // Check that id is within allowed range
49 
50  // Fill expanded id
52 
55 
56  if (!m_full_wafer_range.match(id)) { // module range check is sufficient
57  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_wafer_range);
58  localMessage(errMsg, __func__, MSG::ERROR);
59  }
60 }
61 
62 void
64  int layer_disk,
65  int phi_module,
66  int eta_module,
67  int side,
68  int strip) const {
69  // Check that id is within allowed range
70 
71  // Fill expanded id
73 
76 
77  if (!m_full_strip_range.match(id)) {
78  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range);
79  localMessage(errMsg, __func__, MSG::ERROR);
80  }
81 }
82 
83 void
85  if (not m_hasRows){
87  expId[m_indices[LAYER_DISK]],
88  expId[m_indices[PHI]],
89  expId[m_indices[ETA]],
90  expId[m_indices[SIDE]],
91  expId[m_indices[STRIP]]);
92  } else {
94  expId[m_indices[LAYER_DISK]],
95  expId[m_indices[PHI]],
96  expId[m_indices[ETA]],
97  expId[m_indices[SIDE]],
98  expId[m_indices[ROW]],
99  expId[m_indices[STRIP]]);
100  }
101 }
102 
103 void
105  int layer_disk,
106  int phi_module,
107  int eta_module,
108  int side,
109  int row,
110  int strip) const {
111  // Check that id is within allowed range
112 
113  // Fill expanded id
115 
117  << barrel_ec << layer_disk << phi_module << eta_module << side << row << strip;
118 
119 
120  if (!m_full_strip_range.match(id)) {
121  std::string errMsg = " result is NOT ok. ID, range " + std::string(id)+std::string(m_full_strip_range);
122  localMessage(errMsg, __func__, MSG::ERROR);
123  }
124 }
125 
126 int
127 SCT_ID::getMaxField(const Identifier & id, const ExpandedIdIndices &fieldIndx) const{
128  // get max from dictionary
129  ExpandedIdentifier expId;
130  int result(-999);
131  const IdContext context = (fieldIndx == LAYER_DISK) ? wafer_context():IdContext(expId, 0, m_indices[LAYER_DISK]) ;
132  get_expanded_id(id, expId, &context);
133  const auto & useRange = (fieldIndx == STRIP)? m_full_strip_range : m_full_wafer_range;
134  for (unsigned int i = 0; i != useRange.size(); ++i) {
135  const Range& range = useRange[i];
136  if (range.match(expId)) {
137  const Range::field& thisField = range[m_indices[fieldIndx]];
138  if (not thisField.empty()) {
139  auto thisMax= thisField.get_maximum();
140  if (fieldIndx == ETA or fieldIndx == STRIP){
141  result = std::max(result, thisMax);
142  } else {
143  return thisMax;
144  }
145  }
146  }
147  }
148  return result; // default
149 }
150 
151 int
153  return getMaxField(id, LAYER_DISK);
154 }
155 
156 int
158  // get min from dictionary - note that eta modules skip 0 for
159  // sct, so we must search for absolute min
160  ExpandedIdentifier expId;
161  IdContext layer_context(expId, 0, m_indices[LAYER_DISK]);
162  get_expanded_id(id, expId, &layer_context);
163  int result = -999;
164  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
165  const Range& range = m_full_wafer_range[i];
166  if (range.match(expId)) {
167  const Range::field& eta_field = range[m_indices[ETA]];
168  if (not eta_field.empty()) {
169  int etamin = eta_field.get_minimum();
170  if (-999 == result) {
171  result = etamin;
172  } else {
173  if (etamin < result) result = etamin;
174  }
175  }
176  }
177  }
178  return(result);
179 }
180 
181 int
183  return getMaxField(id, ETA);
184 }
185 
186 int
187 SCT_ID::strip_max(const Identifier& id) const {
188  return getMaxField(id, STRIP);
189 }
190 
191 bool
193  // get min from dictionary
194  return(eta_module(id) == eta_module_min(id));
195 }
196 
197 bool
199  // get max from dictionary
200  return(eta_module(id) == eta_module_max(id));
201 }
202 
203 int
205  return getMaxField(id, PHI);
206 }
207 
208 bool
210  // get max from dictionary
211  return(phi_module(id) == phi_module_max(id));
212 }
213 
214 int
216  localMessage("", __func__, MSG::INFO);
217 
218  // Check whether this helper should be reinitialized
219  if (!reinitialize(dict_mgr)) {
220  localMessage("Request to reinitialize not satisfied - tags have not changed", __func__, MSG::INFO);
221  return(0);
222  } else {
223  localMessage("(Re)initialize", __func__, MSG::DEBUG);
224  }
225 
226  // init base object
227  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return(2);
228 
229  // Register version of InnerDetector dictionary
230  if (register_dict_tag(dict_mgr, "InnerDetector")) return(1);
231 
232  m_dict = dict_mgr.find_dictionary("InnerDetector");
233  if (!m_dict) {
234  localMessage( " - cannot access InnerDetector dictionary ",__func__, MSG::ERROR);
235  return 1;
236  }
237 
238  // Initialize the field indices
239  if (initLevelsFromDict()) return(1);
240 
241  //
242  // Set barrel field for testing is_barrel
243  //
244  int barrel_value;
245  if (m_dict->get_label_value("barrel_endcap", "barrel", barrel_value)) {
246  const std::string errMsg = "Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary " + m_dict->m_name;
247  localMessage(errMsg, __func__, MSG::ERROR);
248  return(1);
249  }
251  m_barrel_field.add_value(barrel_value);
252  std::string dbgMsg = "Set barrel field values: " + std::string(m_barrel_field);
253  localMessage(dbgMsg, __func__, MSG::DEBUG);
254 
255 
256 
257  //
258  // Build multirange for the valid set of identifiers
259  //
260 
261 
262  // Find value for the field InnerDetector
263  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
264  int inDetField = -1;
265  if (atlasDict->get_label_value("subdet", "InnerDetector", inDetField)) {
266  const std::string errMsg = "Could not get value for label 'InnerDetector' of field 'subdet' in dictionary " + atlasDict->m_name;
267  localMessage(errMsg, __func__, MSG::ERROR);
268  return(1);
269  }
270 
271  // Find value for the field SCT
272  int sctField = -1;
273  if (m_dict->get_label_value("part", "SCT", sctField)) {
274  const std::string errMsg= "Could not get value for label 'SCT' of field 'part' in dictionary " + m_dict->m_name;
275  localMessage(errMsg, __func__, MSG::ERROR);
276  return(1);
277  }
278  dbgMsg = "Found field values: SCT " + std::to_string(sctField);
279  localMessage(dbgMsg, __func__, MSG::DEBUG);
280 
281  // Set up id for region and range prefix
283  region_id.add(inDetField);
284  region_id.add(sctField);
285  Range prefix;
288 
289  // Setup the hash tables
290  if (init_hashes()) return(1);
291 
292  // Setup hash tables for finding neighbors
293  if (init_neighbors()) return(1);
294  dbgMsg = "Wafer range -> " + std::string( m_full_wafer_range) + "\n";
295  dbgMsg += "Strip range -> " + std::string(m_full_strip_range);
296  localMessage(dbgMsg, __func__, MSG::DEBUG);
299  [this](const IdentifierHash & id){return this->get_other_side(id);},
300  [this](const IdentifierHash & id){return this->get_prev_in_eta(id);},
301  [this](const IdentifierHash & id){return this->get_next_in_eta(id);},
302  [this](const IdentifierHash & id){return this->get_prev_in_phi(id);},
303  [this](const IdentifierHash & id){return this->get_next_in_phi(id);}
304  };
305  return 0;
306 }
307 
308 int
310  //
311  // create a vector(s) to retrieve the hashes for compact ids. For
312  // the moment, we implement a hash for wafers but NOT for strips
313  // (too many)
314  //
315 
316  // wafer hash
319  unsigned int nids = 0;
320  std::set<Identifier> ids;
321  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
322  const Range& range = m_full_wafer_range[i];
324  for (const auto & exp_id : rit) {
325  Identifier id = wafer_id(exp_id);
326  if (!(ids.insert(id)).second) {
327  const std::string errMsg = "Error: duplicated id for wafer id. nid " + std::to_string(nids) + " compact id " + id.getString() + " id " + std::string(exp_id);
328  localMessage(errMsg, __func__, MSG::ERROR);
329  return(1);
330  }
331  nids++;
332  }
333  }
334  if (ids.size() != m_wafer_hash_max) {
335  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);
336  localMessage(errMsg, __func__, MSG::ERROR);
337  return(1);
338  }
339 
340  nids = 0;
341  std::set<Identifier>::const_iterator first = ids.begin();
342  std::set<Identifier>::const_iterator last = ids.end();
343  for (; first != last && nids < m_wafer_vec.size(); ++first) {
344  m_wafer_vec[nids] = (*first);
345  nids++;
346  }
347 
348  // strip hash - we do not keep a vec for the strips - too large
350 
351  return(0);
352 }
353 
357 }
362 }
367 }
372 }
376  if (m_dict) {
377  // get max from dictionary
378  Identifier id;
379  const IdContext & wafer_context1 = wafer_context();
380  if (!get_id(hashId, id, &wafer_context1)) {
381  return( side(id) ? hashId - 1 : hashId + 1);
382  }
383  }
384  return IdentifierHash{};
385 }
386 //
387 const std::array<std::function< IdentifierHash(const IdentifierHash &)>, 5 >&
389  return m_neighboursByEta;
390 }
391 
392 
393 int
395  const auto result = nextInSequence(id, m_prev_phi_wafer_vec);
396  if (result.is_valid()) {
397  prev = result;
398  return 0;
399  }
400  return 1;
401 }
402 
403 int
405  const auto result = nextInSequence(id, m_next_phi_wafer_vec);
406  if (result.is_valid()) {
407  next = result;
408  return 0;
409  }
410  return 1;
411 }
412 
413 int
415  const auto result = nextInSequence(id, m_prev_eta_wafer_vec);
416  if (result.is_valid()) {
417  prev = result;
418  return 0;
419  }
420  return 1;
421 }
422 
423 int
425  const auto result = nextInSequence(id, m_next_eta_wafer_vec);
426  if (result.is_valid()) {
427  next = result;
428  return 0;
429  }
430  return 1;
431 }
432 
433 int
435  if (m_dict) {
436  // get max from dictionary
437  Identifier id;
438  IdContext wafer_context1 = wafer_context();
439  if (!get_id(hashId, id, &wafer_context1)) {
440  other = side(id) ? hashId - 1 : hashId + 1;
441  return(0);
442  }
443  }
444  return(1);
445 }
446 
447  Identifier
448  SCT_ID::wafer_id(const ExpandedIdentifier & expId) const{
449  return wafer_id(expId[m_indices[BARREL_EC]],
450  expId[m_indices[LAYER_DISK]],
451  expId[m_indices[PHI]],
452  expId[m_indices[ETA]],
453  expId[m_indices[SIDE]]);
454  }
455 
456 int
458  //
459  // create a vector(s) to retrieve the hashes for compact ids for
460  // wafer neighbors.
461  //
462 
463  localMessage("", __func__, MSG::DEBUG);
464  const IdentifierHash invalidHash;
465  m_prev_phi_wafer_vec.resize(m_wafer_hash_max, invalidHash);
466  m_next_phi_wafer_vec.resize(m_wafer_hash_max, invalidHash);
467  m_prev_eta_wafer_vec.resize(m_wafer_hash_max, invalidHash);
468  m_next_eta_wafer_vec.resize(m_wafer_hash_max, invalidHash);
469 
470  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
471  const Range& range = m_full_wafer_range[i];
472  const Range::field& phi_field = range[m_indices[PHI]];
473  const Range::field& eta_field = range[m_indices[ETA]];
475  for (const auto & exp_id : rit) {
480  bool pphi = phi_field.get_previous(exp_id[m_indices[PHI]], previous_phi);
481  bool nphi = phi_field.get_next(exp_id[m_indices[PHI]], next_phi);
482  bool peta = eta_field.get_previous(exp_id[m_indices[ETA]], previous_eta);
483  bool neta = eta_field.get_next(exp_id[m_indices[ETA]], next_eta);
484 
485  IdContext wcontext = wafer_context();
486 
487  // First get primary hash id
488  IdentifierHash hash_id;
489  Identifier id = wafer_id(exp_id);
490  if (get_hash(id, hash_id, &wcontext)) {
491  const std::string errMsg = "- unable to get hash, exp/compact " + show_to_string(id, &wcontext) + std::string(m_full_wafer_range);
492  localMessage(errMsg, __func__, MSG::ERROR);
493  return(1);
494  }
495 
496  // index for the subsequent arrays
497  unsigned short index = hash_id;
498  assert(hash_id < m_prev_phi_wafer_vec.size());
499  assert(hash_id < m_next_phi_wafer_vec.size());
500  assert(hash_id < m_prev_eta_wafer_vec.size());
501  assert(hash_id < m_next_eta_wafer_vec.size());
502 
503  if (pphi) {
504  // Get previous phi hash id
505  ExpandedIdentifier expId = exp_id;
506  expId[m_indices[PHI]] = previous_phi;
507  Identifier id = wafer_id(expId);
508  if (get_hash(id, hash_id, &wcontext)) {
509  const std::string errMsg = "- unable to get previous phi hash, exp/compact " + id.getString();
510  localMessage(errMsg, __func__, MSG::ERROR);
511  return(1);
512  }
513  m_prev_phi_wafer_vec[index] = hash_id;
514  }
515 
516  if (nphi) {
517  // Get next phi hash id
518  ExpandedIdentifier expId = exp_id;
519  expId[m_indices[PHI]] = next_phi;
520  Identifier id = wafer_id(expId);
521  if (get_hash(id, hash_id, &wcontext)) {
522  const std::string errMsg = "- unable to get next phi hash, exp/compact " + id.getString();
523  localMessage(errMsg, __func__, MSG::ERROR);
524  return(1);
525  }
526  m_next_phi_wafer_vec[index] = hash_id;
527  }
528 
529  if (peta) {
530  // Get previous eta hash id
531  ExpandedIdentifier expId = exp_id;
532  expId[m_indices[ETA]] = previous_eta;
533  Identifier id = wafer_id(expId);
534  if (get_hash(id, hash_id, &wcontext)) {
535  const std::string errMsg = "- unable to get previous eta hash, exp/compact " + id.getString();
536  localMessage(errMsg, __func__, MSG::ERROR);
537  return(1);
538  }
539  m_prev_eta_wafer_vec[index] = hash_id;
540  }
541 
542  if (neta) {
543  // Get next eta hash id
544  ExpandedIdentifier expId = exp_id;
545  expId[m_indices[ETA]] = next_eta;
546  Identifier id = wafer_id(expId);
547  if (get_hash(id, hash_id, &wcontext)) {
548  const std::string errMsg = "- unable to get next eta hash, exp/compact " + id.getString();
549  localMessage(errMsg, __func__, MSG::ERROR);
550  return(1);
551  }
552  m_next_eta_wafer_vec[index] = hash_id;
553  }
554  }
555  }
556  return(0);
557 }
558 
559 int
561  if (!m_dict) {
562  localMessage("- dictionary NOT initialized", __func__, MSG::ERROR);
563  return(1);
564  }
565  // Find out which identifier field corresponds to each level. Use
566  // names to find each field/leve.
567  m_indices.fill(999);
568  m_hasRows = false;
569  // Save index to a SCT region for unpacking
571  id << indet_field_value() << sct_field_value();
572 
573 
575  const std::string errMsg = "- unable to find sct region index: id, reg " + std::string(id) + " " + std::to_string(m_sct_region_index);
576  localMessage(errMsg, __func__, MSG::ERROR);
577  return(1);
578  }
579 
580  auto findField = [this](const std::string &name, const size_t indx){
581  IdDictField* pField = m_dict->find_field(name);
582  if (pField) {
583  m_indices[indx] = pField->m_index;
584  return true;
585  }
586  const auto lvl = (indx == ROW) ? MSG::DEBUG : MSG::ERROR;
587  localMessage("- unable to find '" + name +"' field ", __func__, lvl);
588  return false;
589  };
590 
591  // Find an SCT region
592  if (not findField("subdet", INDET)) return 1;
593  if (not findField("part", SCT)) return 1;
594  if (not findField("barrel_endcap", BARREL_EC)) return 1;
595  if (not findField("layer", LAYER_DISK)) return 1;
596  if (not findField("phi_module", PHI)) return 1;
597  if (not findField("eta_module", ETA)) return 1;
598  if (not findField("side", SIDE)) return 1;
599  m_hasRows = (findField("row", ROW));
600  if (not findField("strip", STRIP)) return 1;
601 
602  // Set the field implementations: for bec, lay/disk, eta/phi mod
603 
604  const IdDictRegion& region = *m_dict->m_regions[m_sct_region_index];
605 
613  if (m_hasRows) {
615  }
617  localMessage("decode index and bit fields for each level: ", __func__, MSG::DEBUG);
618  localMessage("indet " + m_indet_impl.show_to_string(), __func__, MSG::DEBUG);
619  localMessage("sct " + m_sct_impl.show_to_string(), __func__, MSG::DEBUG);
620  localMessage("bec " + m_bec_impl.show_to_string(), __func__, MSG::DEBUG);
621  localMessage("lay_disk " + m_lay_disk_impl.show_to_string(), __func__, MSG::DEBUG);
622  localMessage("phi_mod " + m_phi_mod_impl.show_to_string(), __func__, MSG::DEBUG);
623  localMessage("eta_mod " + m_eta_mod_impl.show_to_string(), __func__, MSG::DEBUG);
624  localMessage("side " + m_side_impl.show_to_string(), __func__, MSG::DEBUG);
625  if (m_hasRows) {
626  localMessage("row " + m_row_impl.show_to_string(), __func__, MSG::DEBUG);
627  }
628  localMessage("strip " + m_strip_impl.show_to_string(), __func__, MSG::DEBUG);
629 
630 
631 
632  return(0);
633 }
634 
637  return m_wafer_hash_max;
638 }
639 
642  return m_strip_hash_max;
643 }
644 
646  return(m_wafer_vec.begin());
647 }
648 
650  return(m_wafer_vec.end());
651 }
652 
655 }
656 
659 }
660 
661 // From hash get Identifier
662 int
664  Identifier& id,
665  const IdContext* context) const {
666  int result = 1;
667  id.clear();
668  size_t begin = (context) ? context->begin_index() : 0;
669  // cannot get hash if end is 0:
670  size_t end = (context) ? context->end_index() : 0;
671  if (0 == begin) {
672  // No hashes yet for ids with prefixes
673  if (m_indices[SIDE] == end) {
674  if (hash_id < m_wafer_vec.size()) {
675  id = m_wafer_vec[hash_id];
676  result = 0;
677  }
678  } else if (m_indices[STRIP] == end) {
679  // Do not know how to calculate strip id from hash yet!!
680  localMessage( "Do not know how to calculate strip id from hash yet!!", __func__, MSG::ERROR );
681  }
682  }
683  return(result);
684 }
685 
686 void
688  ExpandedIdentifier& exp_id,
689  const IdContext* context) const {
690  exp_id.clear();
691  exp_id << indet_field_value()
692  << sct_field_value()
693  << barrel_ec(id)
694  << layer_disk(id)
695  << phi_module(id)
696  << eta_module(id)
697  << side(id);
698  if (!context || context->end_index() == m_indices[STRIP]) {
699  if (m_hasRows) {
700  exp_id << row(id) << strip(id);
701  } else {
702  exp_id << strip(id);
703  }
704  }
705 }
706 
707 int
709  IdentifierHash& hash_id,
710  const IdContext* context) const {
711  // Get the hash code from either a vec (for wafers) or calculate
712  // it (strips). For the former, we convert to compact and call
713  // get_hash again. For the latter, we calculate the hash from the
714  // Identifier.
715 
716  int result = 1;
717 
718  hash_id = 0;
719  size_t begin = (context) ? context->begin_index() : 0;
720  size_t end = (context) ? context->end_index() : 0;
721  if (0 == begin) {
722  // No hashes yet for ids with prefixes
723  if (m_indices[SIDE] == end) {
724  hash_id = wafer_hash(id);
725  if (hash_id.is_valid()) result = 0;
726  } else if (context && context->end_index() == m_indices[STRIP]) {
727  // Must calculate for strip hash
728  ExpandedIdentifier new_id;
729  get_expanded_id(id, new_id);
730  hash_id = m_full_strip_range.cardinalityUpTo(new_id);
731  result = 0;
732  }
733  }
734  return(result);
735 }
736 void
737 SCT_ID::localMessage(const std::string & msgTxt, const std::string &func, const MSG::Level & lvl) const{
738  const std::array<std::string, MSG::NUM_LEVELS> prefix={"","VERBOSE ", "DEBUG ", "INFO ", "WARNING ", "ERROR ", "FATAL "," "};
739  if (m_msgSvc){
740  MsgStream log(m_msgSvc, "SCT_ID");
741  log << lvl << msgTxt << endmsg;
742  } else {
743  #ifdef NDEBUG
744  if (lvl > MSG::DEBUG) std::cout<<prefix[lvl]<<"SCT_ID::"<<func<<" "<<msgTxt<<std::endl;
745  #else
746  std::cout<<prefix[lvl]<<"SCT_ID::"<<func<<" "<<msgTxt<<std::endl;
747  #endif
748  }
749 
750 }
751 
752 //all neighbours: opposite and then eta direction first
753 std::array<IdentifierHash, 5>
755  if (size_type index = idh; index<m_wafer_hash_max) return std::array<IdentifierHash, 5>{
756  get_other_side(idh),
759  };
760  else return invalidHashes;
761 }
762 
763 //all neighbours: opposite and then phi direction first
764 std::array<IdentifierHash, 5>
766  if (size_type index = idh; index<m_wafer_hash_max) return std::array<IdentifierHash, 5>{
767  get_other_side(idh),
770  };
771  else return invalidHashes;
772 }
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictMgr.cxx:368
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: IdDictDefs.h:331
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:404
SCT_ID::SCT_ID
SCT_ID(void)
Definition: SCT_ID.cxx:31
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:923
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
max
#define max(a, b)
Definition: cfImp.cxx:41
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:653
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:394
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:44
index
Definition: index.py:1
MultiRange::factory_end
identifier_factory factory_end()
Definition: MultiRange.cxx:124
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:309
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:657
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:645
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:182
SCT_ID::STRIP
@ STRIP
Definition: SCT_ID.h:310
IdentifierField::clear
void clear()
Set methods.
Definition: IdentifierField.cxx:223
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
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:215
SCT_ID::strip_hash_max
size_type strip_hash_max(void) const
Definition: SCT_ID.cxx:641
SCT_ID::phi_module_max
int phi_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:204
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:687
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: IdDictMgr.cxx:311
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictDefs.h:433
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:663
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:388
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: IdDictDefs.h:32
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:163
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:560
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:708
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: IdDictDefs.h:302
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:148
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:434
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:765
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:157
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:340
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:754
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: SCT_ID.cxx:636
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:737
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
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:43
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:152
SCT_ID::is_eta_module_min
bool is_eta_module_min(const Identifier &id) const
For the barrel.
Definition: SCT_ID.cxx:192
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:414
IdDictDictionary
Definition: IdDictDefs.h:97
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:424
SCT_ID::is_eta_module_max
bool is_eta_module_max(const Identifier &id) const
For the barrel.
Definition: SCT_ID.cxx:198
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: 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
SCT_ID::getMaxField
int getMaxField(const Identifier &id, const ExpandedIdIndices &fieldIndx) const
Definition: SCT_ID.cxx:127
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:187
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:105
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:649
SCT_ID::is_phi_module_max
bool is_phi_module_max(const Identifier &id) const
Definition: SCT_ID.cxx:209
SCT_ID::init_neighbors
int init_neighbors(void)
Definition: SCT_ID.cxx:457
SIDE
SIDE
Definition: CellClusterLinkTool.h:52
IdDictField
Definition: IdDictDefs.h:316
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: IdDictDefs.h:459
IdentifierField::add_value
void add_value(element_type value)
Definition: IdentifierField.cxx:249
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:63
Identifier
Definition: IdentifierFieldParser.cxx:14