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