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