ATLAS Offline Software
PixelID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 /***************************************************************************
6  Inner Detector identifier package
7  -------------------------------------------
8 ***************************************************************************/
9 
10 
11 #include "GaudiKernel/MsgStream.h"
12 
16 #include "IdDict/IdDictDefs.h"
17 #include <set>
18 #include <algorithm>
19 #include <iostream>
20 
21 
24  m_dbm_field.add_value(0); //DBM
25 }
26 
27 void
28 PixelID::wafer_id_checks(int barrel_ec,int layer_disk,int phi_module,int eta_module) const {
29 
30  // Fill expanded id
34  if (!m_full_wafer_range.match(id)) { // module range check is sufficient
35  MsgStream log(m_msgSvc, "PixelID");
36  log << MSG::ERROR << " PixelID::wafer_id result is NOT ok. ID, range "
37  << (std::string) id << " " << (std::string) m_full_wafer_range << endmsg;
38 
39  }
40 }
41 
42 void
43 PixelID::pixel_id_checks(int barrel_ec,int layer_disk,int phi_module,int eta_module,
44  int phi_index,int eta_index) const {
45  // Check that id is within allowed range
46  // Fill expanded id
50  if (!m_full_pixel_range.match(id)) {
51  MsgStream log(m_msgSvc, "PixelID");
52  log << MSG::ERROR << " PixelID::pixel_id result is NOT ok. ID, range "
53  << (std::string) id << " " << (std::string) m_full_pixel_range << endmsg;
54 
55  }
56 }
57 
58 int
60  // get max from dictionary
61  ExpandedIdentifier expId;
62  IdContext wafer_context1 = wafer_context();
63  get_expanded_id(id, expId, &wafer_context1);
64  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
65  const Range& range = m_full_wafer_range[i];
66  if (range.match(expId)) {
67  const Range::field& layer_disk_field = range[m_LAYER_DISK_INDEX];
68  if (not layer_disk_field.empty()) {
69  return(layer_disk_field.get_maximum());
70  }
71  }
72  }
73  return(-999); // default
74 }
75 
76 int
78  // get max from dictionary
79  ExpandedIdentifier expId;
80  IdContext wafer_context1 = wafer_context();
81  get_expanded_id(id, expId, &wafer_context1);
82  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
83  const Range& range = m_full_wafer_range[i];
84  if (range.match(expId)) {
85  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
86  if (not eta_field.empty()) {
87  return(eta_field.get_maximum());
88  }
89  }
90  }
91  return(-999);
92 }
93 
94 int PixelID::eta_module_min(const Identifier& id) const {
95  // get min from dictionary
96  ExpandedIdentifier expId;
97  IdContext wafer_context1 = wafer_context();
98  get_expanded_id(id, expId, &wafer_context1);
99  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
100  const Range& range = m_full_wafer_range[i];
101  if (range.match(expId)) {
102  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
103  if (not eta_field.empty()) {
104  return(eta_field.get_minimum());
105  }
106  }
107  }
108  return(-999);
109 }
110 
111 bool
113  return(eta_module(id) == eta_module_min(id));
114 }
115 
116 bool
118  return(eta_module(id) == eta_module_max(id));
119 }
120 
121 int PixelID::phi_module_max(const Identifier& id) const {
122  // get max from dictionary
123  ExpandedIdentifier expId;
124  IdContext wafer_context1 = wafer_context();
125 
126  get_expanded_id(id, expId, &wafer_context1);
127  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
128  const Range& range = m_full_wafer_range[i];
129  if (range.match(expId)) {
130  const Range::field& phi_field = range[m_PHI_MODULE_INDEX];
131  if (not phi_field.empty()) {
132  return(phi_field.get_maximum());
133  }
134  }
135  }
136  // Failed to find the max
137  return(-999);
138 }
139 
140 int
142  // get max from dictionary
143  ExpandedIdentifier expId;
144  IdContext wafer_context1 = wafer_context();
145  get_expanded_id(id, expId, &wafer_context1);
146  for (unsigned int i = 0; i < m_full_pixel_range.size(); ++i) {
147  const Range& range = m_full_pixel_range[i];
148  if (range.match(expId)) {
149  const Range::field& phi_field = range[m_PHI_INDEX_INDEX];
150  if (not phi_field.empty()) {
151  return(phi_field.get_maximum());
152  }
153  }
154  }
155  // Failed to find the max
156  return(-999);
157 }
158 
159 int
161  // get max from dictionary
162  ExpandedIdentifier expId;
163  IdContext wafer_context1 = wafer_context();
164  get_expanded_id(id, expId, &wafer_context1);
165  for (unsigned int i = 0; i < m_full_pixel_range.size(); ++i) {
166  const Range& range = m_full_pixel_range[i];
167  if (range.match(expId)) {
168  const Range::field& eta_field = range[m_ETA_INDEX_INDEX];
169  if (not eta_field.empty()) {
170  return(eta_field.get_maximum());
171  }
172  }
173  }
174  return(-999); // default
175 }
176 
177 bool
179  return(phi_module(id) == phi_module_max(id));
180 }
181 
182 int
184  MsgStream log(m_msgSvc, "PixelID");
185 
186  log << MSG::INFO << "Initialize from dictionary" << endmsg;
187 
188  // Check whether this helper should be reinitialized
189  if (!reinitialize(dict_mgr)) {
190  log << MSG::INFO << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
191  return(0);
192  } else {
193  log << MSG::DEBUG << "(Re)initialize" << endmsg;
194  }
195 
196  // init base object
197  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return(1);
198 
199  // Register version of InnerDetector dictionary
200  if (register_dict_tag(dict_mgr, "InnerDetector")) return(1);
201 
202  m_dict = dict_mgr.find_dictionary("InnerDetector");
203  if (!m_dict) {
204  log << MSG::FATAL << " PixelID::initialize_from_dict - cannot access InnerDetector dictionary "
205  << endmsg;
206 
207  return(1);
208  }
209 
210  AtlasDetectorID::setDictVersion(dict_mgr, "InnerDetector");
211 
212  // Initialize the field indices
213  if (initLevelsFromDict()) return(1);
214 
215  // save indet id
216  m_pixel_id = pixel();
217  if (!is_pixel(m_pixel_id)) {
218  log << MSG::FATAL << " PixelID::initialize_from_dict - cannot get pixel id dictionary "
219  << endmsg;
220 
221  return(1);
222  }
223 
224  //
225  // Set barrel field for testing is_barrel
226  //
227  int barrel_value;
229  // barrel
230  if (m_dict->get_label_value("barrel_endcap", "barrel", barrel_value)) {
231  log << MSG::FATAL << "Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
232  << m_dict->m_name
233  << endmsg;
234 
235  return(1);
236  }
237  m_barrel_field.add_value(barrel_value);
238  m_barrel_field.add_value(barrel_value);
239  log << MSG::DEBUG << " PixelID::initialize_from_dict "
240  << "Set barrel field values: "
241  << (std::string) m_barrel_field
242  << endmsg;
243 
244 
245  //DBM
246  //Set dbm field for testing is_dbm
247  //
248  // WARNING:
249  // modified to skip DBM when aprorpiate dictionary is not present
250  // by adding +999 or -999 to the field
251  //
252 
253  int dbm_value;
254  m_dbm_field.clear();
255  if (m_dict->get_label_value("barrel_endcap", "negative_dbm", dbm_value)) {
256  if (m_dict->m_version.find("DBM") != std::string::npos) {
257  log << MSG::WARNING <<
258  "Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
259  << m_dict->m_name
260  << endmsg;
261 
262  }
263  //return (1);
264  m_dbm_field.add_value(-999);
265  } else {
266  m_dbm_field.add_value(dbm_value);
267  }
268  if (m_dict->get_label_value("barrel_endcap", "positive_dbm", dbm_value)) {
269  if (m_dict->m_version.find("DBM") != std::string::npos) {
270  log << MSG::WARNING <<
271  "Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
272  << m_dict->m_name
273  << endmsg;
274 
275  }
276  //return (1);
277  m_dbm_field.add_value(999);
278  } else {
279  m_dbm_field.add_value(dbm_value);
280  }
281  log << MSG::DEBUG << " PixelID::initialize_from_dict "
282  << "Set dbm field values: "
283  << (std::string) m_dbm_field
284  << endmsg;
285 
286 
287 
288  //
289  // Build multirange for the valid set of identifiers
290  //
291 
292 
293  // Find value for the field InnerDetector
294  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
295  int inDetField = -1;
296  if (atlasDict->get_label_value("subdet", "InnerDetector", inDetField)) {
297  log << MSG::FATAL << "Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
298  << atlasDict->m_name
299  << endmsg;
300 
301  return(1);
302  }
303 
304  // Find value for the field PIXEL
305  int pixelField = -1;
306  if (m_dict->get_label_value("part", "Pixel", pixelField)) {
307  log << MSG::FATAL << "Could not get value for label 'Pixel' of field 'part' in dictionary "
308  << m_dict->m_name
309  << endmsg;
310 
311  return(1);
312  }
313  log << MSG::DEBUG << " PixelID::initialize_from_dict "
314  << "Found field values: InDet/Pixel "
315  << inDetField << "/"
316  << pixelField
317  << endmsg;
318 
319 
320  // Set up id for region and range prefix
322  region_id.add(inDetField);
323  region_id.add(pixelField);
324  Range prefix;
327 
328  // Set the base identifier for Pixel
332 
333  // Set the base expanded identifier for Pixel
335 
336  // Setup the hash tables
337  if (init_hashes()) return(1);
338 
339  // Setup hash tables for finding neighbors
340  if (init_neighbors()) return(1);
341  log << MSG::DEBUG << " PixelID::initialize_from_dict "
342  << endmsg;
343  log << MSG::DEBUG
344  << "Wafer range -> " << (std::string) m_full_wafer_range
345  << endmsg;
346  log << MSG::DEBUG
347  << "Pixel range -> " << (std::string) m_full_pixel_range
348  << endmsg;
349 
350  return 0;
351 }
352 
353 int
355  //
356  // create a vector(s) to retrieve the hashes for compact ids. For
357  // the moment, we implement a hash for wafers but NOT for pixels
358  // (too many)
359  //
360 
361  MsgStream log(m_msgSvc, "PixelID");
362 
363  // wafer hash
365  m_wafer_vec.clear();
367  unsigned int nids = 0;
368  std::set<Identifier> ids;
369  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
370  const Range& range = m_full_wafer_range[i];
372  for (const auto & exp_id:rit) {
374  exp_id[m_LAYER_DISK_INDEX],
375  exp_id[m_PHI_MODULE_INDEX],
376  exp_id[m_ETA_MODULE_INDEX]);
377  if (!(ids.insert(id)).second) {
378  log << MSG::FATAL << " PixelID::init_hashes "
379  << " Error: duplicated id for wafer id. nid " << nids
380  << " id " << show_to_string(id)
381  << " exp id " << (std::string) exp_id
382  << " " << (std::string) m_full_wafer_range << endmsg;
383 
384  return(1);
385  }
386  nids++;
387  }
388  }
389  if (ids.size() != m_wafer_hash_max) {
390  log << MSG::FATAL << " PixelID::init_hashes "
391  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
392  << " hash max " << m_wafer_hash_max
393  << endmsg;
394 
395  return(1);
396  }
397 
398  nids = 0;
399  std::set<Identifier>::const_iterator first = ids.begin();
400  std::set<Identifier>::const_iterator last = ids.end();
401  for (; first != last && nids < m_wafer_vec.size(); ++first) {
402  m_wafer_vec[nids] = (*first);
403  nids++;
404  }
405 
406  // pixel hash - we do not keep a vec for the pixels - too large
408 
409  return(0);
410 }
411 
412 int
414  unsigned short index = id;
415 
416  if (index < m_prev_phi_wafer_vec.size()) {
417  if (m_prev_phi_wafer_vec[index] == NOT_VALID_HASH) return(1);
418 
419  prev = m_prev_phi_wafer_vec[index];
420  return(0);
421  }
422  return(1);
423 }
424 
425 int
427  unsigned short index = id;
428 
429  if (index < m_next_phi_wafer_vec.size()) {
430  if (m_next_phi_wafer_vec[index] == NOT_VALID_HASH) return(1);
431 
433  return(0);
434  }
435  return(1);
436 }
437 
438 int
440  unsigned short index = id;
441 
442  if (index < m_prev_eta_wafer_vec.size()) {
443  if (m_prev_eta_wafer_vec[index] == NOT_VALID_HASH) return(1);
444 
445  prev = m_prev_eta_wafer_vec[index];
446  return(0);
447  }
448  return(1);
449 }
450 
451 int
453  unsigned short index = id;
454  if (index < m_next_eta_wafer_vec.size()) {
455  if (m_next_eta_wafer_vec[index] == NOT_VALID_HASH) return(1);
456 
458  return(0);
459  }
460  return(1);
461 }
462 
463 int
465  //
466  // create a vector(s) to retrieve the hashes for compact ids for
467  // wafer neighbors.
468  //
469  MsgStream log(m_msgSvc, "PixelID");
470 
471  log << MSG::DEBUG << "PixelID::init_neighbors " << endmsg;
472 
473  m_prev_phi_wafer_vec.clear();
474  m_next_phi_wafer_vec.clear();
475  m_prev_eta_wafer_vec.clear();
476  m_next_eta_wafer_vec.clear();
481 
482  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
483  const Range& range = m_full_wafer_range[i];
484  const Range::field& phi_field = range[m_PHI_MODULE_INDEX];
485  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
486 
487  // save the lowest value of the module offset
489  eta_field.get_minimum() : m_ETA_MODULE_OFFSET;
491  for (const auto & exp_id: rit) {
496  bool pphi = phi_field.get_previous(exp_id[m_PHI_MODULE_INDEX], previous_phi);
497  bool nphi = phi_field.get_next(exp_id[m_PHI_MODULE_INDEX], next_phi);
498  bool peta = eta_field.get_previous(exp_id[m_ETA_MODULE_INDEX], previous_eta);
499  bool neta = eta_field.get_next(exp_id[m_ETA_MODULE_INDEX], next_eta);
500 
501  IdContext wcontext = wafer_context();
502 
503  // First get primary hash id
504  IdentifierHash hash_id;
506  exp_id[m_LAYER_DISK_INDEX],
507  exp_id[m_PHI_MODULE_INDEX],
508  exp_id[m_ETA_MODULE_INDEX]);
509  if (get_hash(id, hash_id, &wcontext)) {
510  log << MSG::FATAL << " PixelID::init_neighbors - unable to get hash, exp/compact "
511  << id.getString() << " " << show_to_string(id) << endmsg;
512 
513  return(1);
514  }
515 
516  // index for the subsequent arrays
517  unsigned short index = hash_id;
518  assert(hash_id < m_prev_phi_wafer_vec.size());
519  assert(hash_id < m_next_phi_wafer_vec.size());
520  assert(hash_id < m_prev_eta_wafer_vec.size());
521  assert(hash_id < m_next_eta_wafer_vec.size());
522 
523  if (pphi) {
524  // Get previous phi hash id
525  ExpandedIdentifier expId = exp_id;
526  expId[m_PHI_MODULE_INDEX] = previous_phi;
528  expId[m_LAYER_DISK_INDEX],
529  expId[m_PHI_MODULE_INDEX],
530  expId[m_ETA_MODULE_INDEX]);
531  if (get_hash(id, hash_id, &wcontext)) {
532  log << MSG::FATAL << " PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
533  << id.getString() << " " << show_to_string(id) << endmsg;
534 
535  return(1);
536  }
537  m_prev_phi_wafer_vec[index] = hash_id;
538  }
539 
540  if (nphi) {
541  // Get next phi hash id
542  ExpandedIdentifier expId = exp_id;
543  expId[m_PHI_MODULE_INDEX] = next_phi;
545  expId[m_LAYER_DISK_INDEX],
546  expId[m_PHI_MODULE_INDEX],
547  expId[m_ETA_MODULE_INDEX]);
548  if (get_hash(id, hash_id, &wcontext)) {
549  log << MSG::FATAL << " PixelID::init_neighbors - unable to get next phi hash, exp/compact " <<
550  id.getString() << " " << show_to_string(id) << endmsg;
551 
552  return(1);
553  }
554  m_next_phi_wafer_vec[index] = hash_id;
555  }
556 
557  if (peta) {
558  // Get previous eta hash id
559  ExpandedIdentifier expId = exp_id;
560  expId[m_ETA_MODULE_INDEX] = previous_eta;
562  expId[m_LAYER_DISK_INDEX],
563  expId[m_PHI_MODULE_INDEX],
564  expId[m_ETA_MODULE_INDEX]);
565  if (get_hash(id, hash_id, &wcontext)) {
566  log << MSG::FATAL << " PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
567  << id.getString() << " " << show_to_string(id) << endmsg;
568 
569  return(1);
570  }
571  m_prev_eta_wafer_vec[index] = hash_id;
572  }
573 
574  if (neta) {
575  // Get next eta hash id
576  ExpandedIdentifier expId = exp_id;
577  expId[m_ETA_MODULE_INDEX] = next_eta;
579  expId[m_LAYER_DISK_INDEX],
580  expId[m_PHI_MODULE_INDEX],
581  expId[m_ETA_MODULE_INDEX]);
582  if (get_hash(id, hash_id, &wcontext)) {
583  log << MSG::FATAL << " PixelID::init_neighbors - unable to get next eta hash, exp/compact "
584  << id.getString() << " " << show_to_string(id) << endmsg;
585 
586  return(1);
587  }
588  m_next_eta_wafer_vec[index] = hash_id;
589  }
590  }
591  }
592  return(0);
593 }
594 
595 int
597  MsgStream log(m_msgSvc, "PixelID");
598 
599  if (!m_dict) {
600  log << MSG::FATAL << " PixelID::initLevelsFromDict - dictionary NOT initialized " << endmsg;
601  return(1);
602  }
603 
604  // Find out which identifier field corresponds to each level. Use
605  // names to find each field/leve.
606 
607  m_INDET_INDEX = 999;
608  m_PIXEL_INDEX = 999;
609  m_BARREL_EC_INDEX = 999;
610  m_LAYER_DISK_INDEX = 999;
611  m_PHI_MODULE_INDEX = 999;
612  m_ETA_MODULE_INDEX = 999;
613  m_PHI_INDEX_INDEX = 999;
614  m_ETA_INDEX_INDEX = 999;
615 
616  // Save index to a PIXEL region for unpacking
620  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
621  << (std::string) id << " " << m_pixel_region_index
622  << endmsg;
623 
624  return(1);
625  }
626 
627  // Get levels
628  IdDictField* field = m_dict->find_field("subdet");
629  if (field) {
630  m_INDET_INDEX = field->m_index;
631  } else {
632  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'subdet' field "
633  << endmsg;
634 
635  return(1);
636  }
637 
638  field = m_dict->find_field("part");
639  if (field) {
640  m_PIXEL_INDEX = field->m_index;
641  } else {
642  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'part' field " << endmsg;
643  return(1);
644  }
645 
646  field = m_dict->find_field("barrel_endcap");
647  if (field) {
648  m_BARREL_EC_INDEX = field->m_index;
649  } else {
650  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'barrel_endcap' field " << endmsg;
651  return(1);
652  }
653 
654  field = m_dict->find_field("layer");
655  if (field) {
656  m_LAYER_DISK_INDEX = field->m_index;
657  } else {
658  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'layer' field " << endmsg;
659  return(1);
660  }
661 
662  field = m_dict->find_field("phi_module");
663  if (field) {
664  m_PHI_MODULE_INDEX = field->m_index;
665  } else {
666  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'phi_module' field " << endmsg;
667  return(1);
668  }
669  field = m_dict->find_field("eta_module");
670  if (field) {
671  m_ETA_MODULE_INDEX = field->m_index;
672  } else {
673  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'eta_module' field " << endmsg;
674  return(1);
675  }
676  field = m_dict->find_field("phi_index");
677  if (field) {
678  m_PHI_INDEX_INDEX = field->m_index;
679  } else {
680  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'phi_index' field " << endmsg;
681  return(1);
682  }
683  field = m_dict->find_field("eta_index");
684  if (field) {
685  m_ETA_INDEX_INDEX = field->m_index;
686  } else {
687  log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'eta_index' field " << endmsg;
688  return(1);
689  }
690 
691  // Set the field implementations: for bec, lay/disk, eta/phi mod
692  // there are two kinds - shifted and non-shifted
693 
695 
704 
705 
706  log << MSG::DEBUG << "decode index and bit fields for each level: " << endmsg;
707  log << MSG::DEBUG << "indet " << m_indet_impl.show_to_string() << endmsg;
708  log << MSG::DEBUG << "pixel " << m_pixel_impl.show_to_string() << endmsg;
709  log << MSG::DEBUG << "bec " << m_bec_impl.show_to_string() << endmsg;
710  log << MSG::DEBUG << "bec_shift " << m_bec_shift_impl.show_to_string() << endmsg;
711  log << MSG::DEBUG << "lay_disk " << m_lay_disk_impl.show_to_string() << endmsg;
712  log << MSG::DEBUG << "lay_disk_shift " << m_lay_disk_shift_impl.show_to_string() << endmsg;
713  log << MSG::DEBUG << "phi_mod " << m_phi_mod_impl.show_to_string() << endmsg;
714  log << MSG::DEBUG << "phi_mod_shift " << m_phi_mod_shift_impl.show_to_string() << endmsg;
715  log << MSG::DEBUG << "eta_mod " << m_eta_mod_impl.show_to_string() << endmsg;
716  log << MSG::DEBUG << "eta_mod_shift " << m_eta_mod_shift_impl.show_to_string() << endmsg;
717  log << MSG::DEBUG << "phi_index " << m_phi_index_impl.show_to_string() << endmsg;
718  log << MSG::DEBUG << "eta_index " << m_eta_index_impl.show_to_string() << endmsg;
719  log << MSG::DEBUG << "bec_eta_mod " << m_bec_eta_mod_impl.show_to_string() << endmsg;
720 
721 
722 
723 
724  std::cout << "indet " << m_indet_impl.decode_index() << " "
725  << (std::string) m_indet_impl.ored_field() << " "
726  << std::hex << m_indet_impl.mask() << " "
727  << m_indet_impl.zeroing_mask() << " "
728  << std::dec << m_indet_impl.shift()
729  << " " << m_indet_impl.bits() << " " << m_indet_impl.bits_offset() << " ";
731  std::cout << "pixel " << m_pixel_impl.decode_index() << " "
732  << (std::string) m_pixel_impl.ored_field() << " "
733  << std::hex << m_pixel_impl.mask() << " "
734  << m_pixel_impl.zeroing_mask() << " "
735  << std::dec << m_pixel_impl.shift()
736  << " " << m_pixel_impl.bits() << " " << m_pixel_impl.bits_offset() << " ";
738  std::cout << "bec " << m_bec_impl.decode_index() << " "
739  << (std::string) m_bec_impl.ored_field() << " "
740  << std::hex << m_bec_impl.mask() << " "
741  << m_bec_impl.zeroing_mask() << " "
742  << std::dec << m_bec_impl.shift()
743  << " " << m_bec_impl.bits() << " " << m_bec_impl.bits_offset() << " ";
745  std::cout << "bec_shift " << m_bec_shift_impl.decode_index() << " "
746  << (std::string) m_bec_shift_impl.ored_field() << " "
747  << std::hex << m_bec_shift_impl.mask() << " "
748  << m_bec_shift_impl.zeroing_mask() << " "
749  << std::dec << m_bec_shift_impl.shift()
750  << " " << m_bec_shift_impl.bits() << " " << m_bec_shift_impl.bits_offset() << " ";
752  std::cout << "lay_disk " << m_lay_disk_impl.decode_index() << " "
753  << (std::string) m_lay_disk_impl.ored_field() << " "
754  << std::hex << m_lay_disk_impl.mask() << " "
755  << m_lay_disk_impl.zeroing_mask() << " "
756  << std::dec << m_lay_disk_impl.shift()
757  << " " << m_lay_disk_impl.bits() << " " << m_lay_disk_impl.bits_offset() << " ";
759  std::cout << "lay_disk_shift " << m_lay_disk_shift_impl.decode_index() << " "
760  << (std::string) m_lay_disk_shift_impl.ored_field() << " "
761  << std::hex << m_lay_disk_shift_impl.mask() << " "
763  << std::dec << m_lay_disk_shift_impl.shift()
764  << " " << m_lay_disk_shift_impl.bits() << " " << m_lay_disk_shift_impl.bits_offset() << " ";
766  std::cout << "phi_mod " << m_phi_mod_impl.decode_index() << " "
767  << (std::string) m_phi_mod_impl.ored_field() << " "
768  << std::hex << m_phi_mod_impl.mask() << " "
769  << m_phi_mod_impl.zeroing_mask() << " "
770  << std::dec << m_phi_mod_impl.shift()
771  << " " << m_phi_mod_impl.bits() << " " << m_phi_mod_impl.bits_offset() << " ";
773  std::cout << "phi_mod_shift " << m_phi_mod_shift_impl.decode_index() << " "
774  << (std::string) m_phi_mod_shift_impl.ored_field() << " "
775  << std::hex << m_phi_mod_shift_impl.mask() << " "
777  << std::dec << m_phi_mod_shift_impl.shift()
778  << " " << m_phi_mod_shift_impl.bits() << " " << m_phi_mod_shift_impl.bits_offset() << " ";
780  std::cout << "eta_mod " << m_eta_mod_impl.decode_index() << " "
781  << (std::string) m_eta_mod_impl.ored_field() << " "
782  << std::hex << m_eta_mod_impl.mask() << " "
783  << m_eta_mod_impl.zeroing_mask() << " "
784  << std::dec << m_eta_mod_impl.shift()
785  << " " << m_eta_mod_impl.bits() << " " << m_eta_mod_impl.bits_offset() << " ";
787  std::cout << "eta_mod_shift " << m_eta_mod_shift_impl.decode_index() << " "
788  << (std::string) m_eta_mod_shift_impl.ored_field() << " "
789  << std::hex << m_eta_mod_shift_impl.mask() << " "
791  << std::dec << m_eta_mod_shift_impl.shift()
792  << " " << m_eta_mod_shift_impl.bits() << " " << m_eta_mod_shift_impl.bits_offset() << " ";
794  std::cout << "phi_index " << m_phi_index_impl.decode_index() << " "
795  << (std::string) m_phi_index_impl.ored_field() << " "
796  << std::hex << m_phi_index_impl.mask() << " "
797  << m_phi_index_impl.zeroing_mask() << " "
798  << std::dec << m_phi_index_impl.shift()
799  << " " << m_phi_index_impl.bits() << " " << m_phi_index_impl.bits_offset() << " ";
801  std::cout << "eta_index " << m_eta_index_impl.decode_index() << " "
802  << (std::string) m_eta_index_impl.ored_field() << " "
803  << std::hex << m_eta_index_impl.mask() << " "
804  << m_eta_index_impl.zeroing_mask() << " "
805  << std::dec << m_eta_index_impl.shift()
806  << " " << m_eta_index_impl.bits() << " " << m_eta_index_impl.bits_offset() << " ";
808  std::cout << "bec_eta_mod " << m_bec_eta_mod_impl.decode_index() << " "
809  << (std::string) m_bec_eta_mod_impl.ored_field() << " "
810  << std::hex << m_bec_eta_mod_impl.mask() << " "
811  << m_bec_eta_mod_impl.zeroing_mask() << " "
812  << std::dec << m_bec_eta_mod_impl.shift()
813  << " " << m_bec_eta_mod_impl.bits() << " " << m_bec_eta_mod_impl.bits_offset() << " ";
815 
816 
817  std::cout << "PixelID::initLevelsFromDict - found levels " << std::endl;
818  std::cout << "subdet " << m_INDET_INDEX << std::endl;
819  std::cout << "part " << m_PIXEL_INDEX << std::endl;
820  std::cout << "barrel_endcap " << m_BARREL_EC_INDEX << std::endl;
821  std::cout << "layer or disk " << m_LAYER_DISK_INDEX << std::endl;
822  std::cout << "phi_module " << m_PHI_MODULE_INDEX << std::endl;
823  std::cout << "eta_module " << m_ETA_MODULE_INDEX << std::endl;
824  std::cout << "phi_index " << m_PHI_INDEX_INDEX << std::endl;
825  std::cout << "eta_index " << m_ETA_INDEX_INDEX << std::endl;
826 
827  return(0);
828 }
829 
832  return m_wafer_hash_max;
833 }
834 
837  return m_pixel_hash_max;
838 }
839 
841  return(m_wafer_vec.begin());
842 }
843 
845  return(m_wafer_vec.end());
846 }
847 
850 }
851 
854 }
855 
856 void
858  ExpandedIdentifier& exp_id,
859  const IdContext* context) const {
860  exp_id.clear();
861  exp_id = m_baseExpandedIdentifier;
862  exp_id << barrel_ec(id)
863  << layer_disk(id)
864  << phi_module(id)
865  << eta_module(id);
866  if (!context || context->end_index() == m_ETA_INDEX_INDEX) {
867  exp_id << phi_index(id)
868  << eta_index(id);
869  }
870 }
871 
872 // From hash get Identifier
873 int
875  Identifier& id,
876  const IdContext* context) const {
877  int result = 1;
878 
879  size_t begin = (context) ? context->begin_index() : 0;
880  // cannot get hash if end is 0:
881  size_t end = (context) ? context->end_index() : 0;
882 
883  if (0 == begin) {
884  // No hashes yet for ids with prefixes
885  if (m_ETA_MODULE_INDEX == end) {
886  if (hash_id < (unsigned int) (m_wafer_vec.end() - m_wafer_vec.begin())) {
887  id = m_wafer_vec[hash_id];
888  result = 0;
889  }
890  } else if (m_ETA_INDEX_INDEX == end) {
891  // Do not know how to calculate pixel id from hash yet!!
892  std::cout << "Do not know how to calculate pixel id from hash yet!!" << std::endl;
893  }
894  }
895  return(result);
896 }
897 
898 int
900  IdentifierHash& hash_id,
901  const IdContext* context) const {
902  // Get the hash code from either a vec (for wafers) or calculate
903  // it (pixels). For the former, we convert to compact and call
904  // get_hash again. For the latter, we calculate the hash from the
905  // Identifier.
906 
907  int result = 1;
908 
909  hash_id = 0;
910  size_t begin = (context) ? context->begin_index() : 0;
911  size_t end = (context) ? context->end_index() : 0;
912  if (0 == begin) {
913  // No hashes yet for ids with prefixes
914  if (m_ETA_MODULE_INDEX == end) {
915  hash_id = wafer_hash(id);
916  if (hash_id.is_valid()) result = 0;
917  } else if (context && context->end_index() == m_ETA_INDEX_INDEX) {
918  // Must calculate for pixel hash
919  ExpandedIdentifier new_id;
920  get_expanded_id(id, new_id, context);
921  hash_id = m_full_pixel_range.cardinalityUpTo(new_id);
922  result = 0;
923  }
924  }
925  return(result);
926 }
927 
928 void
930  MsgStream log(m_msgSvc, "PixelID");
931 
932  if (m_dict) {
933  int nids = 0;
934  IdContext context = wafer_context();
936  const_id_iterator last = m_wafer_vec.end();
937  for (; first != last; ++first, ++nids) {
938  Identifier id = (*first);
939  ExpandedIdentifier expId;
940  get_expanded_id(id, expId, &context);
941  Identifier new_id = wafer_id(expId[m_BARREL_EC_INDEX],
942  expId[m_LAYER_DISK_INDEX],
943  expId[m_PHI_MODULE_INDEX],
944  expId[m_ETA_MODULE_INDEX]);
945  if (id != new_id) {
946  log << MSG::ERROR <<
947  "PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
948  << show_to_string(new_id) << " " << show_to_string(id) << " "
949  << (std::string) expId << endmsg;
950 
951  continue;
952  }
953  }
954 
955  nids = 0;
956  context = pixel_context();
957  const_expanded_id_iterator first_pixel = pixel_begin();
958  const_expanded_id_iterator last_pixel = pixel_end();
959  for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
960  const ExpandedIdentifier& exp_id = *first_pixel;
961  ExpandedIdentifier new_exp_id;
962 
964  exp_id[m_LAYER_DISK_INDEX],
965  exp_id[m_PHI_MODULE_INDEX],
966  exp_id[m_ETA_MODULE_INDEX]);
967 
968  get_expanded_id(id, new_exp_id, &context);
969  if (exp_id[0] != new_exp_id[0] ||
970  exp_id[1] != new_exp_id[1] ||
971  exp_id[2] != new_exp_id[2] ||
972  exp_id[3] != new_exp_id[3] ||
973  exp_id[4] != new_exp_id[4] ||
974  exp_id[5] != new_exp_id[5]) {
975  log << MSG::ERROR <<
976  "PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
977  << (std::string) new_exp_id
978  << " " << (std::string) exp_id
979  << " " << show_to_string(id) << endmsg;
980 
981  }
982 
984  exp_id[m_LAYER_DISK_INDEX],
985  exp_id[m_PHI_MODULE_INDEX],
986  exp_id[m_ETA_MODULE_INDEX],
987  exp_id[m_PHI_INDEX_INDEX],
988  exp_id[m_ETA_INDEX_INDEX]);
990  layer_disk(pid),
991  phi_module(pid),
992  eta_module(pid),
993  phi_index(pid),
994  eta_index(pid));
995  if (pid != pid1) {
996  log << MSG::ERROR << "PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
997  << " " << show_to_string(pid1) << " "
998  << show_to_string(pid) << endmsg;
999 
1000  }
1001  }
1002 
1003  log << MSG::DEBUG << "PixelID::test_wafer_packing: Successful tested "
1004  << nids << " ids. "
1005  << endmsg;
1006 
1007  } else {
1008  log << MSG::ERROR <<
1009  "PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1010  << endmsg;
1011 
1012  }
1013 }
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictDictionary.cxx:101
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
AtlasDetectorID::indet_field_value
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
Definition: AtlasDetectorID.h:611
PixelID::m_bec_impl
IdDictFieldImplementation m_bec_impl
Definition: PixelID.h:314
ConstRangeIterator
Definition: RangeIterator.h:46
PixelID::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: PixelID.cxx:899
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:299
PixelID::m_wafer_hash_max
size_type m_wafer_hash_max
Definition: PixelID.h:303
PixelID::m_INDET_INDEX
size_type m_INDET_INDEX
Definition: PixelID.h:290
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:320
PixelID::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: PixelID.h:72
get_generator_info.result
result
Definition: get_generator_info.py:21
PixelID::wafer_end
const_id_iterator wafer_end(void) const
Definition: PixelID.cxx:844
PixelID::pixel_context
IdContext pixel_context(void) const
Definition: PixelID.h:598
PixelID::is_eta_module_min
bool is_eta_module_min(const Identifier &id) const
For the barrel.
Definition: PixelID.cxx:112
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
MultiRange::factory_begin
identifier_factory factory_begin()
Definition: MultiRange.cxx:112
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
PixelID::m_pixel_id
Identifier m_pixel_id
Definition: PixelID.h:299
PixelID::m_eta_mod_shift_impl
IdDictFieldImplementation m_eta_mod_shift_impl
Definition: PixelID.h:321
PixelID::m_bec_shift_impl
IdDictFieldImplementation m_bec_shift_impl
Definition: PixelID.h:318
PixelID::PixelID
PixelID()
Definition: PixelID.cxx:22
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
index
Definition: index.py:1
PixelID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: PixelID.cxx:183
MultiRange::factory_end
identifier_factory factory_end()
Definition: MultiRange.cxx:124
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:59
PixelID::m_indet_impl
IdDictFieldImplementation m_indet_impl
Definition: PixelID.h:312
PixelID::m_dbm_field
Range::field m_dbm_field
Definition: PixelID.h:326
MultiRange::cardinalityUpTo
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
Definition: MultiRange.cxx:88
PixelID::init_hashes
int init_hashes(void)
Definition: PixelID.cxx:354
PixelID::m_next_eta_wafer_vec
hash_vec m_next_eta_wafer_vec
Definition: PixelID.h:310
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
PixelID::m_BARREL_EC_INDEX
size_type m_BARREL_EC_INDEX
Definition: PixelID.h:292
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
PixelID::m_phi_index_impl
IdDictFieldImplementation m_phi_index_impl
Definition: PixelID.h:322
PixelID::wafer_begin
const_id_iterator wafer_begin(void) const
Iterators over full set of ids. Wafer iterator is sorted.
Definition: PixelID.cxx:840
PixelID::m_ETA_INDEX_INDEX
size_type m_ETA_INDEX_INDEX
Definition: PixelID.h:297
PixelID::m_phi_mod_shift_impl
IdDictFieldImplementation m_phi_mod_shift_impl
Definition: PixelID.h:320
PixelID::m_full_pixel_range
MultiRange m_full_pixel_range
Definition: PixelID.h:302
IdentifierField::clear
void clear()
Set methods.
Definition: IdentifierField.cxx:224
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
AtlasDetectorID::pixel_field_value
int pixel_field_value() const
Definition: AtlasDetectorID.h:626
PixelID::m_eta_mod_impl
IdDictFieldImplementation m_eta_mod_impl
Definition: PixelID.h:317
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:173
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
PixelID::m_ETA_MODULE_OFFSET
int m_ETA_MODULE_OFFSET
Definition: PixelID.h:298
IdDictFieldImplementation::decode_index
bool decode_index() const
Definition: IdDictFieldImplementation.h:231
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
PixelID::m_ETA_MODULE_INDEX
size_type m_ETA_MODULE_INDEX
Definition: PixelID.h:295
PixelID::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: PixelID.cxx:413
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
PixelID::m_baseExpandedIdentifier
ExpandedIdentifier m_baseExpandedIdentifier
Definition: PixelID.h:287
PixelID::m_wafer_vec
id_vec m_wafer_vec
Definition: PixelID.h:306
PixelID::eta_module_max
int eta_module_max(const Identifier &id) const
Definition: PixelID.cxx:77
PixelID::pixel_hash_max
size_type pixel_hash_max(void) const
Definition: PixelID.cxx:836
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:45
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictRegion.h:20
IdDictDictionary::m_version
std::string m_version
Definition: IdDictDictionary.h:217
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PixelID::m_PIXEL_INDEX
size_type m_PIXEL_INDEX
Definition: PixelID.h:291
PixelID::m_bec_eta_mod_impl
IdDictFieldImplementation m_bec_eta_mod_impl
Definition: PixelID.h:324
IdDictDefs.h
PixelID::initLevelsFromDict
int initLevelsFromDict(void)
Definition: PixelID.cxx:596
IdDictMgr
Definition: IdDictMgr.h:14
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
IdDictFieldImplementation::shift
size_type shift() const
Definition: IdDictFieldImplementation.h:226
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
PixelID::m_pixel_hash_max
size_type m_pixel_hash_max
Definition: PixelID.h:304
PixelID::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: PixelID.cxx:426
PixelID::m_baseIdentifier
Identifier m_baseIdentifier
Definition: PixelID.h:286
PixelID::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: PixelID.cxx:857
PixelID::phi_index_max
int phi_index_max(const Identifier &id) const
Definition: PixelID.cxx:141
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
IdentifierField::empty
bool empty() const
Definition: IdentifierField.h:114
MultiRange::const_identifier_factory
Definition: MultiRange.h:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelID::eta_index_max
int eta_index_max(const Identifier &id) const
Definition: PixelID.cxx:160
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
PixelID::pixel_begin
const_expanded_id_iterator pixel_begin(void) const
For pixel ids, only expanded id iterators are available.
Definition: PixelID.cxx:848
IdDictFieldImplementation::bits_offset
size_type bits_offset() const
Definition: IdDictFieldImplementation.h:208
PixelID::m_full_wafer_range
MultiRange m_full_wafer_range
Definition: PixelID.h:301
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDictionary.h:235
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
PixelID::pixel_id_checks
void pixel_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
Definition: PixelID.cxx:43
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
IdentifierField::get_next
bool get_next(element_type current, element_type &next) const
Definition: IdentifierField.cxx:149
createCablingJSON.eta_index
int eta_index
Definition: createCablingJSON.py:14
PixelID::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: PixelID.cxx:452
IdDictFieldImplementation::ored_field
const Range::field & ored_field() const
Definition: IdDictFieldImplementation.h:196
IdentifierHash::is_valid
bool is_valid() const
Check if id is in a valid state.
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
PixelID::phi_module_max
int phi_module_max(const Identifier &id) const
Definition: PixelID.cxx:121
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:73
PixelID::init_neighbors
int init_neighbors(void)
Definition: PixelID.cxx:464
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
PixelID::test_wafer_packing
void test_wafer_packing(void) const
Tests of packing.
Definition: PixelID.cxx:929
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
PixelID::m_next_phi_wafer_vec
hash_vec m_next_phi_wafer_vec
Definition: PixelID.h:308
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
IdentifierHash.h
PixelID::m_prev_phi_wafer_vec
hash_vec m_prev_phi_wafer_vec
Definition: PixelID.h:307
RangeIterator.h
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:831
AtlasDetectorID::setDictVersion
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
Definition: AtlasDetectorID.cxx:759
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
PixelID::layer_disk_max
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
Definition: PixelID.cxx:59
IdDictDictionary
Definition: IdDictDictionary.h:30
PixelID::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: PixelID.cxx:874
PixelID::is_eta_module_max
bool is_eta_module_max(const Identifier &id) const
For the barrel.
Definition: PixelID.cxx:117
PixelID::m_pixel_region_index
size_type m_pixel_region_index
Definition: PixelID.h:289
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
AtlasDetectorID::pixel
Identifier pixel(void) const
Definition: AtlasDetectorID.cxx:73
PixelID::eta_module_min
int eta_module_min(const Identifier &id) const
Definition: PixelID.cxx:94
DeMoScan.index
string index
Definition: DeMoScan.py:364
PixelID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: PixelID.h:259
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
IdDictFieldImplementation::zeroing_mask
value_type zeroing_mask() const
Definition: IdDictFieldImplementation.h:220
IdDictDictionary::m_name
std::string m_name
Definition: IdDictDictionary.h:216
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
PixelID::wafer_context
IdContext wafer_context(void) const
Definition: PixelID.h:590
PixelID::wafer_id_checks
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
Definition: PixelID.cxx:28
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:432
PixelID::m_eta_index_impl
IdDictFieldImplementation m_eta_index_impl
Definition: PixelID.h:323
PixelID::m_phi_mod_impl
IdDictFieldImplementation m_phi_mod_impl
Definition: PixelID.h:316
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
PixelID::m_barrel_field
Range::field m_barrel_field
Definition: PixelID.h:305
PixelID::is_phi_module_max
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
Definition: PixelID.cxx:178
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
PixelID::m_lay_disk_shift_impl
IdDictFieldImplementation m_lay_disk_shift_impl
Definition: PixelID.h:319
ExpandedIdentifier::clear
void clear()
Erase all fields.
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
PixelID::m_prev_eta_wafer_vec
hash_vec m_prev_eta_wafer_vec
Definition: PixelID.h:309
PixelID::m_LAYER_DISK_INDEX
size_type m_LAYER_DISK_INDEX
Definition: PixelID.h:293
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
IdentifierField::show
void show() const
Definition: IdentifierField.cxx:376
PixelID::size_type
Identifier::size_type size_type
Definition: PixelID.h:71
IdDictField
Definition: IdDictField.h:15
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: MultiRange.cxx:82
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
PixelID::m_PHI_MODULE_INDEX
size_type m_PHI_MODULE_INDEX
Definition: PixelID.h:294
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
PixelID::pixel_end
const_expanded_id_iterator pixel_end(void) const
Definition: PixelID.cxx:852
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
PixelID::m_lay_disk_impl
IdDictFieldImplementation m_lay_disk_impl
Definition: PixelID.h:315
PixelID::m_dict
const IdDictDictionary * m_dict
Definition: PixelID.h:300
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictRegion.h:42
IdDictFieldImplementation::mask
size_type mask() const
Definition: IdDictFieldImplementation.h:214
PixelID::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: PixelID.cxx:439
IdentifierField::add_value
void add_value(element_type value)
Definition: IdentifierField.cxx:250
PixelID::m_pixel_impl
IdDictFieldImplementation m_pixel_impl
Definition: PixelID.h:313
IdDictFieldImplementation::bits
size_type bits() const
Definition: IdDictFieldImplementation.h:202
PixelID::m_PHI_INDEX_INDEX
size_type m_PHI_INDEX_INDEX
Definition: PixelID.h:296
Identifier
Definition: IdentifierFieldParser.cxx:14