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