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