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