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