ATLAS Offline Software
CaloDM_ID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "IdDict/IdDictField.h"
7 #include "IdDict/IdDictMgr.h"
8 #include "IdDict/IdDictRegion.h"
11 #include "CxxUtils/StrFormat.h"
12 #include "GaudiKernel/MsgStream.h"
15 #include <algorithm>
16 #include <cassert>
17 #include <cmath>
18 #include <cstdio>
19 #include <iostream>
20 #include <set>
21 #include <string>
22 
23 
25 
26 
28  AtlasDetectorID("CaloDM_ID", "DM_Reg")
29  , m_calodm_region_index(0)
30  , m_CALO_INDEX(999)
31  , m_DETZSIDE_INDEX(999)
32  , m_DMAT_INDEX(999)
33  , m_SAMPLING_INDEX(999)
34  , m_REGION_INDEX(999)
35  , m_ETA_INDEX(999)
36  , m_PHI_INDEX(999)
37  , m_dict(nullptr)
38  , m_lar_zone_hash_max(0)
39  , m_lar_region_hash_max(0)
40  , m_tile_zone_hash_max(0)
41  , m_tile_region_hash_max(0)
42 
43 {
44 
45 }
46 
47 CaloDM_ID:: ~CaloDM_ID()= default;
48 
49 
50 int CaloDM_ID::eta_min(const Identifier& id) const
51 {
52  ExpandedIdentifier expId;
53  IdContext cntxt = region_context();
54  if(!get_expanded_id(id, expId, &cntxt)) {
55  int result = -999;
56  const MultiRange * zoneRange = nullptr ;
57  if ( is_lar(id) ) {
58  zoneRange = &(m_full_lar_zone_range) ;
59  } else {
60  assert ( is_tile(id) );
61  zoneRange = &(m_full_tile_zone_range) ;
62  }
63  for (unsigned int i = 0; i < (*zoneRange).size(); ++i) {
64  const Range& range = (*zoneRange)[i];
65  if (range.match(expId)) {
66  const Range::field& eta_field = range[m_ETA_INDEX];
67  if (not eta_field.empty()) {
68  int etamin = eta_field.get_minimum();
69  if (-999 == result) {
70  result = etamin;
71  }
72  else {
73  if (etamin < result) result = etamin;
74  }
75  }
76  }
77  }
78  return (result);
79  }
80  return (-999);
81 }
82 
83 int CaloDM_ID::eta_max(const Identifier& id) const
84 {
85  ExpandedIdentifier expId;
86  IdContext cntxt = region_context();
87  if(!get_expanded_id(id, expId, &cntxt)) {
88  int result = -999;
89  const MultiRange * zoneRange = nullptr ;
90  if ( is_lar(id) ) {
91  zoneRange = &(m_full_lar_zone_range) ;
92  } else {
93  assert ( is_tile(id) );
94  zoneRange = &(m_full_tile_zone_range) ;
95  }
96  for (unsigned int i = 0; i < (*zoneRange).size(); ++i) {
97  const Range& range = (*zoneRange)[i];
98  if (range.match(expId)) {
99  const Range::field& eta_field = range[m_ETA_INDEX];
100  if (not eta_field.empty()) {
101  int etamax = eta_field.get_maximum();
102  if (result < etamax) result = etamax;
103  }
104  }
105  }
106  return (result);
107  }
108  return (-999); // default
109 }
110 
111 int CaloDM_ID::phi_min(const Identifier& id) const
112 {
113  ExpandedIdentifier expId;
114  IdContext cntxt = region_context();
115  if(!get_expanded_id(id, expId, &cntxt)) {
116  int result = -999;
117  const MultiRange * zoneRange = nullptr ;
118  if ( is_lar(id) ) {
119  zoneRange = &(m_full_lar_zone_range) ;
120  } else {
121  assert ( is_tile(id) );
122  zoneRange = &(m_full_tile_zone_range) ;
123  }
124  for (unsigned int i = 0; i < (*zoneRange).size(); ++i) {
125  const Range& range = (*zoneRange)[i];
126  if (range.match(expId)) {
127  const Range::field& phi_field = range[m_PHI_INDEX];
128  if (not phi_field.empty()) {
129  int phimin = phi_field.get_minimum();
130  if (-999 == result) {
131  result = phimin;
132  }
133  else {
134  if (phimin < result) result = phimin;
135  }
136  }
137  }
138  }
139  return (result);
140  }
141  return (-999);
142 }
143 
144 int CaloDM_ID::phi_max(const Identifier& id) const
145 {
146  ExpandedIdentifier expId;
147  IdContext cntxt = zone_context();
148  if(!get_expanded_id(id, expId, &cntxt)) {
149  int result = -999;
150  const MultiRange * zoneRange = nullptr ;
151  if ( is_lar(id) ) {
152  zoneRange = &(m_full_lar_zone_range) ;
153  } else {
154  assert ( is_tile(id) );
155  zoneRange = &(m_full_tile_zone_range) ;
156  }
157  for (unsigned int i = 0; i < (*zoneRange).size(); ++i) {
158  const Range& range = (*zoneRange)[i];
159  if (range.match(expId)) {
160  const Range::field& phi_field = range[m_PHI_INDEX];
161  if (not phi_field.empty()) {
162  int phimax = phi_field.get_maximum();
163  if (result < phimax) result = phimax;
164  }
165  }
166  }
167  return (result);
168  }
169  return (-999); // default
170 }
171 
172 
173 /*===================================================================*/
175 /*===================================================================*/
176 {
177  // Msg Service
178  MsgStream log(m_msgSvc, "CaloDM_ID" );
179  std::string strg = "initialize_from_dictionary";
180  if(m_msgSvc) {
181  log << MSG::INFO << strg << endmsg;
182  }
183  else {
184  std::cout << strg << std::endl;
185  }
186  std::stringstream strm;
187 
188  // Check whether this helper should be reinitialized
189  if (!reinitialize(dict_mgr)) {
190  if(m_msgSvc)log << MSG::INFO << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
191  return (0);
192  }
193  else {
194  if(m_msgSvc)log << MSG::DEBUG << "(Re)initialize" << endmsg;
195  }
196 
197  // init base object
198  if(AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return (1);
199 
200  // Register version of the Calorimeter dictionary
201  if (register_dict_tag(dict_mgr, "Calorimeter")) return(1);
202 
203  m_dict = dict_mgr.find_dictionary ("Calorimeter");
204  if(!m_dict) {
205  if(m_msgSvc)
206  {
207  log << MSG::ERROR << " initialize_from_dict - cannot access Calorimeter dictionary " << endmsg;
208  }
209  else
210  {
211  std::cout << " CaloDM_ID::initialize_from_dict - cannot access Calorimeter dictionary "
212  << std::endl;
213  }
214  return 1;
215  }
216 
217  // Initialize the field indices
218  if(initLevelsFromDict()) return (1);
219 
220 
221  // Find values for the calo, LArDM (neg) and TileDM (neg) fields
222  int caloValue = -1;
223  if (m_dict->get_label_value("subdet", "Calorimeter", caloValue))
224  {
225  if(m_msgSvc)
226  {
227  log << MSG::ERROR << "Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
228  << m_dict->name() << endmsg;
229  }
230  else
231  {
232  std::cout << "Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
233  << m_dict->name()
234  << std::endl;
235  }
236  return (1);
237  }
238 
239  int lardmCaloValue = -1;
240  // negative half
241  if (m_dict->get_label_value("DetZside", "negative_DMLar_side", lardmCaloValue))
242  {
243  if(m_msgSvc)
244  {
245  log << MSG::ERROR << "Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
246  << m_dict->name() << endmsg;
247  }
248  else
249  {
250  std::cout << "Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
251  << m_dict->name()
252  << std::endl;
253  }
254  return (1);
255  }
256 
257  int tiledmCaloValue = -1;
258  // negative half
259  if (m_dict->get_label_value("DetZside", "negative_DMTile_side", tiledmCaloValue))
260  {
261  if(m_msgSvc)
262  {
263  log << MSG::ERROR << "Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
264  << m_dict->name()
265  << endmsg;
266  }
267  else
268  {
269  std::cout << "Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
270  << m_dict->name()
271  << std::endl;
272  }
273  return (1);
274  }
275 
276 
277  // Set up id for region and range prefix
278 
279  // NOTE: negative value is good enough to get multirange since the
280  // regions are symmetric in +/-eta
281 
282  // LAr
283  ExpandedIdentifier reg_id;
284  reg_id.add(caloValue);
285  reg_id.add(lardmCaloValue);
286  Range prefix;
287  m_full_lar_region_range = m_dict->build_multirange(reg_id, prefix, "DMregion");
288  m_full_lar_zone_range = m_dict->build_multirange(reg_id, prefix, "phivalue");
289 
290  // Tile
291  ExpandedIdentifier reg_id2;
292  reg_id2.add(caloValue);
293  reg_id2.add(tiledmCaloValue);
294  Range prefix2;
295  m_full_tile_region_range = m_dict->build_multirange(reg_id2, prefix2, "DMregion");
296  m_full_tile_zone_range = m_dict->build_multirange(reg_id2, prefix2, "phivalue");
297 
298 
299  if (!m_quiet) {
300  if(m_msgSvc)
301  {
302  log << MSG::DEBUG << " initialize_from_dict : " << endmsg;
303  log << MSG::DEBUG << " LAr zone range -> " << (std::string)m_full_lar_zone_range << endmsg;
304  log << MSG::DEBUG << " LAr region range -> " << (std::string)m_full_lar_region_range << endmsg;
305  log << MSG::DEBUG << " Tile zone range -> " << (std::string)m_full_tile_zone_range << endmsg;
306  log << MSG::DEBUG << " Tile region range -> " << (std::string)m_full_tile_region_range << endmsg;
307  }
308  else
309  {
310  std::cout << " CaloDM_ID::initialize_from_dict : "
311  << std::endl;
312  std::cout << " LAr zone range -> " << (std::string)m_full_lar_zone_range
313  << std::endl;
314  std::cout << " LAr region range -> " << (std::string)m_full_lar_region_range
315  << std::endl;
316  std::cout << " Tile zone range -> " << (std::string)m_full_tile_zone_range
317  << std::endl;
318  std::cout << " Tile region range -> " << (std::string)m_full_tile_region_range
319  << std::endl;
320  }
321  }
322 
323 
324  // Setup the hash tables
325  if(init_lar_hashes()) return (1);
326  if(init_tile_hashes()) return (1);
327 
328  // Setup for hash calculation
329 
330  // Regions have uniform eta/phi granularity
331  // The lookup table only needs to contain the
332  // hash offset for each region, the first eta index
333  // and the number of phi cells.
334 
335  // The implementation requires:
336 
337  // 1) a lookup table for each region containing hash offset,
338  // etamin and nphi
339  // 2) a decoder to access the "index" corresponding to the
340  // pnz/samp/reg fields. These fields use 6 bits, so the
341  // vector has a length of 64 for 16 regions.
342 
343 
344  // Create decoder for fields pnz to region
346  m_calodm_impl.bits() +
347  m_dmat_impl.bits() +
351  m_pnz_reg_impl.set_bits(bits, bits_offset);
352  int size = (1 << bits);
353 
354  // std::cout << "pnz_reg "
355  // << m_pnz_reg_impl.show_to_string() << std::endl;
356  // std::cout << "size " << size << std::endl;
357 
358  // std::cout << "pnz_reg " << m_pnz_reg_impl.decode_index() << " "
359  // << (std::string)m_pnz_reg_impl.ored_field() << " "
360  // << std::hex << m_pnz_reg_impl.mask() << " "
361  // << m_pnz_reg_impl.zeroing_mask() << " "
362  // << std::dec << m_pnz_reg_impl.shift()
363  // << " " << m_pnz_reg_impl.bits() << " " <<m_pnz_reg_impl.bits_offset()
364  // << std::endl;
365 
366 
367  // Set up vector as lookup table for lar hash calculation.
368  m_lar_hash_calcs.resize(size);
369 
370  for (unsigned int i = 0; i < m_lar_region_hash_max; ++i) {
371  Identifier regId = lar_region_id(i) ;
372  HashCalc hc;
373  int etamin = eta_min(regId);
374  if(etamin < 0)
375  {
376  etamin = 0;
377  if(m_msgSvc)
378  {
379  log << MSG::WARNING << " seting etamin to 0 because actual value not found for regId " << show_to_string(regId) << endmsg;
380  }
381  else
382  {
383  std::cout << "WARNING !!! seting etamin to 0 because actual value not found for regId " << show_to_string(regId) << std::endl;
384  }
385  }
386  Identifier min = zone_id ( regId, etamin, 0);
388  hc.m_hash = min_hash;
389  hc.m_etamin = etamin;
390  hc.m_nphi = phi_max(min)+1 ;
392 
393  if (m_pnz_reg_impl.unpack(min) >= size)
394  {
395  if( m_msgSvc)
396  {
397  log << MSG::WARNING << "min > " << size << " "
398  << i << " "
399  << show_to_string(min) << " "
400  << m_pnz_reg_impl.unpack(min) << " "
401  << endmsg;
402  }
403  else
404  {
405  std::cout << "min > " << size << " "
406  << i << " "
407  << show_to_string(min) << " "
408  << m_pnz_reg_impl.unpack(min) << " "
409  << std::endl;
410  }
411  }
412  }
413 
414  // Check lar hash calculation
415  for (unsigned int i = 0; i < m_lar_zone_hash_max; ++i) {
416  Identifier id = lar_zone_id(i);
417  if (lar_zone_hash(id) != i)
418  {
419  if( m_msgSvc)
420  {
421  log << MSG::ERROR << "lar zone ranges, id, hash, i = "
422  << show_to_string(id) << ", "
423  << lar_zone_hash(id) << ", "
424  << i
425  << endmsg;
426  }
427  else
428  {
429  std::cout << " ***** Error ";
430  std::cout << "lar zone ranges, id, hash, i = "
431  << show_to_string(id) << ", "
432  << lar_zone_hash(id) << ", "
433  << i
434  << std::endl;
435  }
436  }
437  }
438 
439  // Set up vector as lookup table for tile hash calculation.
440  m_tile_hash_calcs.resize(size);
441 
442  for (unsigned int i = 0; i < m_tile_region_hash_max; ++i) {
443  Identifier regId = tile_region_id(i) ;
444  HashCalc hc;
445  int etamin = eta_min(regId);
446  if(etamin < 0)
447  {
448  etamin = 0;
449  if( m_msgSvc)
450  {
451  log << MSG::WARNING << "seting etamin to 0 because actual value not found for regId " << show_to_string(regId) << endmsg;
452  }
453  else
454  {
455  std::cout << "WARNING !!! seting etamin to 0 because actual value not found for regId " << show_to_string(regId) << std::endl;
456  }
457  }
458  Identifier min = zone_id ( regId, etamin, 0);
460  hc.m_hash = min_hash;
461  hc.m_etamin = etamin;
462  hc.m_nphi = phi_max(min)+1 ;
464 
465  if (m_pnz_reg_impl.unpack(min) >= size)
466  {
467  if( m_msgSvc)
468  {
469  log << MSG::WARNING << "min > " << size << " "
470  << i << " "
471  << show_to_string(min) << " "
472  << m_pnz_reg_impl.unpack(min) << " "
473  << endmsg;
474  }
475  else
476  {
477  std::cout << "min > " << size << " "
478  << i << " "
479  << show_to_string(min) << " "
480  << m_pnz_reg_impl.unpack(min) << " "
481  << std::endl;
482  }
483  }
484  }
485 
486  // Check tile hash calculation
487  for (unsigned int i = 0; i < m_tile_zone_hash_max; ++i) {
488  Identifier id = tile_zone_id(i);
489  if (tile_zone_hash(id) != i)
490  {
491  if( m_msgSvc)
492  {
493  log << MSG::ERROR << "tile zone ranges, id, hash, i = "
494  << show_to_string(id) << ", "
495  << tile_zone_hash(id) << ", "
496  << i
497  << endmsg;
498  }
499  else
500  {
501  std::cout << " ***** Error ";
502  std::cout << "tile zone ranges, id, hash, i = "
503  << show_to_string(id) << ", "
504  << tile_zone_hash(id) << ", "
505  << i
506  << std::endl;
507  }
508  }
509  }
510  return 0;
511 
512 }
513 
514  int CaloDM_ID::get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const
515 {
516  // We assume that the context is >= region
517  exp_id.clear();
518  exp_id << calo_field_value()
519  << pos_neg_z(id)
520  << dmat(id)
521  << sampling(id)
522  << region(id);
523  if(context && context->end_index() >= m_ETA_INDEX) {
524  exp_id << eta(id);
525  if(context->end_index() >= m_PHI_INDEX) {
526  exp_id << phi(id);
527  }
528  }
529  return (0);
530 }
531 
532 IdContext
534 {
536  return {id, 0, m_REGION_INDEX};
537 }
538 
539 IdContext
541 {
543  return {id, 0, m_PHI_INDEX};
544 }
545 
546 
547 void CaloDM_ID::lar_region_id_checks (int pos_neg_z, int dmat, int sampling, int region)const
548 {
549  // Fill expanded id
551  id << pos_neg_z << dmat << sampling << region ;
552 
553  if (!m_full_lar_region_range.match(id)) {
554  std::string errorMessage = "CaloDM_ID::lar_region_id() result is not OK: ID, range = "
555  + std::string(id) + " , " + (std::string)m_full_lar_zone_range;
556  throw CaloID_Exception(errorMessage , 3);
557  }
558 }
559 
560 void CaloDM_ID::tile_region_id_checks (int pos_neg_z, int dmat, int sampling, int region)const
561 {
562  // Fill expanded id
564  id << pos_neg_z << dmat << sampling << region ;
565 
566  if (!m_full_tile_region_range.match(id)) {
567  std::string errorMessage = "CaloDM_ID::tile_region_id() result is not OK: ID, range = "
568  + std::string(id) + " , " + (std::string)m_full_tile_zone_range;
569  throw CaloID_Exception(errorMessage , 3);
570  }
571 }
572 
573 
574 
575  void CaloDM_ID::lar_zone_id_checks ( int pos_neg_z, int dmat, int sampling, int region,
576  int eta, int phi ) const
577 {
578  // Fill expanded id
580  id << pos_neg_z << dmat << sampling << region << eta << phi;
581 
582  if (!m_full_lar_zone_range.match(id)) {
583  std::string errorMessage = "CaloDM_ID::lar_zone_id() result is not OK: ID, range = "
584  + std::string(id) + " , " + (std::string)m_full_lar_zone_range;
585  throw CaloID_Exception(errorMessage , 4);
586  }
587 }
588 
589  void CaloDM_ID::tile_zone_id_checks ( int pos_neg_z, int dmat, int sampling, int region,
590  int eta, int phi ) const
591 {
592  // Fill expanded id
594  id << pos_neg_z << dmat << sampling << region << eta << phi;
595 
596  if (!m_full_tile_zone_range.match(id)) {
597  std::string errorMessage = "CaloDM_ID::tile_zone_id() result is not OK: ID, range = "
598  + std::string(id) + " , " + (std::string)m_full_tile_zone_range;
599  throw CaloID_Exception(errorMessage , 4);
600  }
601 }
602 
603 
604 void CaloDM_ID::zone_id_checks ( const Identifier& regionId,
605  int eta, int phi ) const
606 {
607  // Fill expanded id
609 
610  IdContext context = region_context();
611  if (get_expanded_id(regionId, id, &context)) {
612  std::string errorMessage = "CaloDM_ID::zone_id(regionId) result is not OK: ID= "
613  + show_to_string(regionId) ;
614  throw CaloID_Exception(errorMessage , 4);
615  }
616 
617  id << eta << phi;
618 
619  if(is_lar(regionId)) {
620  if (!m_full_lar_zone_range.match(id)) {
621  std::string errorMessage = "CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
622  + std::string(id) + " , " + (std::string)m_full_lar_zone_range;
623  throw CaloID_Exception(errorMessage , 4);
624  }
625  } else if(is_tile(regionId)) {
626  if (!m_full_tile_zone_range.match(id)) {
627  std::string errorMessage = "CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
628  + std::string(id) + " , " + (std::string)m_full_tile_zone_range;
629  throw CaloID_Exception(errorMessage , 4);
630  }
631  }
632 }
633 
634 
635 /*=======================================*/
637 /*=======================================*/
638 {
639  // Msg Service
640  MsgStream log(m_msgSvc, "CaloDM_ID" );
641  std::string strg;
642  std::stringstream strm;
643  if(!m_dict) {
644  if( m_msgSvc)
645  {
646  log << MSG::ERROR << "initLevelsFromDict - dictionary NOT initialized "
647  << endmsg;
648  }
649  else
650  {
651  std::cout << "CaloDM_ID::initLevelsFromDict - dictionary NOT initialized "
652  << std::endl ;
653  }
654  return (1);
655  }
656 
657  // Find out which identifier field corresponds to each level.
658 
659  m_CALO_INDEX = 999 ;
660  m_DETZSIDE_INDEX = 999 ;
661  m_DMAT_INDEX = 999 ;
662  m_SAMPLING_INDEX = 999 ;
663  m_REGION_INDEX = 999 ;
664  m_ETA_INDEX = 999 ;
665  m_PHI_INDEX = 999 ;
666 
667  // Save index to a LArDM region for unpacking - search with region name
668  const IdDictRegion* reg = m_dict->find_region("DM_4_1_0_0");
669  if (reg)
670  {
671  m_calodm_region_index = reg->index();
672  }
673  else
674  {
675  if(m_msgSvc)
676  {
677  log << MSG::ERROR << "initLevelsFromDict - unable to find lardm region " << endmsg;
678  }
679  else
680  {
681  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find lardm region "
682  << std::endl;
683  }
684  return (1);
685  }
686 
687 
688  // Fing a CaloDM region
689  const IdDictField* field = m_dict->find_field("subdet") ;
690  if (field) {
691  m_CALO_INDEX = field->index();
692  }
693  else
694  {
695  if(m_msgSvc)
696  {
697  log << MSG::ERROR << "initLevelsFromDict - unable to find 'subdet' field "
698  << endmsg;
699  }
700  else
701  {
702  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'subdet' field "
703  << std::endl ;
704  }
705  return (1);
706  }
707 
708  field = m_dict->find_field("DetZside") ;
709  if (field)
710  {
711  m_DETZSIDE_INDEX = field->index();
712  }
713  else
714  {
715  if(m_msgSvc)
716  {
717  log << MSG::ERROR << "initLevelsFromDict - unable to find 'DetZside' field "
718  << endmsg;
719  }
720  else
721  {
722  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'DetZside' field "
723  << std::endl ;
724  }
725  return (1);
726  }
727 
728  field = m_dict->find_field("DMvalue") ;
729  if (field)
730  {
731  m_DMAT_INDEX = field->index();
732  }
733  else
734  {
735  if(m_msgSvc)
736  {
737  log << MSG::ERROR << "initLevelsFromDict - unable to find 'DMvalue' field "
738  << endmsg;
739  }
740  else
741  {
742  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'DMvalue' field "
743  << std::endl ;
744  }
745  return (1);
746  }
747 
748 
749  field = m_dict->find_field("samplingvalue") ;
750  if (field)
751  {
752  m_SAMPLING_INDEX = field->index();
753  }
754  else
755  {
756  if(m_msgSvc)
757  {
758  log << MSG::ERROR << "initLevelsFromDict - unable to find 'samplingvalue' field "
759  << endmsg;
760  }
761  else
762  {
763  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'samplingvalue' field "
764  << std::endl ;
765  }
766  return (1);
767  }
768 
769  field = m_dict->find_field("DMregion") ;
770  if (field)
771  {
772  m_REGION_INDEX = field->index();
773  }
774  else
775  {
776  if(m_msgSvc)
777  {
778  log << MSG::ERROR << "initLevelsFromDict - unable to find 'DMregion' field " << endmsg;
779  }
780  else
781  {
782  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'DMregion' field "
783  << std::endl ;
784  }
785  return (1);
786  }
787 
788  /* std::cout << "m_region= " << m_REGION_INDEX << std::endl; */
789 
790  field = m_dict->find_field("DMEta") ;
791  if (field) {
792  m_ETA_INDEX = field->index();
793  }
794  else
795  {
796  if(m_msgSvc)
797  {
798  log << MSG::ERROR << "initLevelsFromDict - unable to find 'DMEta' field "
799  << endmsg;
800  }
801  else
802  {
803  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'DMEta' field "
804  << std::endl ;
805  }
806  return (1);
807  }
808 
809  field = m_dict->find_field("phivalue") ;
810  if (field)
811  {
812  m_PHI_INDEX = field->index();
813  }
814  else
815  {
816  if(m_msgSvc)
817  {
818  log << MSG::ERROR << "initLevelsFromDict - unable to find 'phivalue' field "
819  << endmsg;
820  }
821  else
822  {
823  std::cout << "CaloDM_ID::initLevelsFromDict - unable to find 'phivalue' field "
824  << std::endl ;
825  }
826  return (1);
827  }
828 
829 
830  // Set the field implementations
831 
833 
834  m_calo_impl = region.implementation(m_CALO_INDEX);
835  m_calodm_impl = region.implementation(m_DETZSIDE_INDEX);
836  m_dmat_impl = region.implementation(m_DMAT_INDEX);
837  m_sampling_impl = region.implementation(m_SAMPLING_INDEX);
838  m_region_impl = region.implementation(m_REGION_INDEX);
839  m_eta_impl = region.implementation(m_ETA_INDEX);
840  m_phi_impl = region.implementation(m_PHI_INDEX);
841 
842  if (!m_quiet) {
843  if(m_msgSvc)
844  {
845  // log << MSG::DEBUG << "CaloDM_ID::initLevelsFromDict - found levels " << endmsg ;
846  // log << MSG::DEBUG << "subdet " << m_CALO_INDEX << endmsg ;
847  // log << MSG::DEBUG << "detzside " << m_DETZSIDE_INDEX << endmsg ;
848  // log << MSG::DEBUG << "Dmat " << m_DMAT_INDEX << endmsg ;
849  // log << MSG::DEBUG << "sampling " << m_SAMPLING_INDEX << endmsg ;
850  // log << MSG::DEBUG << "region " << m_REGION_INDEX << endmsg ;
851  // log << MSG::DEBUG << "eta " << m_ETA_INDEX << endmsg ;
852  // log << MSG::DEBUG << "phi " << m_PHI_INDEX << endmsg ;
853  log << MSG::DEBUG << "decode index and bit fields for each level: " << endmsg;
854  log << MSG::DEBUG << "calo " << m_calo_impl.show_to_string() << endmsg;
855  log << MSG::DEBUG << "detzside " << m_calodm_impl.show_to_string() << endmsg;
856  log << MSG::DEBUG << "dmat " << m_dmat_impl.show_to_string() << endmsg;
857  log << MSG::DEBUG << "samp " << m_sampling_impl.show_to_string() << endmsg;
858  log << MSG::DEBUG << "reg " << m_region_impl.show_to_string() << endmsg;
859  log << MSG::DEBUG << "eta " << m_eta_impl.show_to_string() << endmsg;
860  log << MSG::DEBUG << "phi " << m_phi_impl.show_to_string() << endmsg;
861  }
862  else
863  {
864  // std::cout << "CaloDM_ID::initLevelsFromDict - found levels " << std::endl ;
865  // std::cout << "subdet " << m_CALO_INDEX << std::endl ;
866  // std::cout << "detzside " << m_DETZSIDE_INDEX << std::endl ;
867  // std::cout << "Dmat " << m_DMAT_INDEX << std::endl ;
868  // std::cout << "sampling " << m_SAMPLING_INDEX << std::endl ;
869  // std::cout << "region " << m_REGION_INDEX << std::endl ;
870  // std::cout << "eta " << m_ETA_INDEX << std::endl ;
871  // std::cout << "phi " << m_PHI_INDEX << std::endl ;
872  std::cout << "decode index and bit fields for each level: " << std::endl;
873  std::cout << "calo " << m_calo_impl.show_to_string() << std::endl;
874  std::cout << "detzside " << m_calodm_impl.show_to_string() << std::endl;
875  std::cout << "dmat " << m_dmat_impl.show_to_string() << std::endl;
876  std::cout << "samp " << m_sampling_impl.show_to_string() << std::endl;
877  std::cout << "reg " << m_region_impl.show_to_string() << std::endl;
878  std::cout << "eta " << m_eta_impl.show_to_string() << std::endl;
879  std::cout << "phi " << m_phi_impl.show_to_string() << std::endl;
880  }
881  }
882  return(0) ;
883 }
884 
885 /*=======================================*/
887 /*=======================================*/
888 {
889  // Msg Service
890  MsgStream log(m_msgSvc, "CaloDM_ID" );
891  std::string strg;
892  std::stringstream strm;
893 
894  // zone hash
897  unsigned int nids = 0;
898  std::set<Identifier> ids;
899  for (unsigned int i = 0; i < m_full_lar_zone_range.size(); ++i) {
902  auto first = rit.begin();
903  auto last = rit.end();
904  for (; first != last; ++first) {
905  const ExpandedIdentifier& exp_id = (*first);
906  Identifier zon_id = zone_id ( exp_id[m_DETZSIDE_INDEX],
907  exp_id[m_DMAT_INDEX],
908  exp_id[m_SAMPLING_INDEX],
909  exp_id[m_REGION_INDEX] ,
910  exp_id[m_ETA_INDEX] ,
911  exp_id[m_PHI_INDEX] ) ;
912  if(!(ids.insert(zon_id)).second)
913  {
914  if(m_msgSvc)
915  {
916  log << MSG::ERROR << " init_lar_hashes "
917  << " duplicated id for lardm id. nids= " << nids
918  << " compact Id " << show_to_string(zon_id)
919  << endmsg;
920  }
921  else
922  {
923  std::cout << " CaloDM_ID::init_lar_hashes "
924  << " Error: duplicated id for lardm id. nids= " << nids
925  << " compact Id " ;
926  (*first).show();
927  std::cout << std::endl;
928  }
929  }
930  nids++;
931  }
932  }
933  if(ids.size() != m_lar_zone_hash_max)
934  {
935  if(m_msgSvc)
936  {
937  log << MSG::ERROR << " init_lar_hashes "
938  << " set size NOT EQUAL to hash max. size " << ids.size()
939  << " hash max " << m_lar_zone_hash_max << endmsg;
940  }
941  else
942  {
943  std::cout << " CaloDM_ID::init_lar_hashes "
944  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
945  << " hash max " << m_lar_zone_hash_max
946  << std::endl;
947  }
948  return (1);
949  }
950 
951  nids=0;
952  std::set<Identifier>::const_iterator first = ids.begin();
953  std::set<Identifier>::const_iterator last = ids.end();
954  for (;first != last && nids < m_lar_zone_vec.size(); ++first) {
955  m_lar_zone_vec[nids] = (*first) ;
956  nids++;
957  }
958 
959  // region hash
962  nids = 0;
963  ids.clear();
964  for (unsigned int i = 0; i < m_full_lar_region_range.size(); ++i) {
967  auto first = rit.begin();
968  auto last = rit.end();
969  for (; first != last; ++first) {
970  const ExpandedIdentifier& exp_id = (*first);
971  // std::cout << "exp_id = " << (std::string)exp_id << std::endl;
972  Identifier reg_id = region_id ( exp_id[m_DETZSIDE_INDEX],
973  exp_id[m_DMAT_INDEX],
974  exp_id[m_SAMPLING_INDEX],
975  exp_id[m_REGION_INDEX] );
976  if(!(ids.insert(reg_id)).second)
977  {
978  if(m_msgSvc)
979  {
980  log << MSG::ERROR << " init_lar_hashes (regions) "
981  << " duplicated id for region id. nids= " << nids
982  << " compact Id " << show_to_string(reg_id)
983  << endmsg;
984  }
985  else
986  {
987  std::cout << " CaloDM_ID::init_lar_hashes (regions) "
988  << " Error: duplicated id for region id. nids= " << nids
989  << " compact Id " ;
990  (*first).show();
991  std::cout << " " << show_to_string(reg_id) << std::endl;
992  std::cout << std::endl;
993  }
994  }
995  nids++;
996  }
997  }
998  if(ids.size() != m_lar_region_hash_max)
999  {
1000  if(m_msgSvc)
1001  {
1002  log << MSG::ERROR << " init_lar_hashes "
1003  << " set size NOT EQUAL to region hash max. size " << ids.size()
1004  << " region hash max " << m_lar_region_hash_max << endmsg;
1005  }
1006  else
1007  {
1008  std::cout << " CaloDM_ID::init_lar_hashes "
1009  << " Error: set size NOT EQUAL to region hash max. size " << ids.size()
1010  << " region hash max " << m_lar_region_hash_max
1011  << std::endl;
1012  }
1013  return (1);
1014  }
1015 
1016  nids=0;
1017  first = ids.begin();
1018  last = ids.end();
1019  for (;first != last && nids < m_lar_region_vec.size(); ++first) {
1020  m_lar_region_vec[nids] = (*first) ;
1021  nids++;
1022  }
1023 
1024  return (0);
1025 
1026 }
1027 
1028 /*=====================================*/
1030 /*=====================================*/
1031 {
1032  // Msg Service
1033  MsgStream log(m_msgSvc, "CaloDM_ID" );
1034  std::string strg;
1035  std::stringstream strm;
1036 
1037  // zone hash
1040  unsigned int nids = 0;
1041  std::set<Identifier> ids;
1042  for (unsigned int i = 0; i < m_full_tile_zone_range.size(); ++i) {
1043  const Range& range = m_full_tile_zone_range[i];
1045  auto first = rit.begin();
1046  auto last = rit.end();
1047  for (; first != last; ++first) {
1048  const ExpandedIdentifier& exp_id = (*first);
1049  Identifier zon_id = zone_id ( exp_id[m_DETZSIDE_INDEX],
1050  exp_id[m_DMAT_INDEX],
1051  exp_id[m_SAMPLING_INDEX],
1052  exp_id[m_REGION_INDEX] ,
1053  exp_id[m_ETA_INDEX] ,
1054  exp_id[m_PHI_INDEX] ) ;
1055  /*
1056  std::cout << "detZside,dmat,samp,reg,eta,phi= "
1057  <<exp_id[m_DETZSIDE_INDEX] << ", "
1058  <<exp_id[m_DMAT_INDEX] << ", "
1059  <<exp_id[m_SAMPLING_INDEX] << ", "
1060  <<exp_id[m_REGION_INDEX] << ", "
1061  <<exp_id[m_ETA_INDEX] << ", "
1062  <<exp_id[m_PHI_INDEX];
1063  std::cout << std::endl;
1064  std::cout << "tile zon_id= " << show_to_string(zon_id) << std::endl;
1065  */
1066  if(!(ids.insert(zon_id)).second)
1067  {
1068  if(m_msgSvc)
1069  {
1070  log << MSG::ERROR << " init_tile_hashes "
1071  << " duplicated id for tiledm id. nids= " << nids
1072  << " compact Id " << show_to_string(zon_id)
1073  << endmsg;
1074  }
1075  else
1076  {
1077  std::cout << " CaloDM_ID::init_tile_hashes "
1078  << " Error: duplicated id for tiledm id. nids= " << nids
1079  << " compact Id " ;
1080  (*first).show();
1081  std::cout << std::endl;
1082  }
1083  }
1084  nids++;
1085  }
1086  }
1087  if(ids.size() != m_tile_zone_hash_max)
1088  {
1089  if(m_msgSvc)
1090  {
1091  log << MSG::ERROR << " init_tile_hashes "
1092  << " set size NOT EQUAL to hash max. size " << ids.size()
1093  << " hash max " << m_tile_zone_hash_max << endmsg;
1094  }
1095  else
1096  {
1097  std::cout << " CaloDM_ID::init_tile_hashes "
1098  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
1099  << " hash max " << m_tile_zone_hash_max
1100  << std::endl;
1101  }
1102  return (1);
1103  }
1104 
1105  nids=0;
1106  std::set<Identifier>::const_iterator first = ids.begin();
1107  std::set<Identifier>::const_iterator last = ids.end();
1108  for (;first != last && nids < m_tile_zone_vec.size(); ++first) {
1109  m_tile_zone_vec[nids] = (*first) ;
1110  nids++;
1111  }
1112 
1113  // region hash
1116  nids = 0;
1117  ids.clear();
1118  for (unsigned int i = 0; i < m_full_tile_region_range.size(); ++i) {
1121  auto first = rit.begin();
1122  auto last = rit.end();
1123  for (; first != last; ++first) {
1124  const ExpandedIdentifier& exp_id = (*first);
1125  // std::cout << "exp_id = " << (std::string)exp_id << std::endl;
1126  Identifier reg_id = region_id ( exp_id[m_DETZSIDE_INDEX],
1127  exp_id[m_DMAT_INDEX],
1128  exp_id[m_SAMPLING_INDEX],
1129  exp_id[m_REGION_INDEX] );
1130  if(!(ids.insert(reg_id)).second)
1131  {
1132  if(m_msgSvc)
1133  {
1134  log << MSG::ERROR << " init_tile_hashes (regions) "
1135  << " duplicated id for region id. nids= " << nids
1136  << " compact Id " << show_to_string(reg_id)
1137  << endmsg;
1138  }
1139  else
1140  {
1141  std::cout << " CaloDM_ID::init_tile_hashes (regions) "
1142  << " Error: duplicated id for region id. nids= " << nids
1143  << " compact Id " ;
1144  (*first).show();
1145  std::cout << " " << show_to_string(reg_id) << std::endl;
1146  std::cout << std::endl;
1147  }
1148  }
1149  nids++;
1150  }
1151  }
1152  if(ids.size() != m_tile_region_hash_max)
1153  {
1154  if(m_msgSvc)
1155  {
1156  log << MSG::ERROR << " init_tile_hashes "
1157  << " set size NOT EQUAL to region hash max. size " << ids.size()
1158  << " region hash max " << m_tile_region_hash_max << endmsg;
1159  }
1160  else
1161  {
1162  std::cout << " CaloDM_ID::init_tile_hashes "
1163  << " Error: set size NOT EQUAL to region hash max. size " << ids.size()
1164  << " region hash max " << m_tile_region_hash_max
1165  << std::endl;
1166  }
1167  return (1);
1168  }
1169 
1170  nids=0;
1171  first = ids.begin();
1172  last = ids.end();
1173  for (;first != last && nids < m_tile_region_vec.size(); ++first) {
1174  m_tile_region_vec[nids] = (*first) ;
1175  nids++;
1176  }
1177 
1178  return (0);
1179 
1180 }
1181 
1182 
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictDictionary.cxx:101
IdDictMgr.h
CaloDM_ID::phi_min
int phi_min(const Identifier &id) const
min value of phi index (-999 == failure)
Definition: CaloDM_ID.cxx:111
ConstRangeIterator
Definition: RangeIterator.h:46
CaloDM_ID::m_DMAT_INDEX
size_type m_DMAT_INDEX
Definition: CaloDM_ID.h:323
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:290
CaloDM_ID::dmat
int dmat(const Identifier &id) const
return DMtype according to :
Definition: CaloDM_ID.h:669
CaloDM_ID::m_SAMPLING_INDEX
size_type m_SAMPLING_INDEX
Definition: CaloDM_ID.h:324
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:257
CaloDM_ID::m_full_tile_region_range
MultiRange m_full_tile_region_range
Definition: CaloDM_ID.h:338
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloDM_ID::HashCalc::m_nphi
size_type m_nphi
Definition: CaloDM_ID.h:359
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:32
CaloDM_ID::m_CALO_INDEX
size_type m_CALO_INDEX
Definition: CaloDM_ID.h:321
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloDM_ID::tile_region_id_checks
void tile_region_id_checks(int pos_neg_z, int dmat, int sampling, int region) const
Definition: CaloDM_ID.cxx:560
IdDictDictionary::region
const IdDictRegion & region(size_t i) const
Region at index i.
Definition: IdDictDictionary.h:350
CaloDM_ID::m_REGION_INDEX
size_type m_REGION_INDEX
Definition: CaloDM_ID.h:325
CaloDM_ID::m_DETZSIDE_INDEX
size_type m_DETZSIDE_INDEX
Definition: CaloDM_ID.h:322
CaloDM_ID::tile_region_id
Identifier tile_region_id(IdentifierHash tile_region_hash_id) const
create a tile region id from hash id
Definition: CaloDM_ID.h:514
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:121
CaloDM_ID::region
int region(const Identifier &id) const
return region according to :
Definition: CaloDM_ID.h:651
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
IdDictDictionary.h
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
AtlasDetectorID::calo_field_value
int calo_field_value() const
Definition: AtlasDetectorID.h:492
CaloDM_ID::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: CaloDM_ID.h:326
CaloDM_ID::tile_zone_id
Identifier tile_zone_id(IdentifierHash tile_zone_hash_id) const
create a tile zone id from hash id
Definition: CaloDM_ID.h:526
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
CaloDM_ID::CaloDM_ID
CaloDM_ID()
Definition: CaloDM_ID.cxx:27
CaloDM_ID::~CaloDM_ID
virtual ~CaloDM_ID()
CaloDM_ID::eta_min
int eta_min(const Identifier &id) const
min value of eta index (-999 == failure)
Definition: CaloDM_ID.cxx:50
CaloDM_ID::HashCalc::m_hash
IdentifierHash m_hash
Definition: CaloDM_ID.h:357
CaloDM_ID::lar_zone_hash_binary_search
IdentifierHash lar_zone_hash_binary_search(Identifier zoneId) const
Definition: CaloDM_ID.h:675
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:369
CaloDM_ID::m_lar_region_hash_max
size_type m_lar_region_hash_max
Definition: CaloDM_ID.h:334
CaloDM_ID::m_dict
const IdDictDictionary * m_dict
Definition: CaloDM_ID.h:329
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:130
CaloDM_ID::m_tile_zone_vec
std::vector< Identifier > m_tile_zone_vec
Definition: CaloDM_ID.h:342
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
CaloDM_ID::HashCalc::m_etamin
size_type m_etamin
Definition: CaloDM_ID.h:358
IdDictDictionary::name
const std::string & name() const
Dictionary name.
Definition: IdDictDictionary.h:332
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
CaloDM_ID::m_lar_region_vec
std::vector< Identifier > m_lar_region_vec
Definition: CaloDM_ID.h:336
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:47
IdDictRegion
Definition: IdDictRegion.h:20
CaloDM_ID::init_tile_hashes
int init_tile_hashes()
Definition: CaloDM_ID.cxx:1029
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictMgr
Definition: IdDictMgr.h:15
CaloDM_ID::lar_region_id_checks
void lar_region_id_checks(int pos_neg_z, int dmat, int sampling, int region) const
Definition: CaloDM_ID.cxx:547
StrFormat.h
Provide helper functions to create formatted strings.
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:124
CaloDM_ID::m_full_tile_zone_range
MultiRange m_full_tile_zone_range
Definition: CaloDM_ID.h:339
CaloDM_ID::init_lar_hashes
int init_lar_hashes()
Definition: CaloDM_ID.cxx:886
CaloDM_ID::initLevelsFromDict
int initLevelsFromDict()
Definition: CaloDM_ID.cxx:636
IdentifierField::empty
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
Definition: IdentifierField.h:182
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictFieldImplementation::set_bits
void set_bits(size_type bits, size_type bits_offset)
Definition: IdDictFieldImplementation.h:278
CaloDM_ID::m_calo_impl
IdDictFieldImplementation m_calo_impl
Definition: CaloDM_ID.h:367
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CaloDM_ID::m_full_lar_region_range
MultiRange m_full_lar_region_range
Definition: CaloDM_ID.h:331
CaloDM_ID::pos_neg_z
int pos_neg_z(const Identifier &id) const
return pos_neg_z according to :
Definition: CaloDM_ID.h:639
IdDictFieldImplementation::bits_offset
size_type bits_offset() const
Definition: IdDictFieldImplementation.h:208
CaloDM_ID::m_lar_hash_calcs
std::vector< HashCalc > m_lar_hash_calcs
Definition: CaloDM_ID.h:362
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
CaloDM_ID::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: CaloDM_ID.h:372
CaloDM_ID::is_lar
bool is_lar(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
Definition: CaloDM_ID.h:496
ConstRangeIterator::begin
ConstRangeIterator begin() const
Definition: RangeIterator.cxx:18
CaloDM_ID::tile_zone_hash
IdentifierHash tile_zone_hash(Identifier TileZoneId) const
create a tile hash id from zone id
Definition: CaloDM_ID.h:559
CaloDM_ID::region_context
IdContext region_context() const
access to IdContext's which define which levels of fields are contained in a region id
Definition: CaloDM_ID.cxx:533
CaloDM_ID::m_lar_zone_vec
std::vector< Identifier > m_lar_zone_vec
Definition: CaloDM_ID.h:335
CaloDM_ID::HashCalc
small class holding the starting hash value, the min eta and the number of phi bins of each region
Definition: CaloDM_ID.h:351
AtlasDetectorID::m_quiet
bool m_quiet
If true, suppress DEBUG/INFO messages.
Definition: AtlasDetectorID.h:372
CaloDM_ID::m_calodm_impl
IdDictFieldImplementation m_calodm_impl
Definition: CaloDM_ID.h:368
CaloDM_ID.h
CaloDM_ID::m_tile_region_hash_max
size_type m_tile_region_hash_max
Definition: CaloDM_ID.h:341
CaloDM_ID::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: CaloDM_ID.h:373
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:203
CaloDM_ID::m_sampling_impl
IdDictFieldImplementation m_sampling_impl
Definition: CaloDM_ID.h:370
CaloDM_ID::m_tile_zone_hash_max
size_type m_tile_zone_hash_max
Definition: CaloDM_ID.h:340
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:75
CaloDM_ID::eta_max
int eta_max(const Identifier &id) const
max value of eta index (-999 == failure)
Definition: CaloDM_ID.cxx:83
CaloDM_ID::region_id
Identifier region_id(int pos_neg_z, int dmat, int sampling, int region) const
build a region identifier valid for both LAr and Tiles
Definition: CaloDM_ID.h:415
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
CaloDM_ID::tile_zone_hash_binary_search
IdentifierHash tile_zone_hash_binary_search(Identifier zoneId) const
Definition: CaloDM_ID.h:685
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition: StrFormat.cxx:49
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
IdentifierHash.h
RangeIterator.h
CaloDM_ID::sampling
int sampling(const Identifier &id) const
return sampling according to :
Definition: CaloDM_ID.h:645
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
AtlasDetectorID::calo_exp
ExpandedIdentifier calo_exp(void) const
Definition: AtlasDetectorID.cxx:1078
CaloDM_ID::phi_max
int phi_max(const Identifier &id) const
max value of phi index (-999 == failure)
Definition: CaloDM_ID.cxx:144
CaloDM_ID::zone_context
IdContext zone_context() const
access to IdContext's which define which levels of fields are contained in a zone id
Definition: CaloDM_ID.cxx:540
CaloDM_ID::m_full_lar_zone_range
MultiRange m_full_lar_zone_range
Definition: CaloDM_ID.h:332
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
CaloDM_ID::lar_zone_hash
IdentifierHash lar_zone_hash(Identifier LArZoneId) const
create a lar hash id from zone id
Definition: CaloDM_ID.h:552
CaloDM_ID::eta
int eta(const Identifier &id) const
return eta
Definition: CaloDM_ID.h:657
CaloDM_ID::m_calodm_region_index
size_type m_calodm_region_index
Definition: CaloDM_ID.h:320
CaloDM_ID::m_region_impl
IdDictFieldImplementation m_region_impl
Definition: CaloDM_ID.h:371
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:223
CaloDM_ID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
Definition: CaloDM_ID.cxx:174
IdDictField.h
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:367
CaloDM_ID::tile_zone_id_checks
void tile_zone_id_checks(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
Definition: CaloDM_ID.cxx:589
CaloDM_ID::m_tile_hash_calcs
std::vector< HashCalc > m_tile_hash_calcs
Definition: CaloDM_ID.h:363
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
CaloDM_ID::m_dmat_impl
IdDictFieldImplementation m_dmat_impl
Definition: CaloDM_ID.h:369
CaloDM_ID::lar_zone_id
Identifier lar_zone_id(IdentifierHash lar_zone_hash_id) const
create a lar zone id from hash id
Definition: CaloDM_ID.h:520
CaloDM_ID::phi
int phi(const Identifier &id) const
return phi
Definition: CaloDM_ID.h:663
CaloDM_ID::lar_zone_id_checks
void lar_zone_id_checks(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
Definition: CaloDM_ID.cxx:575
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
CaloDM_ID::get_expanded_id
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
Definition: CaloDM_ID.cxx:514
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:83
CaloDM_ID::lar_region_id
Identifier lar_region_id(IdentifierHash lar_region_hash_id) const
create a lar region id from hash id
Definition: CaloDM_ID.h:508
ExpandedIdentifier::clear
void clear()
Erase all fields.
CaloDM_ID::is_tile
bool is_tile(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
Definition: CaloDM_ID.h:502
CaloDM_ID::m_lar_zone_hash_max
size_type m_lar_zone_hash_max
Definition: CaloDM_ID.h:333
IdDictRegion::index
size_t index() const
Definition: IdDictRegion.h:168
IdDictRegion.h
ConstRangeIterator::end
ConstRangeIterator end() const
Definition: RangeIterator.cxx:32
IdDictField
Definition: IdDictField.h:15
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: MultiRange.cxx:82
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloDM_ID::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: CaloDM_ID.h:327
CaloDM_ID::zone_id
Identifier zone_id(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
build a zone identifier valid for both LAr and Tiles
Definition: CaloDM_ID.h:463
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
CaloDM_ID::m_pnz_reg_impl
IdDictFieldImplementation m_pnz_reg_impl
Definition: CaloDM_ID.h:376
CaloDM_ID::m_tile_region_vec
std::vector< Identifier > m_tile_region_vec
Definition: CaloDM_ID.h:343
CaloDM_ID::zone_id_checks
void zone_id_checks(const Identifier &regionId, int eta, int phi) const
Definition: CaloDM_ID.cxx:604
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:52
IdDictFieldImplementation::size_type
Identifier::size_type size_type
Definition: IdDictFieldImplementation.h:62
IdDictFieldImplementation::bits
size_type bits() const
Definition: IdDictFieldImplementation.h:202
Identifier
Definition: IdentifierFieldParser.cxx:14