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