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