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