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