ATLAS Offline Software
JGTowerBase_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 "IdDict/IdDictField.h"
8 #include "IdDict/IdDictRegion.h"
9 #include "IdDict/IdDictMgr.h"
11 #include "CxxUtils/StrFormat.h"
12 #include "GaudiKernel/MsgStream.h"
15 #include <algorithm>
16 #include <cassert>
17 #include <cmath>
18 #include <cstdio>
19 #include <iostream>
20 #include <set>
21 #include <string>
22 
24 
25 
27  const std::string& group) :
29  , m_jgtower_region_index(0)
30  , m_CALO_INDEX(999)
31  , m_DETZSIDE_INDEX(999)
32  , m_SAMPLING_INDEX(999)
33  , m_REGION_INDEX(999)
34  , m_ETA_INDEX(999)
35  , m_PHI_INDEX(999)
36  , m_dict(nullptr)
37  , m_tower_hash_max(0)
38  , m_calo_region_hash_max(0)
39 
40 {
41 
42 }
43 
45 
46 
47 
48 IdContext
50 {
52  return {id, 0, m_REGION_INDEX};
53 }
54 
55 IdContext
57 {
59  return {id, 0, m_PHI_INDEX};
60 }
61 
62 
63 int JGTowerBase_ID::get_id (const IdentifierHash& hash_id, Identifier& id, const IdContext* context) const
64 {
65  MsgStream log(m_msgSvc, "JGTowerBase_ID" );
66  std::stringstream strm;
67  std::string strg;
68  int result = 1;
69  id.clear();
70 
71  size_t begin = (context) ? context->begin_index(): 0;
72  // cannot get hash if end is 0:
73  size_t end = (context) ? context->end_index() : 0;
74 
75  if (0 == begin) {
76  if (m_REGION_INDEX == end) {
77  if (hash_id < (unsigned int)(m_region_vec.end() - m_region_vec.begin()))
78  {
79  id = m_region_vec[hash_id];
80  result = 0;
81  }
82  else
83  {
84  strm << hash_id;
85  strg = " hash_id out of range "+strm.str();
86  if(m_msgSvc)
87  {
88  log << MSG::ERROR << strg << endmsg;
89  }
90  else
91  {
92  std::cout << strg << std::endl;
93  }
94  }
95  }
96  else if (m_PHI_INDEX == end) {
97  if (hash_id < (unsigned int)(m_tower_vec.end() - m_tower_vec.begin())) {
98  id = m_tower_vec[hash_id];
99  result = 0;
100  }
101  else
102  {
103  strm << hash_id;
104  strg = " hash_id out of range "+strm.str();
105  if(m_msgSvc)
106  {
107  log << MSG::ERROR << strg << endmsg;
108  }
109  else
110  {
111  std::cout << strg << std::endl;
112  }
113  }
114  }
115  }
116  return(result);
117 }
118 
119 int JGTowerBase_ID::get_hash (const Identifier& id, IdentifierHash& hash_id, const IdContext* context) const
120 {
121  hash_id = 0;
122  int result = 1;
123 
124  size_t begin = (context) ? context->begin_index(): 0;
125  size_t end = (context) ? context->end_index() : 0;
126 
127  if (0 == begin) {
128  if (m_REGION_INDEX == end) {
129  Identifier redId = region_id (id);
130  std::vector<Identifier>::const_iterator it = std::lower_bound(m_region_vec.begin(),m_region_vec.end(),redId);
131  if ( it != m_region_vec.end() ){
132  hash_id = it - m_region_vec.begin();
133  result = 0;
134  }
135  }
136  else if (m_PHI_INDEX == end) {
137 
138  //Identifier redId = tower_id (id);
139 
140  std::vector<Identifier>::const_iterator it = std::lower_bound(m_tower_vec.begin(),m_tower_vec.end(),id);
141  if ( it != m_tower_vec.end() ){
142  hash_id = it - m_tower_vec.begin();
143  result = 0;
144  }
145  }
146 
147  else {
148  std::string errorMessage =
149  "Error in JGTowerBase_ID::get_hash, invalid context ";
150  throw CaloID_Exception(errorMessage , 10);
151  }
152  }
153 
154  return (result);
155 }
156 
157 
159 {
160  IdentifierHash regHash;
161  IdContext regionContext = region_context();
162  int sc = get_hash(regId, regHash, &regionContext);
163  if (sc!=0) return NOT_VALID;
164  return regHash;
165 }
166 
167 
168 int JGTowerBase_ID::initialize_base_from_dictionary (const IdDictMgr& dict_mgr, const std::string& t_pre)
169 {
170  MsgStream log(m_msgSvc, "JGTowerBase_ID" );
171  std::string strg = "initialize_from_dictionary";
172  if(m_msgSvc) {
173  log << MSG::INFO << strg << endmsg;
174  }
175  else {
176  std::cout << strg << std::endl;
177  }
178 
179  // Check whether this helper should be reinitialized
180  if (!reinitialize(dict_mgr)) {
181  if(m_msgSvc)log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
182  return (0);
183  }
184  else {
185  if(m_msgSvc)log << MSG::DEBUG << "(Re)initialize" << endmsg;
186  }
187 
188  std::stringstream strm;
189  std::stringstream strm1;
190  std::stringstream strm2;
191  std::string strg1;
192  std::string strg2;
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  {
203  strg= " initialize_from_dict - cannot access Calorimeter dictionary ";
204  if(m_msgSvc) {
205  log << MSG::ERROR << strg << endmsg;
206  }
207  else
208  {
209  std::cout << strg << std::endl;
210  }
211  return(1);
212  }
213 
214  // Initialize the field indices
215  if(initLevelsFromDict(t_pre)) return (1);
216 
217  // Find values for the calo and JGTOWER (neg) fields
218  int caloValue = -1;
219  if (m_dict->get_label_value("subdet", "Calorimeter", caloValue))
220  {
221  strm << m_dict->name();
222  strg= "Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
223  if(m_msgSvc)
224  {
225  log << MSG::ERROR << strg << endmsg;
226  }
227  else
228  {
229  std::cout << strg << std::endl;
230  }
231  return (1);
232  }
233 
234  int jgtowerCaloValue = -1;
235  // negative half
236  // if (m_dict->get_label_value("DetZside", "negative_jgtower_side", jgtowerCaloValue))
237  // positive half FLG 12 Jul 07: negative side -> problem for test beam
238  if (m_dict->get_label_value("DetZside", "positive_lvl1_side", jgtowerCaloValue))
239  {
240  strm << m_dict->name();
241  // strg = " Could not get value for label 'negative_jgtower_side' of field 'DetZside in dictionary"+strm.str();
242  strg = " Could not get value for label positive_lvl1_side of field 'DetZside in dictionary"+strm.str();
243  if(m_msgSvc)
244  {
245  log << MSG::ERROR << strg << endmsg;
246  }
247  else
248  {
249  std::cout << strg << std::endl;
250  }
251  return (1);
252  }
253 
254  // Set up id for region and range prefix
255  // NOTE: negative value is good enough to get multirange since the
256  // regions are symmetric in +/-eta
257  // FLG Jul 07: EXCEPT FOR CTB !!!!!!!!!!
258 
259  ExpandedIdentifier reg_id;
260  reg_id.add(caloValue);
261  reg_id.add(jgtowerCaloValue);
262  Range prefix;
263  m_full_reg_range = m_dict->build_multirange(reg_id, "Reg_"+t_pre+"ower", prefix, t_pre+"region");
264  m_full_tower_range = m_dict->build_multirange(reg_id, "Reg_"+t_pre+"ower", prefix, t_pre+"phi");
265 
266  // Setup the hash tables
267  if(init_hashes()) return (1);
268 
269  // initialize dictionary regions
270  if (fill_vec_of_dict_regions ("Reg_"+t_pre+"ower")) return 1;
271 
272  // Setup hash tables for finding neighbors
273  if(init_neighbors()) return (1);
274 
275  strm1 << (std::string)m_full_tower_range;
276  strg = " JGTowerBase_ID::initialize_from_dict : ";
277  strg1 = " tower range -> "+strm1.str();
278  if(m_msgSvc)
279  {
280  log << MSG::DEBUG << strg << endmsg;
281  log << MSG::DEBUG << strg1 << endmsg;
282  log << MSG::DEBUG << strg2 << endmsg;
283  }
284  else
285  {
286  std::cout << strg << std::endl;
287  std::cout << strg1 << std::endl;
288  std::cout << strg2 << std::endl;
289  }
290 
291  //std::cout << " JGTowerBase_ID::initialize_from_dict : "
292  // << std::endl;
293  //std::cout << " tower range -> " << (std::string)m_full_tower_range
294  // << std::endl;
295  //std::cout << " layer range -> " << (std::string)m_full_layer_range
296  // << std::endl;
297 
298 
299  // Setup for hash calculation
300 
301  // Regions have uniform eta/phi granularity
302  // The lookup table only needs to contain the
303  // hash offset for each region, the first eta index
304  // and the number of phi cells.
305 
306  // The implementation requires:
307 
308  // 1) a lookup table for each region containing hash offset,
309  // etamin and nphi
310  // 2) a decoder to access the "index" corresponding to the
311  // pnz/samp/reg fields. These fields use 6 bits, so the
312  // vector has a length of 64 for 16 regions.
313 
314 
315  // Create decoder for fields pnz to region
317  m_jgtower_impl.bits() +
321  m_pnz_reg_impl.set_bits(bits, bits_offset);
322  int size = (1 << bits);
323 
324  // std::cout << "pnz_reg "
325  // << m_pnz_reg_impl.show_to_string() << std::endl;
326  // std::cout << "size " << size << std::endl;
327 
328 
329  // std::cout << "pnz_reg " << m_pnz_reg_impl.decode_index() << " "
330  // << (std::string)m_pnz_reg_impl.ored_field() << " "
331  // << std::hex << m_pnz_reg_impl.mask() << " "
332  // << m_pnz_reg_impl.zeroing_mask() << " "
333  // << std::dec << m_pnz_reg_impl.shift()
334  // << " " << m_pnz_reg_impl.bits() << " " <<m_pnz_reg_impl.bits_offset()
335  // << std::endl;
336 
337 
338  // Set up vector as lookup table for hash calculation.
339  m_hash_calcs.resize(size);
340 
341  for (unsigned int i = 0; i < m_calo_region_hash_max; ++i) {
342 
343  Identifier regId = region_id(i) ;
344 
345  HashCalc hc;
346 
347  int etamin = eta_min(regId);
348  Identifier min = tower_id ( regId, etamin, 0);
350  hc.m_hash = min_hash;
351  hc.m_etamin = etamin;
352  hc.m_nphi = phi_max(min)+1 ;
354 
355  if (m_pnz_reg_impl.unpack(min) >= size)
356  {
357  strm << size;
358  strm1 << show_to_string(min);
359  strm2 << m_pnz_reg_impl.unpack(min);
360  strg = "Min > "+strm.str();
361  strg1= " "+strm1.str();
362  strg2= " "+strm2.str();
363  if(m_msgSvc)
364  {
365  log << MSG::DEBUG << strg << endmsg;
366  log << MSG::DEBUG << strg1 << endmsg;
367  log << MSG::DEBUG << strg2 << endmsg;
368  }
369  else
370  {
371  std::cout << strg << std::endl;
372  std::cout << strg1 << std::endl;
373  std::cout << strg2 << std::endl;
374  }
375  //std::cout << "min > " << size << " "
376  // << i << " "
377  // << show_to_string(min) << " "
378  // << m_pnz_reg_impl.unpack(min) << " "
379  // << std::endl;
380  }
381  }
382 
383  // Check hash calculation
384  for (unsigned int i = 0; i < m_tower_hash_max; ++i) {
385  Identifier id = tower_id(i);
386  if (tower_hash(id) != i)
387  {
388  strm << show_to_string(id);
389  strm1 << tower_hash(id);
390  strm2 << i;
391  strg = " ***** Error tower ranges, id, hash, i = "+strm.str();
392  strg1= " , "+strm1.str();
393  strg2= " , "+strm2.str();
394  if(m_msgSvc)
395  {
396  log << MSG::ERROR << strg << endmsg;
397  log << MSG::ERROR << strg1 << endmsg;
398  log << MSG::ERROR << strg2 << endmsg;
399  }
400  else
401  {
402  std::cout << strg << std::endl;
403  std::cout << strg1 << std::endl;
404  std::cout << strg2 << std::endl;
405  }
406 
407  //std::cout << "tower ranges, id, hash, i = "
408  // << show_to_string(id) << ", "
409  // << tower_hash(id) << ", "
410  // << i
411  // << std::endl;
412  }
413  }
414 
415  return 0;
416 
417 }
418 
419 
420 
421 
422 int JGTowerBase_ID::eta_min(const Identifier regId) const
423 {
424  ExpandedIdentifier expId;
425  IdContext region_cntxt = region_context();
426  if(!get_expanded_id(regId, expId, &region_cntxt)) {
427  int result = -999;
428  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
429  const Range& range = m_full_tower_range[i];
430  if (range.match(expId)) {
431  const Range::field& eta_field = range[m_ETA_INDEX];
432  if (not eta_field.empty()) {
433  int etamin = eta_field.get_minimum();
434  if (-999 == result) {
435  result = etamin;
436  }
437  else {
438  if (etamin < result) result = etamin;
439  }
440  }
441  }
442  }
443  return (result);
444  }
445  return (-999);
446 }
447 
448 int JGTowerBase_ID::eta_max(const Identifier regId) const
449 {
450  ExpandedIdentifier expId;
451  IdContext region_cntxt = region_context();
452  if(!get_expanded_id(regId, expId, &region_cntxt)) {
453  int result = -999;
454  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
455  const Range& range = m_full_tower_range[i];
456  if (range.match(expId)) {
457  const Range::field& eta_field = range[m_ETA_INDEX];
458  if (not eta_field.empty()) {
459  int etamax = eta_field.get_maximum();
460  if (result < etamax) result = etamax;
461  }
462  }
463  }
464  return (result);
465  }
466  return (-999); // default
467 }
468 
469 int JGTowerBase_ID::phi_max(const Identifier regId) const
470 {
471  ExpandedIdentifier expId;
472  IdContext region_cntxt = region_context();
473  if(!get_expanded_id(regId, expId, &region_cntxt)) {
474  int result = -999;
475  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
476  const Range& range = m_full_tower_range[i];
477  if (range.match(expId)) {
478  const Range::field& phi_field = range[m_PHI_INDEX];
479  if (not phi_field.empty()) {
480  int phimax = phi_field.get_maximum();
481  if (result < phimax) result = phimax;
482  }
483  }
484  }
485  return (result);
486  }
487  return (-999); // default
488 }
489 
491 {
492  IdentifierHash regHash = calo_region_hash(regId);
493  if (regHash >= m_vecOfDictRegions.size()) return NOT_VALID;
494  return m_vecOfDictRegions[regHash]->deta();
495 }
496 
498 {
499  IdentifierHash regHash = calo_region_hash(regId);
500  if (regHash >= m_vecOfDictRegions.size()) return NOT_VALID;
501  return m_vecOfDictRegions[regHash]->dphi();
502 }
503 
504 float JGTowerBase_ID::eta0(const Identifier regId) const
505 {
506  IdentifierHash regHash = calo_region_hash(regId);
507  if (regHash >= m_vecOfDictRegions.size()) return NOT_VALID;
508  return m_vecOfDictRegions[regHash]->eta0();
509 }
510 
511 float JGTowerBase_ID::phi0(const Identifier regId) const
512 {
513  IdentifierHash regHash = calo_region_hash(regId);
514  if (regHash >= m_vecOfDictRegions.size()) return NOT_VALID;
515  return m_vecOfDictRegions[regHash]->phi0();
516 }
517 
518 int
520 {
521  unsigned short index = id;
522  if (index < m_prev_phi_vec.size()) {
523  if (m_prev_phi_vec[index] == NOT_VALID_HASH) return (1);
524  prev = m_prev_phi_vec[index];
525  return (0);
526  }
527  return (1);
528 }
529 
530 int
532 {
533  unsigned short index = id;
534  if (index < m_next_phi_vec.size()) {
535  if (m_next_phi_vec[index] == NOT_VALID_HASH) return (1);
537  return (0);
538  }
539  return (1);
540 }
541 
542 int
544 {
545  unsigned short index = id;
546  if (index < m_prev_eta_vec.size()) {
547  if (m_prev_eta_vec[index] == NOT_VALID_HASH) return (1);
548  prev = m_prev_eta_vec[index];
549  return (0);
550  }
551  return (1);
552 }
553 
554 int
556 {
557  unsigned short index = id;
558  if (index < m_next_eta_vec.size()) {
559  if (m_next_eta_vec[index] == NOT_VALID_HASH) return (1);
561  return (0);
562  }
563  return (1);
564 }
565 
566 
567 int JGTowerBase_ID::get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const
568 {
569  // We assume that the context is >= region
570  exp_id.clear();
571  exp_id << calo_field_value()
572  << pos_neg(id)
573  << sampling(id)
574  << region(id);
575  if(context && context->end_index() >= m_ETA_INDEX) {
576  exp_id << eta(id);
577  if(context->end_index() >= m_PHI_INDEX) {
578  exp_id << phi(id);
579  }
580  }
581  return (0);
582 }
583 void JGTowerBase_ID::tower_id_checks ( int pos_neg, int sampling, int region,
584  int eta, int phi ) const
585 {
586  // Fill expanded id
588  id << pos_neg << sampling <<
589  region << eta << phi;
590 
591  if (!m_full_tower_range.match(id)) {
592  std::string errorMessage = "JGTowerBase_ID::tower_id() result is not OK: ID, range = "
593  + std::string(id) + " , " + (std::string)m_full_tower_range;
594  throw CaloID_Exception(errorMessage , 2);
595  }
596 }
597 
599  int eta, int phi ) const
600 {
601  // Fill expanded id
603 
604  IdContext context = region_context();
605  if (get_expanded_id(regionId, id, &context)) {
606  std::string errorMessage = "JGTowerBase_ID::tower_id(regionId) result is not OK: ID= "
607  + show_to_string(regionId) ;
608  throw CaloID_Exception(errorMessage , 2);
609  }
610 
611  id << eta << phi;
612 
613  if (!m_full_tower_range.match(id)) {
614  std::string errorMessage = "JGTowerBase_ID::tower_id(regionId,field values) result is not OK: ID, range = "
615  + std::string(id) + " , " + (std::string)m_full_tower_range;
616  throw CaloID_Exception(errorMessage , 2);
617  }
618 }
619 
620 void JGTowerBase_ID::region_id_checks (int pos_neg, int sampling, int region)const
621 {
622  // Fill expanded id
624  id << pos_neg << sampling << region ;
625 
626  if (!m_full_reg_range.match(id)) {
627  std::string errorMessage = "JGTowerBase_ID::region_id() result is not OK: ID, range = "
628  + std::string(id) + " , " + (std::string)m_full_reg_range;
629  throw CaloID_Exception(errorMessage , 2);
630  }
631 }
632 
633 int JGTowerBase_ID::initLevelsFromDict(const std::string& t_pre)
634 {
635  MsgStream log(m_msgSvc, "JGTowerBase_ID" );
636  std::stringstream strm;
637  std::stringstream strm1;
638  std::stringstream strm2;
639  std::stringstream strm3;
640  std::stringstream strm4;
641  std::stringstream strm5;
642  std::stringstream strm6;
643  std::stringstream strm7;
644  std::string strg;
645  std::string strg1;
646  std::string strg2;
647  std::string strg3;
648  std::string strg4;
649  std::string strg5;
650  std::string strg6;
651  std::string strg7;
652  if(!m_dict)
653  {
654  strg= "initLevelsFromDict - dictionary NOT initialized ";
655  if(m_msgSvc) {
656  log << MSG::ERROR << strg << endmsg;
657  }
658  else
659  {
660  std::cout << strg << std::endl;
661  }
662  return (1);
663  }
664 
665  // Find out which identifier field corresponds to each level.
666 
667  m_CALO_INDEX = 999 ;
668  m_DETZSIDE_INDEX = 999 ;
669  m_SAMPLING_INDEX = 999 ;
670  m_REGION_INDEX = 999 ;
671  m_ETA_INDEX = 999 ;
672  m_PHI_INDEX = 999 ;
673 
674  // Save index to a JGTOWER region for unpacking - search with region name
675  IdDictRegion* reg = m_dict->find_region(t_pre+"ower_0");
676  if (reg)
677  {
678  m_jgtower_region_index = reg->index();
679  }
680  else
681  {
682  strg = "initLevelsFromDict - unable to find jgtower region ";
683  if(m_msgSvc) {
684  log << MSG::ERROR << strg << endmsg;
685  }
686  else
687  {
688  std::cout << strg << std::endl;
689  }
690  return (1);
691  }
692 
693  // Fing a JGTOWER region
694  IdDictField* field = m_dict->find_field("subdet") ;
695  if (field) {
696  m_CALO_INDEX = field->index();
697  }
698  else
699  {
700  strg= "initLevelsFromDict - unable to find 'subdet' field ";
701  if(m_msgSvc)
702  {
703  log << MSG::ERROR << strg << endmsg;
704  }
705  else
706  {
707  std::cout << strg << std::endl;
708  }
709  return (1);
710  }
711 
712  field = m_dict->find_field("DetZside") ;
713  if (field) {
714  m_DETZSIDE_INDEX = field->index();
715  }
716  else
717  {
718  strg= "initLevelsFromDict - unable to find 'DetZside' field ";
719  if(m_msgSvc)
720  {
721  log << MSG::ERROR << strg << endmsg;
722  }
723  else
724  {
725  std::cout << strg << std::endl;
726  }
727  return (1);
728  }
729 
730  field = m_dict->find_field(t_pre+"sampling") ;
731  if (field) {
732  m_SAMPLING_INDEX = field->index();
733  }
734  else
735  {
736 
737  strg="initLevelsFromDict - unable to find '"+t_pre+"sampling' field ";
738  if(m_msgSvc)
739  {
740  log << MSG::ERROR << strg << endmsg;
741  }
742  else
743  {
744  std::cout << strg << std::endl;
745  }
746  return (1);
747  }
748 
749  field = m_dict->find_field(t_pre+"region") ;
750  if (field) {
751  m_REGION_INDEX = field->index();
752  }
753  else
754  {
755 
756  strg="initLevelsFromDict - unable to find 'region' field ";
757  if(m_msgSvc)
758  {
759  log << MSG::ERROR << strg << endmsg;
760  }
761  else
762  {
763  std::cout << strg << std::endl;
764  }
765  return (1);
766  }
767 
768  /* std::cout << "m_region= " << m_REGION_INDEX << std::endl; */
769 
770  field = m_dict->find_field(t_pre+"eta") ;
771  if (field) {
772  m_ETA_INDEX = field->index();
773  }
774  else
775  {
776  strg= "initLevelsFromDict - unable to find 'eta' field ";
777  if(m_msgSvc)
778  {
779  log << MSG::ERROR << strg << endmsg;
780  }
781  else
782  {
783  std::cout << strg << std::endl;
784  }
785  return (1);
786  }
787 
788  field = m_dict->find_field(t_pre+"phi") ;
789  if (field) {
790  m_PHI_INDEX = field->index();
791  }
792  else
793  {
794 
795  strg= "initLevelsFromDict - unable to find 'phi' field ";
796  if(m_msgSvc)
797  {
798  log << MSG::ERROR << strg << endmsg;
799  }
800  else
801  {
802  std::cout << strg << std::endl;
803  }
804  return (1);
805  }
806  // Set the field implementations
807 
809 
810  m_calo_impl = region.implementation(m_CALO_INDEX);
811  m_jgtower_impl = region.implementation(m_DETZSIDE_INDEX);
812  m_sampling_impl = region.implementation(m_SAMPLING_INDEX);
813  m_region_impl = region.implementation(m_REGION_INDEX);
814  m_eta_impl = region.implementation(m_ETA_INDEX);
815  m_phi_impl = region.implementation(m_PHI_INDEX);
816 
817  strm1 << m_calo_impl.show_to_string();
818  strm2 << m_jgtower_impl.show_to_string();
819  strm3 << m_sampling_impl.show_to_string();
820  strm4 << m_region_impl.show_to_string();
821  strm5 << m_eta_impl.show_to_string();
822  strm6 << m_phi_impl.show_to_string();
823  strg = "decode index and bit fields for each level: ";
824  strg1= "calo "+strm1.str();
825  strg2= "detzside "+strm2.str();
826  strg3= "sampling "+strm3.str();
827  strg4= "reg "+strm4.str();
828  strg5= "eta "+strm5.str();
829  strg6= "phi "+strm6.str();
830  if(m_msgSvc)
831  {
832  log << MSG::DEBUG << strg << endmsg;
833  log << MSG::DEBUG << strg1 << endmsg;
834  log << MSG::DEBUG << strg2 << endmsg;
835  log << MSG::DEBUG << strg3 << endmsg;
836  log << MSG::DEBUG << strg4 << endmsg;
837  log << MSG::DEBUG << strg5 << endmsg;
838  log << MSG::DEBUG << strg6 << endmsg;
839  }
840  else
841  {
842  std::cout << strg << std::endl;
843  std::cout << strg1 << std::endl;
844  std::cout << strg2 << std::endl;
845  std::cout << strg3 << std::endl;
846  std::cout << strg4 << std::endl;
847  std::cout << strg5 << std::endl;
848  std::cout << strg6 << std::endl;
849  }
850 
851  return(0) ;
852 }
853 
854 
856 {
857  MsgStream log(m_msgSvc, "JGTowerBase_ID" );
858  std::stringstream strm;
859  std::stringstream strm1;
860  std::stringstream strm2;
861  std::string strg;
862  std::string strg1;
863  std::string strg2;
864  // tower hash
867  unsigned int nids = 0;
868  std::set<Identifier> ids;
869  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
870  const Range& range = m_full_tower_range[i];
872  auto first = rit.begin();
873  auto last = rit.end();
874  for (; first != last; ++first) {
875  const ExpandedIdentifier& exp_id = (*first);
876  Identifier tow_id = tower_id ( exp_id[m_DETZSIDE_INDEX],
877  exp_id[m_SAMPLING_INDEX],
878  exp_id[m_REGION_INDEX] ,
879  exp_id[m_ETA_INDEX] ,
880  exp_id[m_PHI_INDEX] ) ;
881  if(!(ids.insert(tow_id)).second)
882  {
883  if(m_msgSvc)
884  {
885  log << MSG::ERROR << " init_hashes "
886  << " duplicated id for J/GTower id. nids= " << nids
887  << " compact Id " << endmsg;
888  }
889  else
890  {
891  std::cout << " JGTowerBase_ID::init_hashes "
892  << " Error: duplicated id for J/GTower id. nids= " << nids
893  << " compact Id " ;
894  (*first).show();
895  std::cout << " " << show_to_string(tow_id) << std::endl;
896  }
897  }
898  nids++;
899  }
900  }
901  if(ids.size() != m_tower_hash_max)
902  {
903  if( m_msgSvc)
904  {
905  log << MSG::ERROR << " init_hashes "
906  << " set size NOT EQUAL to hash max. size " << ids.size()
907  << " hash max " << m_tower_hash_max
908  << endmsg;
909  }
910  else
911  {
912  std::cout << " JGTowerBase_ID::init_hashes "
913  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
914  << " hash max " << m_tower_hash_max
915  << std::endl;
916  }
917  return (1);
918  }
919 
920  nids=0;
921  std::set<Identifier>::const_iterator first = ids.begin();
922  std::set<Identifier>::const_iterator last = ids.end();
923  for (;first != last && nids < m_tower_vec.size(); ++first) {
924  m_tower_vec[nids] = (*first) ;
925  nids++;
926  }
927  // region hash
930  nids = 0;
931  ids.clear();
932  for (unsigned int i = 0; i < m_full_reg_range.size(); ++i) {
933  const Range& range = m_full_reg_range[i];
935  auto first = rit.begin();
936  auto last = rit.end();
937  for (; first != last; ++first) {
938  const ExpandedIdentifier& exp_id = (*first);
939  Identifier reg_id = region_id ( exp_id[m_DETZSIDE_INDEX],
940  exp_id[m_SAMPLING_INDEX],
941  exp_id[m_REGION_INDEX] );
942  if(!(ids.insert(reg_id)).second)
943  {
944  if(m_msgSvc)
945  {
946  log << MSG::ERROR << " JGTowerBase_ID::init_hashes "
947  << " duplicated id for region id. nids= " << nids
948  << " compact Id " << endmsg;
949  }
950  else
951  {
952  std::cout << " JGTowerBase_ID::init_hashes "
953  << " Error: duplicated id for region id. nids= " << nids
954  << " compact Id " ;
955  (*first).show();
956  std::cout << " " << show_to_string(reg_id) << std::endl;
957  std::cout << std::endl;
958  }
959  }
960  nids++;
961  }
962  }
963  if(ids.size() != m_calo_region_hash_max)
964  {
965  if(m_msgSvc)
966  {
967  log << MSG::ERROR << " JGTowerBase_ID::init_hashes "
968  << " set size NOT EQUAL to region hash max. size " << ids.size()
969  << " region hash max " << m_calo_region_hash_max
970  << endmsg;
971  }
972  else
973  {
974  std::cout << " JGTowerBase_ID::init_hashes "
975  << " Error: set size NOT EQUAL to region hash max. size " << ids.size()
976  << " region hash max " << m_calo_region_hash_max
977  << std::endl;
978  }
979  return (1);
980  }
981  nids=0;
982  first = ids.begin();
983  last = ids.end();
984  for (;first != last && nids < m_region_vec.size(); ++first) {
985  m_region_vec[nids] = (*first) ;
986  nids++;
987  }
988 
989  return (0);
990 }
991 
992 
993 
995 {
996  MsgStream log(m_msgSvc, "JGTowerBase_ID" );
997  // std::cout << " JGTowerBase_ID::init_neighbors " << std::endl;
998  // std::cout << " m_tower_hash_max, NOT_VALID_HASH = " << m_tower_hash_max << " " << NOT_VALID_HASH << std::endl;
999 
1004  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
1005  const Range& range = m_full_tower_range[i];
1006  const Range::field& eta_field = range[m_ETA_INDEX];
1007  const Range::field& phi_field = range[m_PHI_INDEX];
1009  auto first = rit.begin();
1010  auto last = rit.end();
1011  for (; first != last; ++first) {
1012  const ExpandedIdentifier& exp_id = (*first);
1013  ExpandedIdentifier::element_type previous_eta;
1015  ExpandedIdentifier::element_type previous_phi;
1017  bool peta = eta_field.get_previous(exp_id[m_ETA_INDEX], previous_eta);
1018  bool neta = eta_field.get_next (exp_id[m_ETA_INDEX], next_eta);
1019  bool pphi = phi_field.get_previous(exp_id[m_PHI_INDEX], previous_phi);
1020  bool nphi = phi_field.get_next (exp_id[m_PHI_INDEX], next_phi);
1021 
1022  IdContext tcontext = tower_context();
1023 
1024  // Get and save region id to speed things up
1025  Identifier reg_id = region_id ( exp_id[m_DETZSIDE_INDEX],
1026  exp_id[m_SAMPLING_INDEX],
1027  exp_id[m_REGION_INDEX] );
1028 
1029  // First get primary hash id
1030  IdentifierHash hash_id;
1031  Identifier id = tower_id (reg_id,
1032  exp_id[m_ETA_INDEX],
1033  exp_id[m_PHI_INDEX]);
1034  if (get_hash(id, hash_id,&tcontext))
1035  {
1036  if( m_msgSvc )
1037  {
1038  log << MSG::ERROR << " init_neighbors - unable to get hash, compact = " << endmsg;
1039  }
1040  else
1041  {
1042  std::cout << " JGTowerBase_ID::init_neighbors - unable to get hash, compact = ";
1043  exp_id.show();
1044  std::cout << std::endl;
1045  }
1046  return (1);
1047  }
1048 
1049  // index for the subsequent arrays
1050  unsigned short index = hash_id;
1051  assert (hash_id < m_prev_phi_vec.size());
1052  assert (hash_id < m_next_phi_vec.size());
1053  assert (hash_id < m_prev_eta_vec.size());
1054  assert (hash_id < m_next_eta_vec.size());
1055 
1056  if (pphi) {
1057  // Get previous phi hash id
1058  id = tower_id (reg_id,
1059  exp_id[m_ETA_INDEX],
1060  previous_phi);
1061  // forward to compact -> hash
1062  if (get_hash(id, hash_id,&tcontext))
1063  {
1064  if( m_msgSvc )
1065  {
1066  log << MSG::ERROR << " init_neighbors - unable to get previous phi hash, exp/compact " << endmsg;
1067  }
1068  else
1069  {
1070  std::cout << " JGTowerBase_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1071  exp_id.show();
1072  std::cout << " "
1073  << std::endl;
1074  }
1075  return (1);
1076  }
1077  m_prev_phi_vec[index] = hash_id;
1078  }
1079 
1080  if (nphi) {
1081  // Get next phi hash id
1082  id = tower_id (reg_id,
1083  exp_id[m_ETA_INDEX],
1084  next_phi);
1085  // forward to compact -> hash
1086  if (get_hash(id, hash_id,&tcontext))
1087  {
1088  if(m_msgSvc)
1089  {
1090  log << MSG::ERROR << " init_neighbors - unable to get next phi hash, exp/compact "<<endmsg;
1091  }
1092  else
1093  {
1094  std::cout << " JGTowerBase_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1095  exp_id.show();
1096  std::cout << " "
1097  << std::endl;
1098  }
1099  return (1);
1100  }
1101  m_next_phi_vec[index] = hash_id;
1102  }
1103  if (peta) {
1104  // Get previous eta hash id
1105  id = tower_id (reg_id,
1106  previous_eta,
1107  exp_id[m_PHI_INDEX]);
1108  // forward to compact -> hash
1109  if (get_hash(id, hash_id,&tcontext))
1110  {
1111  if( m_msgSvc )
1112  {
1113  log << MSG::ERROR << " init_neighbors - unable to get previous eta hash, exp/compact "<< endmsg;
1114  }
1115  else
1116  {
1117  std::cout << " JGTowerBase_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1118  exp_id.show();
1119  std::cout << " "
1120  << std::endl;
1121  }
1122  return (1);
1123  }
1124  m_prev_eta_vec[index] = hash_id;
1125  }
1126 
1127  if (neta) {
1128  // Get next eta hash id
1129  id = tower_id (reg_id,
1130  next_eta,
1131  exp_id[m_PHI_INDEX]);
1132  // forward to compact -> hash
1133  if (get_hash(id, hash_id,&tcontext))
1134  {
1135  if( m_msgSvc )
1136  {
1137  log << MSG::ERROR << " init_neighbors - unable to get next eta hash, exp/compact ";
1138  }
1139  else
1140  {
1141  std::cout << " JGTowerBase_ID::init_neighbors - unable to get next eta hash, exp/compact ";
1142  exp_id.show();
1143  std::cout << " "
1144  << std::endl;
1145  }
1146  return (1);
1147  }
1148  m_next_eta_vec[index] = hash_id;
1149  } // end neta cond
1150  } // end loop on identifiers
1151  } // end loop on ranges
1152  return (0);
1153 }
1154 
1155 int
1157 {
1158  m_vecOfDictRegions.clear();
1160  IdContext region_cntxt = region_context();
1161  ExpandedIdentifier expRegId;
1162  for (unsigned int i = 0; i < m_calo_region_hash_max; ++i) {
1163  Identifier id = region_id(i);
1164  if(!get_expanded_id(id, expRegId, &region_cntxt)) {
1165  m_vecOfDictRegions.push_back (m_dict->find_region(expRegId,group_name));
1166  }
1167  }
1168  //assert (m_vecOfDictRegions.size() == regions().hash_max());
1169  return 0;
1170 }
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictDictionary.cxx:101
IdDictMgr.h
JGTowerBase_ID::get_prev_in_phi
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
access to hashes for neighbours in phi – towers only (no extended) return == 0 for neighbours found
Definition: JGTowerBase_ID.cxx:519
ConstRangeIterator
Definition: RangeIterator.h:46
JGTowerBase_ID::m_vecOfDictRegions
std::vector< const IdDictRegion * > m_vecOfDictRegions
List of IdDictRegion objects.
Definition: JGTowerBase_ID.h:327
JGTowerBase_ID::eta
int eta(const Identifier id) const
return eta according to :
Definition: JGTowerBase_ID.h:484
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:290
JGTowerBase_ID::fill_vec_of_dict_regions
int fill_vec_of_dict_regions(const std::string &group_name="")
Definition: JGTowerBase_ID.cxx:1156
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:255
get_generator_info.result
result
Definition: get_generator_info.py:21
JGTowerBase_ID::phi0
float phi0(const Identifier regId) const
Return the minimum phi of region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:511
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
JGTowerBase_ID::m_prev_eta_vec
std::vector< unsigned short > m_prev_eta_vec
Definition: JGTowerBase_ID.h:323
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:32
JGTowerBase_ID::tower_id_checks
void tower_id_checks(int pos_neg, int sampling, int region, int eta, int phi) const
Definition: JGTowerBase_ID.cxx:583
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
JGTowerBase_ID::calo_region_hash
IdentifierHash calo_region_hash(const Identifier id) const
Definition: JGTowerBase_ID.cxx:158
index
Definition: index.py:1
IdDictDictionary::region
const IdDictRegion & region(size_t i) const
Region at index i.
Definition: IdDictDictionary.h:350
JGTowerBase_ID::HashCalc::m_etamin
size_type m_etamin
Definition: JGTowerBase_ID.h:342
JGTowerBase_ID::tower_hash
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
Definition: JGTowerBase_ID.h:586
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:121
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
IdDictDictionary.h
JGTowerBase_ID::phi
int phi(const Identifier id) const
return phi according to :
Definition: JGTowerBase_ID.h:490
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
JGTowerBase_ID::get_hash
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
create hash id from compact id (return == 0 for OK)
Definition: JGTowerBase_ID.cxx:119
JGTowerBase_ID::m_sampling_impl
IdDictFieldImplementation m_sampling_impl
Definition: JGTowerBase_ID.h:351
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
skel.it
it
Definition: skel.GENtoEVGEN.py:407
JGTowerBase_ID::m_next_eta_vec
std::vector< unsigned short > m_next_eta_vec
Definition: JGTowerBase_ID.h:324
JGTowerBase_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
Definition: JGTowerBase_ID.h:473
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
JGTowerBase_ID::region
int region(const Identifier id) const
return region according to :
Definition: JGTowerBase_ID.h:478
ExpandedIdentifier::show
void show() const
Send to std::cout.
Definition: DetectorDescription/Identifier/src/ExpandedIdentifier.cxx:60
JGTowerBase_ID::tower_context
IdContext tower_context() const
access to IdContext's which define which levels of fields are contained in the id
Definition: JGTowerBase_ID.cxx:56
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:369
JGTowerBase_ID::phi_max
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
Definition: JGTowerBase_ID.cxx:469
JGTowerBase_ID::get_prev_in_eta
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
access to hashes for neighbours in eta – towers only (no extended) return == 0 for neighbours found
Definition: JGTowerBase_ID.cxx:543
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:130
JGTowerBase_ID::region_context
IdContext region_context() const
access to IdContext's which define which levels of fields are contained in the id
Definition: JGTowerBase_ID.cxx:49
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
JGTowerBase_ID::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: JGTowerBase_ID.h:311
IdDictDictionary::name
const std::string & name() const
Dictionary name.
Definition: IdDictDictionary.h:332
JGTowerBase_ID::m_region_impl
IdDictFieldImplementation m_region_impl
Definition: JGTowerBase_ID.h:352
JGTowerBase_ID::m_CALO_INDEX
size_type m_CALO_INDEX
Definition: JGTowerBase_ID.h:306
JGTowerBase_ID::m_region_vec
std::vector< Identifier > m_region_vec
Definition: JGTowerBase_ID.h:320
JGTowerBase_ID::m_pnz_reg_impl
IdDictFieldImplementation m_pnz_reg_impl
Definition: JGTowerBase_ID.h:356
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
JGTowerBase_ID::m_prev_phi_vec
std::vector< unsigned short > m_prev_phi_vec
Definition: JGTowerBase_ID.h:321
JGTowerBase_ID::get_next_in_eta
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
access to hashes for neighbours in eta – towers only (no extended) return == 0 for neighbours found
Definition: JGTowerBase_ID.cxx:555
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:47
JGTowerBase_ID::m_full_reg_range
MultiRange m_full_reg_range
Definition: JGTowerBase_ID.h:315
IdDictRegion
Definition: IdDictRegion.h:20
JGTowerBase_ID::m_calo_region_hash_max
size_type m_calo_region_hash_max
Definition: JGTowerBase_ID.h:318
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
JGTowerBase_ID::m_hash_calcs
std::vector< HashCalc > m_hash_calcs
Definition: JGTowerBase_ID.h:345
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
JGTowerBase_ID::m_SAMPLING_INDEX
size_type m_SAMPLING_INDEX
Definition: JGTowerBase_ID.h:308
JGTowerBase_ID::m_jgtower_region_index
size_type m_jgtower_region_index
Definition: JGTowerBase_ID.h:305
JGTowerBase_ID::initialize_base_from_dictionary
virtual int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &t_pre)
initialization from the identifier dictionary
Definition: JGTowerBase_ID.cxx:168
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictMgr
Definition: IdDictMgr.h:15
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
StrFormat.h
Provide helper functions to create formatted strings.
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:124
JGTowerBase_ID::HashCalc
small class holding the starting hash value, the min eta and the number of phi bins of each region
Definition: JGTowerBase_ID.h:335
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
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
JGTowerBase_ID::JGTowerBase_ID
JGTowerBase_ID(const std::string &name, const std::string &group)
Definition: JGTowerBase_ID.cxx:26
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
JGTowerBase_ID::HashCalc::m_nphi
size_type m_nphi
Definition: JGTowerBase_ID.h:343
IdDictFieldImplementation::bits_offset
size_type bits_offset() const
Definition: IdDictFieldImplementation.h:208
JGTowerBase_ID::m_tower_vec
std::vector< Identifier > m_tower_vec
Definition: JGTowerBase_ID.h:319
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
mc.group_name
group_name
Definition: mc.PhPy8EG_A14NNPDF23_NNLOPS_example.py:33
IdentifierField::get_next
bool get_next(element_type current, element_type &next) const
Definition: IdentifierField.cxx:149
ConstRangeIterator::begin
ConstRangeIterator begin() const
Definition: RangeIterator.cxx:18
JGTowerBase_ID::m_REGION_INDEX
size_type m_REGION_INDEX
Definition: JGTowerBase_ID.h:309
JGTowerBase_ID::~JGTowerBase_ID
virtual ~JGTowerBase_ID()
JGTowerBase_ID::init_hashes
int init_hashes()
Definition: JGTowerBase_ID.cxx:855
JGTowerBase_ID::m_next_phi_vec
std::vector< unsigned short > m_next_phi_vec
Definition: JGTowerBase_ID.h:322
JGTowerBase_ID::eta0
float eta0(const Identifier regId) const
Return the minimum eta of region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:504
JGTowerBase_ID::m_dict
const IdDictDictionary * m_dict
Definition: JGTowerBase_ID.h:313
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:201
JGTowerBase_ID::region_id_checks
void region_id_checks(int pos_neg, int sampling, int region) const
Definition: JGTowerBase_ID.cxx:620
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:75
JGTowerBase_ID::init_neighbors
int init_neighbors()
Definition: JGTowerBase_ID.cxx:994
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
JGTowerBase_ID::region_id
Identifier region_id(int pos_neg, int sampling, int region) const
build a region (of towers) identifier
Definition: JGTowerBase_ID.h:573
IdentifierHash.h
JGTowerBase_ID::m_jgtower_impl
IdDictFieldImplementation m_jgtower_impl
Definition: JGTowerBase_ID.h:350
JGTowerBase_ID::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: JGTowerBase_ID.h:310
RangeIterator.h
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
JGTowerBase_ID::m_tower_hash_max
size_type m_tower_hash_max
Definition: JGTowerBase_ID.h:317
JGTowerBase_ID::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const
create compact id from hash id (return == 0 for OK)
Definition: JGTowerBase_ID.cxx:63
JGTowerBase_ID::m_DETZSIDE_INDEX
size_type m_DETZSIDE_INDEX
Definition: JGTowerBase_ID.h:307
JGTowerBase_ID::tower_id
Identifier tower_id(int pos_neg, int sampling, int region, int eta, int phi) const
build a tower identifier
Definition: JGTowerBase_ID.h:384
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
JGTowerBase_ID::get_next_in_phi
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
access to hashes for neighbours in phi – towers only (no extended) return == 0 for neighbours found
Definition: JGTowerBase_ID.cxx:531
DeMoScan.index
string index
Definition: DeMoScan.py:362
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:221
IdDictField.h
JGTowerBase_ID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: JGTowerBase_ID.h:287
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
JGTowerBase_ID::pos_neg
int pos_neg(const Identifier id) const
return pos_neg according to :
Definition: JGTowerBase_ID.h:467
JGTowerBase_ID::tower_hash_binary_search
IdentifierHash tower_hash_binary_search(Identifier towerId) const
create hash id from tower id – method NOT optimised, please use tower_hash() above
Definition: JGTowerBase_ID.h:593
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:365
JGTowerBase_ID::eta_max
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
Definition: JGTowerBase_ID.cxx:448
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
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
JGTowerBase_ID::HashCalc::m_hash
IdentifierHash m_hash
Definition: JGTowerBase_ID.h:341
JGTowerBase_ID::initLevelsFromDict
int initLevelsFromDict(const std::string &t_pre)
Definition: JGTowerBase_ID.cxx:633
JGTowerBase_ID::eta_min
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
Definition: JGTowerBase_ID.cxx:422
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
JGTowerBase_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: JGTowerBase_ID.cxx:567
ExpandedIdentifier::clear
void clear()
Erase all fields.
IdentifierField::get_previous
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
Definition: IdentifierField.cxx:106
JGTowerBase_ID::phiGranularity
float phiGranularity(const Identifier regId) const
Return the phi granularity of a region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:497
IdDictRegion::index
size_t index() const
Definition: IdDictRegion.h:168
IdDictRegion.h
JGTowerBase_ID::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: JGTowerBase_ID.h:354
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
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
JGTowerBase_ID::m_full_tower_range
MultiRange m_full_tower_range
Definition: JGTowerBase_ID.h:316
JGTowerBase_ID::m_calo_impl
IdDictFieldImplementation m_calo_impl
Definition: JGTowerBase_ID.h:349
JGTowerBase_ID.h
Factor out code common between JTower_ID and GTower_ID.
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
JGTowerBase_ID::etaGranularity
float etaGranularity(const Identifier regId) const
Return the eta granularity of a region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:490
JGTowerBase_ID::NOT_VALID
@ NOT_VALID
Definition: JGTowerBase_ID.h:33
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
JGTowerBase_ID::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: JGTowerBase_ID.h:353
IdDictFieldImplementation::bits
size_type bits() const
Definition: IdDictFieldImplementation.h:202
Identifier
Definition: IdentifierFieldParser.cxx:14