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