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 
23 {
25  m_dbm_field.add_value(0); //DBM
26 }
27 
28 void
29 PixelID::wafer_id_checks(int barrel_ec,int layer_disk,int phi_module,int eta_module) const {
30 
31  // Fill expanded id
35  if (!m_full_wafer_range.match(id)) { // module range check is sufficient
36  MsgStream log(m_msgSvc, "PixelID");
37  if (m_msgSvc) log << MSG::ERROR << " PixelID::wafer_id result is NOT ok. ID, range "
38  << (std::string) id << " " << (std::string) m_full_wafer_range << endmsg;
39  else std::cout << " ERROR PixelID::wafer_id result is NOT ok. ID, range "
40  << (std::string) id << " " << (std::string) m_full_wafer_range << std::endl;
41  }
42 }
43 
44 void
45 PixelID::pixel_id_checks(int barrel_ec,int layer_disk,int phi_module,int eta_module,
46  int phi_index,int eta_index) const {
47  // Check that id is within allowed range
48  // Fill expanded id
52  if (!m_full_pixel_range.match(id)) {
53  MsgStream log(m_msgSvc, "PixelID");
54  if (m_msgSvc) log << MSG::ERROR << " PixelID::pixel_id result is NOT ok. ID, range "
55  << (std::string) id << " " << (std::string) m_full_pixel_range << endmsg;
56  else std::cout << " ERROR PixelID::pixel_id result is NOT ok. ID, range "
57  << (std::string) id << " " << (std::string) m_full_pixel_range << std::endl;
58  }
59 }
60 
61 int
63  // get max from dictionary
64  ExpandedIdentifier expId;
65  IdContext wafer_context1 = wafer_context();
66  get_expanded_id(id, expId, &wafer_context1);
67  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
68  const Range& range = m_full_wafer_range[i];
69  if (range.match(expId)) {
70  const Range::field& layer_disk_field = range[m_LAYER_DISK_INDEX];
71  if (not layer_disk_field.empty()) {
72  return(layer_disk_field.get_maximum());
73  }
74  }
75  }
76  return(-999); // default
77 }
78 
79 int
81  // get max from dictionary
82  ExpandedIdentifier expId;
83  IdContext wafer_context1 = wafer_context();
84  get_expanded_id(id, expId, &wafer_context1);
85  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
86  const Range& range = m_full_wafer_range[i];
87  if (range.match(expId)) {
88  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
89  if (not eta_field.empty()) {
90  return(eta_field.get_maximum());
91  }
92  }
93  }
94  return(-999);
95 }
96 
97 int PixelID::eta_module_min(const Identifier& id) const {
98  // get min from dictionary
99  ExpandedIdentifier expId;
100  IdContext wafer_context1 = wafer_context();
101  get_expanded_id(id, expId, &wafer_context1);
102  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
103  const Range& range = m_full_wafer_range[i];
104  if (range.match(expId)) {
105  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
106  if (not eta_field.empty()) {
107  return(eta_field.get_minimum());
108  }
109  }
110  }
111  return(-999);
112 }
113 
114 bool
116  return(eta_module(id) == eta_module_min(id));
117 }
118 
119 bool
121  return(eta_module(id) == eta_module_max(id));
122 }
123 
124 int PixelID::phi_module_max(const Identifier& id) const {
125  // get max from dictionary
126  ExpandedIdentifier expId;
127  IdContext wafer_context1 = wafer_context();
128 
129  get_expanded_id(id, expId, &wafer_context1);
130  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
131  const Range& range = m_full_wafer_range[i];
132  if (range.match(expId)) {
133  const Range::field& phi_field = range[m_PHI_MODULE_INDEX];
134  if (not phi_field.empty()) {
135  return(phi_field.get_maximum());
136  }
137  }
138  }
139  // Failed to find the max
140  return(-999);
141 }
142 
143 int
145  // get max from dictionary
146  ExpandedIdentifier expId;
147  IdContext wafer_context1 = wafer_context();
148  get_expanded_id(id, expId, &wafer_context1);
149  for (unsigned int i = 0; i < m_full_pixel_range.size(); ++i) {
150  const Range& range = m_full_pixel_range[i];
151  if (range.match(expId)) {
152  const Range::field& phi_field = range[m_PHI_INDEX_INDEX];
153  if (not phi_field.empty()) {
154  return(phi_field.get_maximum());
155  }
156  }
157  }
158  // Failed to find the max
159  return(-999);
160 }
161 
162 int
164  // get max from dictionary
165  ExpandedIdentifier expId;
166  IdContext wafer_context1 = wafer_context();
167  get_expanded_id(id, expId, &wafer_context1);
168  for (unsigned int i = 0; i < m_full_pixel_range.size(); ++i) {
169  const Range& range = m_full_pixel_range[i];
170  if (range.match(expId)) {
171  const Range::field& eta_field = range[m_ETA_INDEX_INDEX];
172  if (not eta_field.empty()) {
173  return(eta_field.get_maximum());
174  }
175  }
176  }
177  return(-999); // default
178 }
179 
180 bool
182  return(phi_module(id) == phi_module_max(id));
183 }
184 
185 int
187  MsgStream log(m_msgSvc, "PixelID");
188 
189  if (m_msgSvc) log << MSG::INFO << "Initialize from dictionary" << endmsg;
190  else std::cout << " INFO Initialize from dictionary" << std::endl;
191 
192  // Check whether this helper should be reinitialized
193  if (!reinitialize(dict_mgr)) {
194  if (m_msgSvc) log << MSG::INFO << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
195  else std::cout << " INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
196  return(0);
197  } else {
198  if (m_msgSvc) log << MSG::DEBUG << "(Re)initialize" << endmsg;
199  else std::cout << " DEBUG (Re)initialize" << std::endl;
200  }
201 
202  // init base object
203  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return(1);
204 
205  // Register version of InnerDetector dictionary
206  if (register_dict_tag(dict_mgr, "InnerDetector")) return(1);
207 
208  m_dict = dict_mgr.find_dictionary("InnerDetector");
209  if (!m_dict) {
210  if (m_msgSvc) log << MSG::FATAL << " PixelID::initialize_from_dict - cannot access InnerDetector dictionary "
211  << endmsg;
212  else std::cout << " FATAL PixelID::initialize_from_dict - cannot access InnerDetector dictionary "
213  << std::endl;
214  return(1);
215  }
216 
217  AtlasDetectorID::setDictVersion(dict_mgr, "InnerDetector");
218 
219  // Initialize the field indices
220  if (initLevelsFromDict()) return(1);
221 
222  // save indet id
223  m_pixel_id = pixel();
224  if (!is_pixel(m_pixel_id)) {
225  if (m_msgSvc) log << MSG::FATAL << " PixelID::initialize_from_dict - cannot get pixel id dictionary "
226  << endmsg;
227  else std::cout << " FATAL PixelID::initialize_from_dict - cannot get pixel id dictionary "
228  << std::endl;
229  return(1);
230  }
231 
232  //
233  // Set barrel field for testing is_barrel
234  //
235  int barrel_value;
237  // barrel
238  if (m_dict->get_label_value("barrel_endcap", "barrel", barrel_value)) {
239  if (m_msgSvc) log << MSG::FATAL << "Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
240  << m_dict->m_name
241  << endmsg;
242  else std::cout << " FATAL Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
243  << m_dict->m_name
244  << std::endl;
245  return(1);
246  }
247  m_barrel_field.add_value(barrel_value);
248  m_barrel_field.add_value(barrel_value);
249  if (m_msgSvc) log << MSG::DEBUG << " PixelID::initialize_from_dict "
250  << "Set barrel field values: "
251  << (std::string) m_barrel_field
252  << endmsg;
253  else std::cout << " DEBUG PixelID::initialize_from_dict "
254  << "Set barrel field values: "
255  << (std::string) m_barrel_field
256  << std::endl;
257 
258  //DBM
259  //Set dbm field for testing is_dbm
260  //
261  // WARNING:
262  // modified to skip DBM when aprorpiate dictionary is not present
263  // by adding +999 or -999 to the field
264  //
265 
266  int dbm_value;
267  m_dbm_field.clear();
268  if (m_dict->get_label_value("barrel_endcap", "negative_dbm", dbm_value)) {
269  if (m_dict->m_version.find("DBM") != std::string::npos) {
270  if (m_msgSvc) log << MSG::WARNING <<
271  "Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
272  << m_dict->m_name
273  << endmsg;
274  else std::cout << " WARNING Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
275  << m_dict->m_name
276  << std::endl;
277  }
278  //return (1);
279  m_dbm_field.add_value(-999);
280  } else {
281  m_dbm_field.add_value(dbm_value);
282  }
283  if (m_dict->get_label_value("barrel_endcap", "positive_dbm", dbm_value)) {
284  if (m_dict->m_version.find("DBM") != std::string::npos) {
285  if (m_msgSvc) log << MSG::WARNING <<
286  "Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
287  << m_dict->m_name
288  << endmsg;
289  else std::cout << " WARNING Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
290  << m_dict->m_name
291  << std::endl;
292  }
293  //return (1);
294  m_dbm_field.add_value(999);
295  } else {
296  m_dbm_field.add_value(dbm_value);
297  }
298  if (m_msgSvc) log << MSG::DEBUG << " PixelID::initialize_from_dict "
299  << "Set dbm field values: "
300  << (std::string) m_dbm_field
301  << endmsg;
302  else std::cout << " DEBUG PixelID::initialize_from_dict "
303  << "Set dbm field values: "
304  << (std::string) m_dbm_field
305  << std::endl;
306 
307 
308  //
309  // Build multirange for the valid set of identifiers
310  //
311 
312 
313  // Find value for the field InnerDetector
314  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
315  int inDetField = -1;
316  if (atlasDict->get_label_value("subdet", "InnerDetector", inDetField)) {
317  if (m_msgSvc) log << MSG::FATAL << "Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
318  << atlasDict->m_name
319  << endmsg;
320  else std::cout << " FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
321  << atlasDict->m_name
322  << std::endl;
323  return(1);
324  }
325 
326  // Find value for the field PIXEL
327  int pixelField = -1;
328  if (m_dict->get_label_value("part", "Pixel", pixelField)) {
329  if (m_msgSvc) log << MSG::FATAL << "Could not get value for label 'Pixel' of field 'part' in dictionary "
330  << m_dict->m_name
331  << endmsg;
332  else std::cout << " FATAL Could not get value for label 'Pixel' of field 'part' in dictionary "
333  << m_dict->m_name
334  << std::endl;
335  return(1);
336  }
337  if (m_msgSvc) log << MSG::DEBUG << " PixelID::initialize_from_dict "
338  << "Found field values: InDet/Pixel "
339  << inDetField << "/"
340  << pixelField
341  << endmsg;
342  else std::cout << " DEBUG PixelID::initialize_from_dict "
343  << "Found field values: InDet/Pixel "
344  << inDetField << "/"
345  << pixelField
346  << std::endl;
347 
348  // Set up id for region and range prefix
350  region_id.add(inDetField);
351  region_id.add(pixelField);
352  Range prefix;
355 
356  // Set the base identifier for Pixel
360 
361  // Set the base expanded identifier for Pixel
363 
364  // Setup the hash tables
365  if (init_hashes()) return(1);
366 
367  // Setup hash tables for finding neighbors
368  if (init_neighbors()) return(1);
369 
370  if (m_msgSvc) {
371  log << MSG::DEBUG << " PixelID::initialize_from_dict "
372  << endmsg;
373  log << MSG::DEBUG
374  << "Wafer range -> " << (std::string) m_full_wafer_range
375  << endmsg;
376  log << MSG::DEBUG
377  << "Pixel range -> " << (std::string) m_full_pixel_range
378  << endmsg;
379  } else {
380  std::cout << " DEBUG PixelID::initialize_from_dict "
381  << std::endl;
382  std::cout << " DEBUG Wafer range -> " << (std::string) m_full_wafer_range
383  << std::endl;
384  std::cout << " DEBUG Pixel range -> " << (std::string) m_full_pixel_range
385  << std::endl;
386  }
387  return 0;
388 }
389 
390 int
392  //
393  // create a vector(s) to retrieve the hashes for compact ids. For
394  // the moment, we implement a hash for wafers but NOT for pixels
395  // (too many)
396  //
397 
398  MsgStream log(m_msgSvc, "PixelID");
399 
400  // wafer hash
402  m_wafer_vec.clear();
404  unsigned int nids = 0;
405  std::set<Identifier> ids;
406  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
407  const Range& range = m_full_wafer_range[i];
409  for (const auto & exp_id:rit) {
411  exp_id[m_LAYER_DISK_INDEX],
412  exp_id[m_PHI_MODULE_INDEX],
413  exp_id[m_ETA_MODULE_INDEX]);
414  if (!(ids.insert(id)).second) {
415  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_hashes "
416  << " Error: duplicated id for wafer id. nid " << nids
417  << " id " << show_to_string(id)
418  << " exp id " << (std::string) exp_id
419  << " " << (std::string) m_full_wafer_range << endmsg;
420  else std::cout << " FATAL PixelID::init_hashes "
421  << " Error: duplicated id for wafer id. nid " << nids
422  << " id " << show_to_string(id)
423  << " exp id " << (std::string) exp_id
424  << " " << (std::string) m_full_wafer_range << std::endl;
425  return(1);
426  }
427  nids++;
428  }
429  }
430  if (ids.size() != m_wafer_hash_max) {
431  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_hashes "
432  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
433  << " hash max " << m_wafer_hash_max
434  << endmsg;
435  else std::cout << " FATAL PixelID::init_hashes "
436  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
437  << " hash max " << m_wafer_hash_max
438  << std::endl;
439  return(1);
440  }
441 
442  nids = 0;
443  std::set<Identifier>::const_iterator first = ids.begin();
444  std::set<Identifier>::const_iterator last = ids.end();
445  for (; first != last && nids < m_wafer_vec.size(); ++first) {
446  m_wafer_vec[nids] = (*first);
447  nids++;
448  }
449 
450  // pixel hash - we do not keep a vec for the pixels - too large
452 
453  return(0);
454 }
455 
456 int
458  unsigned short index = id;
459 
460  if (index < m_prev_phi_wafer_vec.size()) {
461  if (m_prev_phi_wafer_vec[index] == NOT_VALID_HASH) return(1);
462 
463  prev = m_prev_phi_wafer_vec[index];
464  return(0);
465  }
466  return(1);
467 }
468 
469 int
471  unsigned short index = id;
472 
473  if (index < m_next_phi_wafer_vec.size()) {
474  if (m_next_phi_wafer_vec[index] == NOT_VALID_HASH) return(1);
475 
477  return(0);
478  }
479  return(1);
480 }
481 
482 int
484  unsigned short index = id;
485 
486  if (index < m_prev_eta_wafer_vec.size()) {
487  if (m_prev_eta_wafer_vec[index] == NOT_VALID_HASH) return(1);
488 
489  prev = m_prev_eta_wafer_vec[index];
490  return(0);
491  }
492  return(1);
493 }
494 
495 int
497  unsigned short index = id;
498  if (index < m_next_eta_wafer_vec.size()) {
499  if (m_next_eta_wafer_vec[index] == NOT_VALID_HASH) return(1);
500 
502  return(0);
503  }
504  return(1);
505 }
506 
507 int
509  //
510  // create a vector(s) to retrieve the hashes for compact ids for
511  // wafer neighbors.
512  //
513  MsgStream log(m_msgSvc, "PixelID");
514 
515  if (m_msgSvc) log << MSG::DEBUG << "PixelID::init_neighbors " << endmsg;
516  else std::cout << " DEBUG PixelID::init_neighbors " << std::endl;
517 
518  m_prev_phi_wafer_vec.clear();
519  m_next_phi_wafer_vec.clear();
520  m_prev_eta_wafer_vec.clear();
521  m_next_eta_wafer_vec.clear();
526 
527  for (unsigned int i = 0; i < m_full_wafer_range.size(); ++i) {
528  const Range& range = m_full_wafer_range[i];
529  const Range::field& phi_field = range[m_PHI_MODULE_INDEX];
530  const Range::field& eta_field = range[m_ETA_MODULE_INDEX];
531 
532  // save the lowest value of the module offset
534  eta_field.get_minimum() : m_ETA_MODULE_OFFSET;
536  for (const auto & exp_id: rit) {
541  bool pphi = phi_field.get_previous(exp_id[m_PHI_MODULE_INDEX], previous_phi);
542  bool nphi = phi_field.get_next(exp_id[m_PHI_MODULE_INDEX], next_phi);
543  bool peta = eta_field.get_previous(exp_id[m_ETA_MODULE_INDEX], previous_eta);
544  bool neta = eta_field.get_next(exp_id[m_ETA_MODULE_INDEX], next_eta);
545 
546  IdContext wcontext = wafer_context();
547 
548  // First get primary hash id
549  IdentifierHash hash_id;
551  exp_id[m_LAYER_DISK_INDEX],
552  exp_id[m_PHI_MODULE_INDEX],
553  exp_id[m_ETA_MODULE_INDEX]);
554  if (get_hash(id, hash_id, &wcontext)) {
555  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_neighbors - unable to get hash, exp/compact "
556  << id.getString() << " " << show_to_string(id) << endmsg;
557  else std::cout << " FATAL PixelID::init_neighbors - unable to get hash, exp/compact "
558  << id.getString() << " " << show_to_string(id) << std::endl;
559  return(1);
560  }
561 
562  // index for the subsequent arrays
563  unsigned short index = hash_id;
564  assert(hash_id < m_prev_phi_wafer_vec.size());
565  assert(hash_id < m_next_phi_wafer_vec.size());
566  assert(hash_id < m_prev_eta_wafer_vec.size());
567  assert(hash_id < m_next_eta_wafer_vec.size());
568 
569  if (pphi) {
570  // Get previous phi hash id
571  ExpandedIdentifier expId = exp_id;
572  expId[m_PHI_MODULE_INDEX] = previous_phi;
574  expId[m_LAYER_DISK_INDEX],
575  expId[m_PHI_MODULE_INDEX],
576  expId[m_ETA_MODULE_INDEX]);
577  if (get_hash(id, hash_id, &wcontext)) {
578  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
579  << id.getString() << " " << show_to_string(id) << endmsg;
580  else std::cout << " FATAL PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
581  << id.getString() << " " << show_to_string(id) << std::endl;
582  return(1);
583  }
584  m_prev_phi_wafer_vec[index] = hash_id;
585  }
586 
587  if (nphi) {
588  // Get next phi hash id
589  ExpandedIdentifier expId = exp_id;
590  expId[m_PHI_MODULE_INDEX] = next_phi;
592  expId[m_LAYER_DISK_INDEX],
593  expId[m_PHI_MODULE_INDEX],
594  expId[m_ETA_MODULE_INDEX]);
595  if (get_hash(id, hash_id, &wcontext)) {
596  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_neighbors - unable to get next phi hash, exp/compact " <<
597  id.getString() << " " << show_to_string(id) << endmsg;
598  else std::cout << " FATAL PixelID::init_neighbors - unable to get next phi hash, exp/compact " <<
599  id.getString() << " " << show_to_string(id) << std::endl;
600  return(1);
601  }
602  m_next_phi_wafer_vec[index] = hash_id;
603  }
604 
605  if (peta) {
606  // Get previous eta hash id
607  ExpandedIdentifier expId = exp_id;
608  expId[m_ETA_MODULE_INDEX] = previous_eta;
610  expId[m_LAYER_DISK_INDEX],
611  expId[m_PHI_MODULE_INDEX],
612  expId[m_ETA_MODULE_INDEX]);
613  if (get_hash(id, hash_id, &wcontext)) {
614  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
615  << id.getString() << " " << show_to_string(id) << endmsg;
616  else std::cout << " FATAL PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
617  << id.getString() << " " << show_to_string(id) << std::endl;
618  return(1);
619  }
620  m_prev_eta_wafer_vec[index] = hash_id;
621  }
622 
623  if (neta) {
624  // Get next eta hash id
625  ExpandedIdentifier expId = exp_id;
626  expId[m_ETA_MODULE_INDEX] = next_eta;
628  expId[m_LAYER_DISK_INDEX],
629  expId[m_PHI_MODULE_INDEX],
630  expId[m_ETA_MODULE_INDEX]);
631  if (get_hash(id, hash_id, &wcontext)) {
632  if (m_msgSvc) log << MSG::FATAL << " PixelID::init_neighbors - unable to get next eta hash, exp/compact "
633  << id.getString() << " " << show_to_string(id) << endmsg;
634  else std::cout << " FATAL PixelID::init_neighbors - unable to get next eta hash, exp/compact "
635  << id.getString() << " " << show_to_string(id) << std::endl;
636  return(1);
637  }
638  m_next_eta_wafer_vec[index] = hash_id;
639  }
640  }
641  }
642  return(0);
643 }
644 
645 int
647  MsgStream log(m_msgSvc, "PixelID");
648 
649  if (!m_dict) {
650  if (m_msgSvc) log << MSG::FATAL << " PixelID::initLevelsFromDict - dictionary NOT initialized " << endmsg;
651  else std::cout << " FATAL PixelID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
652  return(1);
653  }
654 
655  // Find out which identifier field corresponds to each level. Use
656  // names to find each field/leve.
657 
658  m_INDET_INDEX = 999;
659  m_PIXEL_INDEX = 999;
660  m_BARREL_EC_INDEX = 999;
661  m_LAYER_DISK_INDEX = 999;
662  m_PHI_MODULE_INDEX = 999;
663  m_ETA_MODULE_INDEX = 999;
664  m_PHI_INDEX_INDEX = 999;
665  m_ETA_INDEX_INDEX = 999;
666 
667  // Save index to a PIXEL region for unpacking
671  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
672  << (std::string) id << " " << m_pixel_region_index
673  << endmsg;
674  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
675  << (std::string) id << " " << m_pixel_region_index
676  << std::endl;
677  return(1);
678  }
679 
680  // Get levels
681  IdDictField* field = m_dict->find_field("subdet");
682  if (field) {
683  m_INDET_INDEX = field->m_index;
684  } else {
685  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'subdet' field "
686  << endmsg;
687  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'subdet' field "
688  << std::endl;
689  return(1);
690  }
691 
692  field = m_dict->find_field("part");
693  if (field) {
694  m_PIXEL_INDEX = field->m_index;
695  } else {
696  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'part' field " << endmsg;
697  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'part' field " << std::endl;
698  return(1);
699  }
700 
701  field = m_dict->find_field("barrel_endcap");
702  if (field) {
703  m_BARREL_EC_INDEX = field->m_index;
704  } else {
705  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'barrel_endcap' field " << endmsg;
706  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'barrel_endcap' field " << std::endl;
707  return(1);
708  }
709 
710  field = m_dict->find_field("layer");
711  if (field) {
712  m_LAYER_DISK_INDEX = field->m_index;
713  } else {
714  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'layer' field " << endmsg;
715  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'layer' field " << std::endl;
716  return(1);
717  }
718 
719  field = m_dict->find_field("phi_module");
720  if (field) {
721  m_PHI_MODULE_INDEX = field->m_index;
722  } else {
723  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'phi_module' field " << endmsg;
724  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'phi_module' field " << std::endl;
725  return(1);
726  }
727  field = m_dict->find_field("eta_module");
728  if (field) {
729  m_ETA_MODULE_INDEX = field->m_index;
730  } else {
731  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'eta_module' field " << endmsg;
732  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'eta_module' field " << std::endl;
733  return(1);
734  }
735  field = m_dict->find_field("phi_index");
736  if (field) {
737  m_PHI_INDEX_INDEX = field->m_index;
738  } else {
739  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'phi_index' field " << endmsg;
740  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'phi_index' field " << std::endl;
741  return(1);
742  }
743  field = m_dict->find_field("eta_index");
744  if (field) {
745  m_ETA_INDEX_INDEX = field->m_index;
746  } else {
747  if (m_msgSvc) log << MSG::FATAL << "PixelID::initLevelsFromDict - unable to find 'eta_index' field " << endmsg;
748  else std::cout << " FATAL PixelID::initLevelsFromDict - unable to find 'eta_index' field " << std::endl;
749  return(1);
750  }
751 
752  // Set the field implementations: for bec, lay/disk, eta/phi mod
753  // there are two kinds - shifted and non-shifted
754 
756 
765 
766  if (m_msgSvc) {
767  log << MSG::DEBUG << "decode index and bit fields for each level: " << endmsg;
768  log << MSG::DEBUG << "indet " << m_indet_impl.show_to_string() << endmsg;
769  log << MSG::DEBUG << "pixel " << m_pixel_impl.show_to_string() << endmsg;
770  log << MSG::DEBUG << "bec " << m_bec_impl.show_to_string() << endmsg;
771  log << MSG::DEBUG << "bec_shift " << m_bec_shift_impl.show_to_string() << endmsg;
772  log << MSG::DEBUG << "lay_disk " << m_lay_disk_impl.show_to_string() << endmsg;
773  log << MSG::DEBUG << "lay_disk_shift " << m_lay_disk_shift_impl.show_to_string() << endmsg;
774  log << MSG::DEBUG << "phi_mod " << m_phi_mod_impl.show_to_string() << endmsg;
775  log << MSG::DEBUG << "phi_mod_shift " << m_phi_mod_shift_impl.show_to_string() << endmsg;
776  log << MSG::DEBUG << "eta_mod " << m_eta_mod_impl.show_to_string() << endmsg;
777  log << MSG::DEBUG << "eta_mod_shift " << m_eta_mod_shift_impl.show_to_string() << endmsg;
778  log << MSG::DEBUG << "phi_index " << m_phi_index_impl.show_to_string() << endmsg;
779  log << MSG::DEBUG << "eta_index " << m_eta_index_impl.show_to_string() << endmsg;
780  log << MSG::DEBUG << "bec_eta_mod " << m_bec_eta_mod_impl.show_to_string() << endmsg;
781  } else {
782  std::cout << " DEBUG decode index and bit fields for each level: " << std::endl;
783  std::cout << " DEBUG indet " << m_indet_impl.show_to_string() << std::endl;
784  std::cout << " DEBUG pixel " << m_pixel_impl.show_to_string() << std::endl;
785  std::cout << " DEBUG bec " << m_bec_impl.show_to_string() << std::endl;
786  std::cout << " DEBUG bec_shift " << m_bec_shift_impl.show_to_string() << std::endl;
787  std::cout << " DEBUG lay_disk " << m_lay_disk_impl.show_to_string() << std::endl;
788  std::cout << " DEBUG lay_disk_shift " << m_lay_disk_shift_impl.show_to_string() << std::endl;
789  std::cout << " DEBUG phi_mod " << m_phi_mod_impl.show_to_string() << std::endl;
790  std::cout << " DEBUG phi_mod_shift " << m_phi_mod_shift_impl.show_to_string() << std::endl;
791  std::cout << " DEBUG eta_mod " << m_eta_mod_impl.show_to_string() << std::endl;
792  std::cout << " DEBUG eta_mod_shift " << m_eta_mod_shift_impl.show_to_string() << std::endl;
793  std::cout << " DEBUG phi_index " << m_phi_index_impl.show_to_string() << std::endl;
794  std::cout << " DEBUG eta_index " << m_eta_index_impl.show_to_string() << std::endl;
795  std::cout << " DEBUG bec_eta_mod " << m_bec_eta_mod_impl.show_to_string() << std::endl;
796  }
797 
798 
799 
800  std::cout << "indet " << m_indet_impl.decode_index() << " "
801  << (std::string) m_indet_impl.ored_field() << " "
802  << std::hex << m_indet_impl.mask() << " "
803  << m_indet_impl.zeroing_mask() << " "
804  << std::dec << m_indet_impl.shift()
805  << " " << m_indet_impl.bits() << " " << m_indet_impl.bits_offset() << " ";
807  std::cout << "pixel " << m_pixel_impl.decode_index() << " "
808  << (std::string) m_pixel_impl.ored_field() << " "
809  << std::hex << m_pixel_impl.mask() << " "
810  << m_pixel_impl.zeroing_mask() << " "
811  << std::dec << m_pixel_impl.shift()
812  << " " << m_pixel_impl.bits() << " " << m_pixel_impl.bits_offset() << " ";
814  std::cout << "bec " << m_bec_impl.decode_index() << " "
815  << (std::string) m_bec_impl.ored_field() << " "
816  << std::hex << m_bec_impl.mask() << " "
817  << m_bec_impl.zeroing_mask() << " "
818  << std::dec << m_bec_impl.shift()
819  << " " << m_bec_impl.bits() << " " << m_bec_impl.bits_offset() << " ";
821  std::cout << "bec_shift " << m_bec_shift_impl.decode_index() << " "
822  << (std::string) m_bec_shift_impl.ored_field() << " "
823  << std::hex << m_bec_shift_impl.mask() << " "
824  << m_bec_shift_impl.zeroing_mask() << " "
825  << std::dec << m_bec_shift_impl.shift()
826  << " " << m_bec_shift_impl.bits() << " " << m_bec_shift_impl.bits_offset() << " ";
828  std::cout << "lay_disk " << m_lay_disk_impl.decode_index() << " "
829  << (std::string) m_lay_disk_impl.ored_field() << " "
830  << std::hex << m_lay_disk_impl.mask() << " "
831  << m_lay_disk_impl.zeroing_mask() << " "
832  << std::dec << m_lay_disk_impl.shift()
833  << " " << m_lay_disk_impl.bits() << " " << m_lay_disk_impl.bits_offset() << " ";
835  std::cout << "lay_disk_shift " << m_lay_disk_shift_impl.decode_index() << " "
836  << (std::string) m_lay_disk_shift_impl.ored_field() << " "
837  << std::hex << m_lay_disk_shift_impl.mask() << " "
839  << std::dec << m_lay_disk_shift_impl.shift()
840  << " " << m_lay_disk_shift_impl.bits() << " " << m_lay_disk_shift_impl.bits_offset() << " ";
842  std::cout << "phi_mod " << m_phi_mod_impl.decode_index() << " "
843  << (std::string) m_phi_mod_impl.ored_field() << " "
844  << std::hex << m_phi_mod_impl.mask() << " "
845  << m_phi_mod_impl.zeroing_mask() << " "
846  << std::dec << m_phi_mod_impl.shift()
847  << " " << m_phi_mod_impl.bits() << " " << m_phi_mod_impl.bits_offset() << " ";
849  std::cout << "phi_mod_shift " << m_phi_mod_shift_impl.decode_index() << " "
850  << (std::string) m_phi_mod_shift_impl.ored_field() << " "
851  << std::hex << m_phi_mod_shift_impl.mask() << " "
853  << std::dec << m_phi_mod_shift_impl.shift()
854  << " " << m_phi_mod_shift_impl.bits() << " " << m_phi_mod_shift_impl.bits_offset() << " ";
856  std::cout << "eta_mod " << m_eta_mod_impl.decode_index() << " "
857  << (std::string) m_eta_mod_impl.ored_field() << " "
858  << std::hex << m_eta_mod_impl.mask() << " "
859  << m_eta_mod_impl.zeroing_mask() << " "
860  << std::dec << m_eta_mod_impl.shift()
861  << " " << m_eta_mod_impl.bits() << " " << m_eta_mod_impl.bits_offset() << " ";
863  std::cout << "eta_mod_shift " << m_eta_mod_shift_impl.decode_index() << " "
864  << (std::string) m_eta_mod_shift_impl.ored_field() << " "
865  << std::hex << m_eta_mod_shift_impl.mask() << " "
867  << std::dec << m_eta_mod_shift_impl.shift()
868  << " " << m_eta_mod_shift_impl.bits() << " " << m_eta_mod_shift_impl.bits_offset() << " ";
870  std::cout << "phi_index " << m_phi_index_impl.decode_index() << " "
871  << (std::string) m_phi_index_impl.ored_field() << " "
872  << std::hex << m_phi_index_impl.mask() << " "
873  << m_phi_index_impl.zeroing_mask() << " "
874  << std::dec << m_phi_index_impl.shift()
875  << " " << m_phi_index_impl.bits() << " " << m_phi_index_impl.bits_offset() << " ";
877  std::cout << "eta_index " << m_eta_index_impl.decode_index() << " "
878  << (std::string) m_eta_index_impl.ored_field() << " "
879  << std::hex << m_eta_index_impl.mask() << " "
880  << m_eta_index_impl.zeroing_mask() << " "
881  << std::dec << m_eta_index_impl.shift()
882  << " " << m_eta_index_impl.bits() << " " << m_eta_index_impl.bits_offset() << " ";
884  std::cout << "bec_eta_mod " << m_bec_eta_mod_impl.decode_index() << " "
885  << (std::string) m_bec_eta_mod_impl.ored_field() << " "
886  << std::hex << m_bec_eta_mod_impl.mask() << " "
887  << m_bec_eta_mod_impl.zeroing_mask() << " "
888  << std::dec << m_bec_eta_mod_impl.shift()
889  << " " << m_bec_eta_mod_impl.bits() << " " << m_bec_eta_mod_impl.bits_offset() << " ";
891 
892 
893  std::cout << "PixelID::initLevelsFromDict - found levels " << std::endl;
894  std::cout << "subdet " << m_INDET_INDEX << std::endl;
895  std::cout << "part " << m_PIXEL_INDEX << std::endl;
896  std::cout << "barrel_endcap " << m_BARREL_EC_INDEX << std::endl;
897  std::cout << "layer or disk " << m_LAYER_DISK_INDEX << std::endl;
898  std::cout << "phi_module " << m_PHI_MODULE_INDEX << std::endl;
899  std::cout << "eta_module " << m_ETA_MODULE_INDEX << std::endl;
900  std::cout << "phi_index " << m_PHI_INDEX_INDEX << std::endl;
901  std::cout << "eta_index " << m_ETA_INDEX_INDEX << std::endl;
902 
903  return(0);
904 }
905 
908  return m_wafer_hash_max;
909 }
910 
913  return m_pixel_hash_max;
914 }
915 
917  return(m_wafer_vec.begin());
918 }
919 
921  return(m_wafer_vec.end());
922 }
923 
926 }
927 
930 }
931 
932 void
934  ExpandedIdentifier& exp_id,
935  const IdContext* context) const {
936  exp_id.clear();
937  exp_id = m_baseExpandedIdentifier;
938  exp_id << barrel_ec(id)
939  << layer_disk(id)
940  << phi_module(id)
941  << eta_module(id);
942  if (!context || context->end_index() == m_ETA_INDEX_INDEX) {
943  exp_id << phi_index(id)
944  << eta_index(id);
945  }
946 }
947 
948 // From hash get Identifier
949 int
951  Identifier& id,
952  const IdContext* context) const {
953  int result = 1;
954 
955  size_t begin = (context) ? context->begin_index() : 0;
956  // cannot get hash if end is 0:
957  size_t end = (context) ? context->end_index() : 0;
958 
959  if (0 == begin) {
960  // No hashes yet for ids with prefixes
961  if (m_ETA_MODULE_INDEX == end) {
962  if (hash_id < (unsigned int) (m_wafer_vec.end() - m_wafer_vec.begin())) {
963  id = m_wafer_vec[hash_id];
964  result = 0;
965  }
966  } else if (m_ETA_INDEX_INDEX == end) {
967  // Do not know how to calculate pixel id from hash yet!!
968  std::cout << "Do not know how to calculate pixel id from hash yet!!" << std::endl;
969  }
970  }
971  return(result);
972 }
973 
974 int
976  IdentifierHash& hash_id,
977  const IdContext* context) const {
978  // Get the hash code from either a vec (for wafers) or calculate
979  // it (pixels). For the former, we convert to compact and call
980  // get_hash again. For the latter, we calculate the hash from the
981  // Identifier.
982 
983  int result = 1;
984 
985  hash_id = 0;
986  size_t begin = (context) ? context->begin_index() : 0;
987  size_t end = (context) ? context->end_index() : 0;
988  if (0 == begin) {
989  // No hashes yet for ids with prefixes
990  if (m_ETA_MODULE_INDEX == end) {
991  hash_id = wafer_hash(id);
992  if (hash_id.is_valid()) result = 0;
993  } else if (context && context->end_index() == m_ETA_INDEX_INDEX) {
994  // Must calculate for pixel hash
995  ExpandedIdentifier new_id;
996  get_expanded_id(id, new_id, context);
997  hash_id = m_full_pixel_range.cardinalityUpTo(new_id);
998  result = 0;
999  }
1000  }
1001  return(result);
1002 }
1003 
1004 void
1006  MsgStream log(m_msgSvc, "PixelID");
1007 
1008  if (m_dict) {
1009  int nids = 0;
1010  IdContext context = wafer_context();
1012  const_id_iterator last = m_wafer_vec.end();
1013  for (; first != last; ++first, ++nids) {
1014  Identifier id = (*first);
1015  ExpandedIdentifier expId;
1016  get_expanded_id(id, expId, &context);
1017  Identifier new_id = wafer_id(expId[m_BARREL_EC_INDEX],
1018  expId[m_LAYER_DISK_INDEX],
1019  expId[m_PHI_MODULE_INDEX],
1020  expId[m_ETA_MODULE_INDEX]);
1021  if (id != new_id) {
1022  if (m_msgSvc) log << MSG::ERROR <<
1023  "PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
1024  << show_to_string(new_id) << " " << show_to_string(id) << " "
1025  << (std::string) expId << endmsg;
1026  else std::cout << " ERROR PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
1027  << show_to_string(new_id) << " " << show_to_string(id) << " "
1028  << (std::string) expId << std::endl;
1029  continue;
1030  }
1031  }
1032 
1033  nids = 0;
1034  context = pixel_context();
1035  const_expanded_id_iterator first_pixel = pixel_begin();
1036  const_expanded_id_iterator last_pixel = pixel_end();
1037  for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
1038  const ExpandedIdentifier& exp_id = *first_pixel;
1039  ExpandedIdentifier new_exp_id;
1040 
1041  Identifier id = wafer_id(exp_id[m_BARREL_EC_INDEX],
1042  exp_id[m_LAYER_DISK_INDEX],
1043  exp_id[m_PHI_MODULE_INDEX],
1044  exp_id[m_ETA_MODULE_INDEX]);
1045 
1046  get_expanded_id(id, new_exp_id, &context);
1047  if (exp_id[0] != new_exp_id[0] ||
1048  exp_id[1] != new_exp_id[1] ||
1049  exp_id[2] != new_exp_id[2] ||
1050  exp_id[3] != new_exp_id[3] ||
1051  exp_id[4] != new_exp_id[4] ||
1052  exp_id[5] != new_exp_id[5]) {
1053  if (m_msgSvc) log << MSG::ERROR <<
1054  "PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
1055  << (std::string) new_exp_id
1056  << " " << (std::string) exp_id
1057  << " " << show_to_string(id) << endmsg;
1058  else std::cout << " ERROR PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
1059  << (std::string) new_exp_id
1060  << " " << (std::string) exp_id
1061  << " " << show_to_string(id) << std::endl;
1062  }
1063 
1065  exp_id[m_LAYER_DISK_INDEX],
1066  exp_id[m_PHI_MODULE_INDEX],
1067  exp_id[m_ETA_MODULE_INDEX],
1068  exp_id[m_PHI_INDEX_INDEX],
1069  exp_id[m_ETA_INDEX_INDEX]);
1070  Identifier pid1 = pixel_id(barrel_ec(pid),
1071  layer_disk(pid),
1072  phi_module(pid),
1073  eta_module(pid),
1074  phi_index(pid),
1075  eta_index(pid));
1076  if (pid != pid1) {
1077  if (m_msgSvc) log << MSG::ERROR << "PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1078  << " " << show_to_string(pid1) << " "
1079  << show_to_string(pid) << endmsg;
1080  else std::cout << " ERROR PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1081  << " " << show_to_string(pid1) << " "
1082  << show_to_string(pid) << std::endl;
1083  }
1084  }
1085 
1086  if (m_msgSvc) log << MSG::DEBUG << "PixelID::test_wafer_packing: Successful tested "
1087  << nids << " ids. "
1088  << endmsg;
1089  else std::cout << " DEBUG PixelID::test_wafer_packing: Successful tested "
1090  << nids << " ids. "
1091  << std::endl;
1092  } else {
1093  if (m_msgSvc) log << MSG::ERROR <<
1094  "PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1095  << endmsg;
1096  else std::cout <<
1097  " ERROR PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1098  << std::endl;
1099  }
1100 }
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictMgr.cxx:368
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:975
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:923
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:920
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:115
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:44
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:186
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:391
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:916
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:223
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:174
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:232
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:457
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:80
PixelID::pixel_hash_max
size_type pixel_hash_max(void) const
Definition: PixelID.cxx:912
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictMgr.cxx:311
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: IdDictDefs.h:433
IdDictDictionary::m_version
std::string m_version
Definition: IdDictDefs.h:284
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:646
IdDictMgr
Definition: IdDictDefs.h:32
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
IdDictFieldImplementation::shift
size_type shift() const
Definition: IdDictFieldImplementation.h:227
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:163
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:470
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:933
PixelID::phi_index_max
int phi_index_max(const Identifier &id) const
Definition: PixelID.cxx:144
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:163
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:924
IdDictFieldImplementation::bits_offset
size_type bits_offset() const
Definition: IdDictFieldImplementation.h:209
PixelID::m_full_wafer_range
MultiRange m_full_wafer_range
Definition: PixelID.h:301
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDefs.h:302
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:45
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:148
createCablingJSON.eta_index
int eta_index
Definition: createCablingJSON.py:9
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:496
IdDictFieldImplementation::ored_field
const Range::field & ored_field() const
Definition: IdDictFieldImplementation.h:197
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:124
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:340
PixelID::init_neighbors
int init_neighbors(void)
Definition: PixelID.cxx:508
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:1005
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:220
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:907
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:62
IdDictDictionary
Definition: IdDictDefs.h:97
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:950
PixelID::is_eta_module_max
bool is_eta_module_max(const Identifier &id) const
For the barrel.
Definition: PixelID.cxx:120
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:97
DeMoScan.index
string index
Definition: DeMoScan.py:364
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:284
PixelID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: PixelID.h:259
IdDictFieldImplementation::zeroing_mask
value_type zeroing_mask() const
Definition: IdDictFieldImplementation.h:221
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
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:29
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:181
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:105
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:375
PixelID::size_type
Identifier::size_type size_type
Definition: PixelID.h:71
IdDictField
Definition: IdDictDefs.h:316
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:928
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: IdDictDefs.h:459
IdDictFieldImplementation::mask
size_type mask() const
Definition: IdDictFieldImplementation.h:215
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:483
IdentifierField::add_value
void add_value(element_type value)
Definition: IdentifierField.cxx:249
PixelID::m_pixel_impl
IdDictFieldImplementation m_pixel_impl
Definition: PixelID.h:313
IdDictFieldImplementation::bits
size_type bits() const
Definition: IdDictFieldImplementation.h:203
PixelID::m_PHI_INDEX_INDEX
size_type m_PHI_INDEX_INDEX
Definition: PixelID.h:296
Identifier
Definition: IdentifierFieldParser.cxx:14