Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Tile_Base_ID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id$
15 #include "IdDict/IdDictDefs.h"
18 #include "CxxUtils/StrFormat.h"
19 
20 #include "GaudiKernel/MsgStream.h"
21 
22 #include <algorithm>
23 #include <cassert>
24 #include <cstdio>
25 #include <iostream>
26 #include <stdexcept>
27 
29 using namespace LArNeighbours;
30 
31 
32 
33 Tile_Base_ID::Tile_Base_ID (const std::string& name, bool supercell)
34  : CaloIDHelper (name)
35  , m_supercell (supercell ? 1 : 0)
36  , m_tile_region_index(0)
37  , m_SYSTEM_INDEX(999)
38  , m_SECTION_INDEX(999)
39  , m_SIDE_INDEX(999)
40  , m_MODULE_INDEX(999)
41  , m_TOWER_INDEX(999)
42  , m_SAMPLE_INDEX(999)
43  , m_PMT_INDEX(999)
44  , m_ADC_INDEX(999)
45 {
46 }
47 
48 //
49 // Tile_Base_ID methods
50 //
51 std::string
52 Tile_Base_ID::to_string( const Identifier & id, int level ) const
53 {
54  IdContext context;
55  switch (level) {
56  case 1: case -6:
57  case 2: case -5: context = region_context(); break;
58  case 3: case -4: context = module_context(); break;
59  case 4: case -3: context = tower_context(); break;
60  case 5: case -2: context = cell_context(); break;
61  case 6: case -1: context = pmt_context(); break;
62  case 7: case 0: context = adc_context(); break;
63  default:
64  return "Tile_Base_ID::to_string - unknown context";
65  }
66 
67  ExpandedIdentifier exp_id;
68  if ( get_expanded_id(id,exp_id,&context) ) {
69  return "Tile_Base_ID::to_string - can not expand ID";
70  } else {
71  return (std::string)(exp_id);
72  }
73 }
74 
75 std::string
76 Tile_Base_ID::to_string( const IdentifierHash & hash_id, int level ) const
77 {
78  IdContext context;
79  switch (level) {
80  case 1: case -6:
81  case 2: case -5: context = region_context(); break;
82  case 3: case -4: context = module_context(); break;
83  case 4: case -3: context = tower_context(); break;
84  case 5: case -2: context = cell_context(); break;
85  case 6: case -1: context = pmt_context(); break;
86  case 7: case 0: context = adc_context(); break;
87  default:
88  return "Tile_Base_ID::to_string - unknown context";
89  }
90 
91  Identifier id;
92  if ( get_id ( hash_id, id, &context ) == 0 ) {
93  ExpandedIdentifier exp_id;
94  if ( get_expanded_id(id,exp_id,&context) ) {
95  return "Tile_Base_ID::to_string - can not expand ID";
96  } else {
97  return (std::string)(exp_id);
98  }
99  } else {
100  return "Tile_Base_ID::to_string - can not get ID from hash_id";
101  }
102 }
103 
104 //
105 // get methods
106 //
107 int
109 {
110  int field = 0;
111  if(!dict()->unpack(id, 0, index, m_tile_region_index, field)) {
112  return field;
113  } else {
114  return 0;
115  }
116 }
117 
118 int
120 {
121  IdentifierHash hash_id;
122  IdContext context = region_context();
123 
124  get_hash(region_id(section,side),hash_id,&context);
125 
126  return (int)hash_id;
127 }
128 
129 int
130 Tile_Base_ID::region ( const Identifier & id ) const
131 {
132  IdentifierHash hash_id;
133  IdContext context = region_context();
134 
135  get_hash(region_id(id),hash_id,&context);
136 
137  return (int)hash_id;
138 }
139 
140 int
141 Tile_Base_ID::system ( const Identifier & id ) const
142 {
143  return get_field(id,m_SYSTEM_INDEX);
144 }
145 
146 int
147 Tile_Base_ID::section ( const Identifier & id ) const
148 {
150 }
151 
152 int
153 Tile_Base_ID::side ( const Identifier & id ) const
154 {
155  return get_field(id,m_SIDE_INDEX);
156 }
157 
158 int
159 Tile_Base_ID::module ( const Identifier & id ) const
160 {
161  return get_field(id,m_MODULE_INDEX);
162 }
163 
164 int
165 Tile_Base_ID::tower ( const Identifier & id ) const
166 {
167  return get_field(id,m_TOWER_INDEX);
168 }
169 
170 int
171 Tile_Base_ID::sample ( const Identifier & id ) const
172 {
173  if ( section(id) == Tile_Base_ID::AUXDET )
174  return Tile_Base_ID::SAMP_X;
175  else
176  return get_field(id,m_SAMPLE_INDEX);
177 }
178 
179 int
180 Tile_Base_ID::pmt ( const Identifier & id ) const
181 {
182  return get_field(id,m_PMT_INDEX);
183 }
184 
185 int
186 Tile_Base_ID::adc ( const Identifier & id ) const
187 {
188  return get_field(id,m_ADC_INDEX);
189 }
190 
191 //
192 // check methods
193 //
194 /*
195 bool
196 Tile_Base_ID::is_tile (const Identifier& id) const
197 {
198  bool result = ( system(id) == tile_field_value() );
199 
200  return result;
201 }
202 */
203 
204 bool
206 {
207  bool result = is_tile(id)
208  && ( section(id) == Tile_Base_ID::BARREL );
209 
210  return result;
211 }
212 
213 bool
215 {
216  bool result = is_tile(id)
217  && ( section(id) == Tile_Base_ID::EXTBAR );
218 
219  return result;
220 }
221 
222 bool
224 {
225  bool result = is_tile(id)
226  && ( section(id) == Tile_Base_ID::GAPDET );
227 
228  return result;
229 }
230 
231 bool
233 {
234  bool result = is_tile(id)
235  && ( section(id) == Tile_Base_ID::AUXDET );
236 
237  return result;
238 }
239 
240 bool
242 {
243  bool result = is_tile(id)
244  && ( side(id) == Tile_Base_ID::NEGATIVE );
245 
246  return result;
247 }
248 
249 bool
251 {
252  bool result = is_tile(id)
253  && ( side(id) == Tile_Base_ID::POSITIVE );
254 
255  return result;
256 }
257 
258 bool
260 {
261  bool result = is_tile(id)
262  && ( side(id) == 0 );
263 
264  return result;
265 }
266 
267 bool
269 {
270  bool result = is_tile(id)
271  && ( sample(id) == Tile_Base_ID::SAMP_E );
272 
273  return result;
274 }
275 
276 bool
278 {
279  bool result = is_tile(id)
280  && ( adc(id) == Tile_Base_ID::LOWGAIN );
281 
282  return result;
283 }
284 
285 bool
287 {
288  bool result = is_tile(id)
289  && ( adc(id) == Tile_Base_ID::HIGHGAIN );
290 
291  return result;
292 }
293 
295 {
296  return is_tile(id) && (get_field(id,m_SECTION_INDEX) & SUPERCELL_MASK);
297 }
298 
299 // Whole TileCal
302 {
304 
305  int id[8];
307 
308  Identifier compactId(0);
309  if (!dict()->pack32(id, 0, m_SYSTEM_INDEX, m_tile_region_index, compactId)) {
310  result = compactId;
311  }
312 
313  return result;
314 }
315 
316 // For Tile Barrel ID
319 {
321 
322  int id[8];
325 
326  Identifier compactId(0);
327  if (!dict()->pack32(id, 0, m_SECTION_INDEX, m_tile_region_index, compactId)) {
328  result = compactId;
329  }
330 
331  return result;
332 }
333 
334 // For Tile Extended Barrel ID
337 {
339 
340  int id[8];
343 
344  Identifier compactId(0);
345  if (!dict()->pack32(id, 0, m_SECTION_INDEX, m_tile_region_index, compactId)) {
346  result = compactId;
347  }
348 
349  return result;
350 }
351 
352 
353 // For Tile Gap Scintillator ID
356 {
358 
359  assert (!m_supercell);
360  int id[8];
363 
364  Identifier compactId(0);
365  if (!dict()->pack32(id, 0, m_SECTION_INDEX, m_tile_region_index, compactId)) {
366  result = compactId;
367  }
368 
369  return result;
370 }
371 
372 // For any Tilecal section
374 Tile_Base_ID::tile_det ( int section, bool checks ) const
375 {
376  if(checks) {
377  // Check that id is within allowed range
378  // Fill expanded id
379  ExpandedIdentifier expId(tile_exp());
380  expId << encode_section (section) ;
381  }
382 
384 
385  int id[8];
388 
389  Identifier compactId(0);
390  if (!dict()->pack32(id, 0, m_SECTION_INDEX, m_tile_region_index, compactId)) {
391  result = compactId;
392  }
393 
394  return result;
395 }
396 
399 {
400  return tile_det (section, do_checks());
401 }
402 
403 // single region, module, tower, cell, pmt, adc identifiers
406 {
408  IdentifierHash hash_id = index;
409  IdContext context = region_context();
410 
411  get_id(hash_id,result,&context);
412 
413  return result;
414 }
415 
417 Tile_Base_ID::region_id ( int section, int side, bool checks ) const
418 {
419  if(checks) {
420 
421  // Check that id is within allowed range
422 
423  // Fill expanded id
424  ExpandedIdentifier expId(tile_exp());
425  expId << encode_section (section) << side;
426 
427  if (!m_full_region_range.match(expId)) {
428  std::string errorMessage = "Tile_Base_ID::region_id() result is not OK: ID, range = "
429  + std::string(expId) + " , " + (std::string)m_full_region_range;
430  throw TileID_Exception(errorMessage , 1);
431  }
432  }
433 
435 
436  int id[8];
439  id[m_SIDE_INDEX] = side;
440 
441  Identifier compactId(0);
442  if (!dict()->pack32(id, 0, m_SIDE_INDEX, m_tile_region_index, compactId)) {
443  result = compactId;
444  }
445 
446  return result;
447 }
448 
451 {
452  return region_id (section, side, do_checks());
453 }
454 
455 
457 Tile_Base_ID::region_id ( const Identifier& any_id ) const
458 {
460  // extract with the dictionary
461  Identifier id;
462  if(!dict()->copy(any_id, 0, 0, m_SIDE_INDEX, m_tile_region_index, id)) {
463  result = id;
464  }
465  return (result);
466 }
467 
470  int module,
471  bool checks ) const
472 {
473  if(checks) {
474 
475  // Check that id is within allowed range
476 
477  // Fill expanded id
478  ExpandedIdentifier expId(tile_exp());
479  expId << encode_section (section) << side << module;
480 
481  if (!m_full_module_range.match(expId)) {
482  std::string errorMessage = "Tile_Base_ID::module_id() result is not OK: ID, range = "
483  + std::string(expId) + " , " + (std::string)m_full_region_range;
484  throw TileID_Exception(errorMessage , 1);
485  }
486  }
487 
489 
490  int id[8];
493  id[m_SIDE_INDEX] = side;
494  id[m_MODULE_INDEX] = module;
495 
496  Identifier compactId(0);
497  if (!dict()->pack32(id, 0, m_MODULE_INDEX, m_tile_region_index, compactId)) {
498  result = compactId;
499  }
500 
501  return result;
502 }
503 
506  int module ) const
507 {
508  return module_id (section, side, module, do_checks());
509 }
510 
511 
513 Tile_Base_ID::module_id ( const Identifier& any_id ) const
514 {
516  // extract with the dictionary
517  Identifier id;
518  if(!dict()->copy(any_id, 0, 0, m_MODULE_INDEX, m_tile_region_index, id)) {
519  result = id;
520  }
521  return (result);
522 }
523 
526  int module, int tower,
527  bool checks) const
528 {
529  if(checks) {
530 
531  // Check that id is within allowed range
532 
533  // Fill expanded id
534  ExpandedIdentifier expId(tile_exp());
535  expId << encode_section (section) << side << module << tower;
536 
537  if (!m_full_tower_range.match(expId)) {
538  std::string errorMessage = "Tile_Base_ID::tower_id() result is not OK: ID, range = "
539  + std::string(expId) + " , " + (std::string)m_full_region_range;
540  throw TileID_Exception(errorMessage , 1);
541  }
542  }
543 
545 
546  int id[8];
549  id[m_SIDE_INDEX] = side;
550  id[m_MODULE_INDEX] = module;
551  id[m_TOWER_INDEX] = tower;
552 
553  Identifier compactId(0);
554  if (!dict()->pack32(id, 0, m_TOWER_INDEX, m_tile_region_index, compactId)) {
555  result = compactId;
556  }
557 
558  return result;
559 }
560 
563  int module, int tower) const
564 {
565  return tower_id (section, side, module, tower, do_checks());
566 }
567 
569 Tile_Base_ID::tower_id ( const Identifier& any_id ) const
570 {
572  // extract with the dictionary
573  Identifier id;
574  if(!dict()->copy(any_id, 0, 0, m_TOWER_INDEX, m_tile_region_index, id)) {
575  result = id;
576  }
577  return (result);
578 }
579 
581 Tile_Base_ID::cell_id ( const Identifier & any_id ) const
582 {
584  // extract with the dictionary
585  Identifier id;
586  if(!dict()->copy(any_id, 0, 0, m_SAMPLE_INDEX, m_tile_region_index, id)) {
587  result = id;
588  }
589  return (result);
590 }
591 
594  int module, int tower,
595  int sample,
596  bool checks ) const
597 {
598  if(checks) {
599 
600  // Check that id is within allowed range
601 
602  // Fill expanded id
603  ExpandedIdentifier expId(tile_exp());
604  expId << encode_section (section) << side << module << tower << sample;
605 
606  if (!m_full_cell_range.match(expId)) {
607  std::string errorMessage = "Tile_Base_ID::cell_id() result is not OK: ID, range = "
608  + std::string(expId) + " , " + (std::string)m_full_cell_range;
609  throw TileID_Exception(errorMessage , 1);
610  }
611  }
612 
614 
615  int id[8];
618  id[m_SIDE_INDEX] = side;
619  id[m_MODULE_INDEX] = module;
620  id[m_TOWER_INDEX] = tower;
621  id[m_SAMPLE_INDEX] = sample;
622 
623  Identifier compactId(0);
624  if (!dict()->pack32(id, 0, m_SAMPLE_INDEX, m_tile_region_index, compactId)) {
625  result = compactId;
626  }
627 
628  return result;
629 }
630 
633  int module, int tower,
634  int sample ) const
635 {
636  return cell_id (section, side, module, tower, sample, do_checks());
637 }
638 
640 Tile_Base_ID::pmt_id ( const Identifier & any_id ) const
641 {
643  // extract with the dictionary
644  Identifier id;
645  if(!dict()->copy(any_id, 0, 0, m_PMT_INDEX, m_tile_region_index, id)) {
646  result = id;
647  }
648  return (result);
649 }
650 
652 Tile_Base_ID::pmt_id ( const Identifier & cell_id,
653  int pmt, bool checks ) const
654 {
656 
657  int id[8];
658  id[0] = pmt;
659 
660  Identifier compactId(cell_id);
661  if (!dict()->pack32(id, m_PMT_INDEX, m_PMT_INDEX, m_tile_region_index, compactId)) {
662  result = compactId;
663  }
664  else {
665  std::string errorMessage = "Tile_Base_ID::pmt_id(cell_id,pmt) could not pack ID: "
666  + cell_id.getString() ;
667  throw TileID_Exception(errorMessage , 1);
668  }
669 
670  if(checks) {
671 
672  // Check that id is within allowed range
673 
674  // Fill expanded id
675  ExpandedIdentifier expId;
676 
677  IdContext context = cell_context();
678  if (get_expanded_id(result, expId, &context)) {
679  std::string errorMessage = "Tile_Base_ID::pmt_id(cell_id,pmt) result is not OK: ID = "
680  + result.getString() ;
681  throw TileID_Exception(errorMessage , 1);
682 
683  // region_id.show();
684  }
685 
686  expId << pmt;
687 
688  if (!m_full_pmt_range.match(expId)) {
689  std::string errorMessage = "Tile_Base_ID::pmt_id() result is not OK: ID, range = "
690  + std::string(expId) + " , " + (std::string)m_full_region_range;
691  throw TileID_Exception(errorMessage , 1);
692  }
693  }
694 
695  return result;
696 }
697 
699 Tile_Base_ID::pmt_id ( const Identifier & cell_id,
700  int pmt ) const
701 {
702  return pmt_id (cell_id, pmt, do_checks());
703 }
704 
707  int module, int tower,
708  int sample, int pmt,
709  bool checks) const
710 {
711  if(checks) {
712 
713  // Check that id is within allowed range
714 
715  // Fill expanded id
716  ExpandedIdentifier expId(tile_exp());
717  expId << encode_section (section) << side << module << tower << sample << pmt;
718 
719  if (!m_full_pmt_range.match(expId)) {
720  std::string errorMessage = "Tile_Base_ID::pmt_id() result is not OK: ID, range = "
721  + std::string(expId) + " , " + (std::string)m_full_region_range;
722  throw TileID_Exception(errorMessage , 1);
723  }
724  }
725 
727 
728  int id[8];
731  id[m_SIDE_INDEX] = side;
732  id[m_MODULE_INDEX] = module;
733  id[m_TOWER_INDEX] = tower;
734  id[m_SAMPLE_INDEX] = sample;
735  id[m_PMT_INDEX] = pmt;
736 
737  Identifier compactId(0);
738  if (!dict()->pack32(id, 0, m_PMT_INDEX, m_tile_region_index, compactId)) {
739  result = compactId;
740  }
741 
742  return result;
743 }
744 
747  int module, int tower,
748  int sample, int pmt) const
749 {
750  return pmt_id (section, side, module, tower, sample, pmt, do_checks());
751 }
752 
755  int pmt, int adc, bool checks ) const
756 {
758 
759  int id[8];
760  id[0] = pmt;
761  id[1] = adc;
762 
763  Identifier compactId(cell_id);
764  if (!dict()->pack32(id, m_PMT_INDEX, m_ADC_INDEX, m_tile_region_index, compactId)) {
765  result = compactId;
766  }
767  else {
768  std::string errorMessage = "Tile_Base_ID::adc_id(cell_id,pmt,adc) could not pack ID: "
769  + cell_id.getString() ;
770  throw TileID_Exception(errorMessage , 1);
771  }
772 
773  if(checks) {
774 
775  // Check that id is within allowed range
776 
777  // Fill expanded id
778  ExpandedIdentifier expId;
779 
780  IdContext context = cell_context();
781  if (get_expanded_id(result, expId, &context)) {
782  std::string errorMessage = "Tile_Base_ID::adc_id(cell_id,pmt,adc) result is not OK: ID = "
783  + result.getString() ;
784  throw TileID_Exception(errorMessage , 1);
785 
786  // region_id.show();
787  }
788 
789  expId << pmt << adc;
790 
791  if (!m_full_adc_range.match(expId)) {
792  std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
793  + std::string(expId) + " , " + (std::string)m_full_region_range;
794  throw TileID_Exception(errorMessage , 1);
795  }
796  }
797 
798  return result;
799 }
800 
803  int pmt, int adc ) const
804 {
805  return adc_id (cell_id, pmt, adc, do_checks());
806 }
807 
810  int adc, bool checks ) const
811 {
813 
814  int id[8];
815  id[0] = adc;
816 
817  Identifier compactId(pmt_id);
818  if (!dict()->pack32(id, m_ADC_INDEX, m_ADC_INDEX, m_tile_region_index, compactId)) {
819  result = compactId;
820  }
821  else {
822  std::string errorMessage = "Tile_Base_ID::adc_id(pmt_id,adc) could not pack ID: "
823  + pmt_id.getString() ;
824  throw TileID_Exception(errorMessage , 1);
825  }
826 
827  if(checks) {
828 
829  // Check that id is within allowed range
830 
831  // Fill expanded id
832  ExpandedIdentifier expId;
833 
834  IdContext context = pmt_context();
835  if (get_expanded_id(result, expId, &context)) {
836  std::string errorMessage = "Tile_Base_ID::adc_id(pmt_id,adc) result is not OK: ID = "
837  + result.getString() ;
838  throw TileID_Exception(errorMessage , 1);
839 
840  // region_id.show();
841  }
842 
843  expId << adc;
844 
845  if (!m_full_adc_range.match(expId)) {
846  std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
847  + std::string(expId) + " , " + (std::string)m_full_region_range;
848  throw TileID_Exception(errorMessage , 1);
849  }
850  }
851 
852  return result;
853 }
854 
857  int adc ) const
858 {
859  return adc_id (pmt_id, adc, do_checks());
860 }
861 
864  int module, int tower, int sample,
865  int pmt, int adc,
866  bool checks) const
867 {
868  if(checks) {
869 
870  // Check that id is within allowed range
871 
872  // Fill expanded id
873  ExpandedIdentifier expId(tile_exp());
874  expId << encode_section (section) << side << module << tower << sample << pmt << adc;
875 
876  if (!m_full_adc_range.match(expId)) {
877  std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
878  + std::string(expId) + " , " + (std::string)m_full_region_range;
879  throw TileID_Exception(errorMessage , 1);
880  }
881  }
882 
884 
885  int id[8];
888  id[m_SIDE_INDEX] = side;
889  id[m_MODULE_INDEX] = module;
890  id[m_TOWER_INDEX] = tower;
891  id[m_SAMPLE_INDEX] = sample;
892  id[m_PMT_INDEX] = pmt;
893  id[m_ADC_INDEX] = adc;
894 
895  Identifier compactId(0);
896  if (!dict()->pack32(id, 0, m_ADC_INDEX, m_tile_region_index, compactId)) {
897  result = compactId;
898  }
899 
900  return result;
901 }
902 
905  int module, int tower, int sample,
906  int pmt, int adc) const
907 {
908  return adc_id (section, side, module, tower, sample, pmt, adc, do_checks());
909 }
910 
912  int module, Identifier& module_id ) const
913 {
915  IdContext context = region_context();
916  get_expanded_id(region_id, id, &context);
917  id << module;
918  if (!m_full_module_range.match(id)) {
919  return false;
920  }
921 
922  Identifier compactId(0);
923  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
924  module_id = compactId;
925  }
926  return true;
927 }
928 
930  int module, int tower, Identifier& tower_id ) const
931 {
933  IdContext context = region_context();
934  get_expanded_id(region_id, id, &context);
935  id << module << tower;
936  if (!m_full_tower_range.match(id)) {
937  return false;
938  }
939 
940  Identifier compactId(0);
941  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
942  tower_id = compactId;
943  }
944  return true;
945 }
946 
948  int module, int tower, int sample,
949  Identifier& cell_id ) const
950 {
952  IdContext context = region_context();
953  get_expanded_id(region_id, id, &context);
954  id << module << tower << sample;
955  if (!m_full_cell_range.match(id)) {
956  return false;
957  }
958 
959  Identifier compactId(0);
960  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
961  cell_id = compactId;
962  }
963  return true;
964 }
965 
966 bool Tile_Base_ID::pmt_id ( const Identifier& cell_id,
967  int pmt, Identifier& pmt_id ) const
968 {
970  IdContext context = cell_context();
971  get_expanded_id(cell_id, id, &context);
972  id << pmt;
973  if (!m_full_pmt_range.match(id)) {
974  return false;
975  }
976 
977  Identifier compactId(0);
978  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
979  pmt_id = compactId;
980  }
981  return true;
982 }
983 
984 bool Tile_Base_ID::adc_id ( const Identifier& pmt_id,
985  int adc, Identifier& adc_id ) const
986 {
988  IdContext context = pmt_context();
989  get_expanded_id(pmt_id, id, &context);
990  id << adc;
991  if (!m_full_adc_range.match(id)) {
992  return false;
993  }
994 
995  Identifier compactId(0);
996  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
997  adc_id = compactId;
998  }
999  return true;
1000 }
1001 
1002 bool Tile_Base_ID::adc_id ( const Identifier& cell_id,
1003  int pmt, int adc, Identifier& adc_id ) const
1004 {
1006  IdContext context = cell_context();
1007  get_expanded_id(cell_id, id, &context);
1008  id << pmt << adc;
1009  if (!m_full_adc_range.match(id)) {
1010  return false;
1011  }
1012 
1013  Identifier compactId(0);
1014  if (!dict()->pack32(id,0, id.fields() - 1,compactId)) {
1015  adc_id = compactId;
1016  }
1017  return true;
1018 }
1019 
1020 Identifier Tile_Base_ID::cell_id (const IdentifierHash& hash_id) const
1021 {
1022  if (hash_id < channels().hash_max()) {
1023  return channel_id (hash_id);
1024  } else {
1025  std::string errorMessage = "Tile_Base_ID::cell_id(hash_id) - hash_id out of range ";
1026  throw TileID_Exception(errorMessage , 1);
1027  }
1028 }
1029 
1030 IdentifierHash Tile_Base_ID::cell_hash (const Identifier& id) const
1031 {
1032  IdentifierHash ret = 0;
1033  if (channels().get_hash (id, ret) == 0)
1034  return ret;
1035 
1036  std::string errorMessage = "Tile_Base_ID::cell_hash(cell_id) - cell_id out of range ";
1037  throw TileID_Exception(errorMessage , 1);
1038 }
1039 
1040 IdContext
1042 {
1043  return {0, m_SIDE_INDEX};
1044 }
1045 
1046 IdContext
1048 {
1049  return {0, m_MODULE_INDEX};
1050 }
1051 
1052 IdContext
1054 {
1055  return {0, m_TOWER_INDEX};
1056 }
1057 
1058 IdContext
1060 {
1061  return {0, m_SAMPLE_INDEX};
1062 }
1063 
1064 IdContext
1066 {
1067  return {0, m_PMT_INDEX};
1068 }
1069 
1070 IdContext
1072 {
1073  return {0, m_ADC_INDEX};
1074 }
1075 
1076 int
1077 Tile_Base_ID::get_id (const IdentifierHash& hash_id,
1078  Identifier& id,
1079  const IdContext* context ) const
1080 {
1081  int result = 1;
1082  id.clear();
1083 
1084  size_t begin = (context) ? context->begin_index(): 0;
1085  // cannot get hash if end is 0:
1086  size_t end = (context) ? context->end_index() : 0;
1087 
1088  if (0 == begin) {
1089 
1090  if ( m_ADC_INDEX == end ) {
1091  if (hash_id < m_adcs.hash_max()) {
1092  id = m_adcs.id (hash_id);
1093  result = 0;
1094  } else {
1095  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1096  log << MSG::ERROR << "get_id: adc hash_id is out of range " << hash_id
1097  << " > " << m_adcs.hash_max() << endmsg;
1098  }
1099  } else if ( m_PMT_INDEX == end ) {
1100  if (hash_id < m_pmts.hash_max()) {
1101  id = m_pmts.id (hash_id);
1102  result = 0;
1103  } else {
1104  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1105  log << MSG::ERROR << "get_id: pmt hash_id is out of range " << hash_id
1106  << " >= " << m_pmts.hash_max() << endmsg;
1107  }
1108  } else if ( m_SAMPLE_INDEX == end ) {
1109  if (hash_id < channels().hash_max()) {
1110  id = channels().id (hash_id);
1111  result = 0;
1112  } else {
1113  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1114  log << MSG::ERROR << "get_id: cell hash_id is out of range " << hash_id
1115  << " >= " << channels().hash_max() << endmsg;
1116  }
1117  } else if ( m_TOWER_INDEX == end ) {
1118  if (hash_id < m_towers.hash_max()) {
1119  id = m_towers.id (hash_id);
1120  result = 0;
1121  } else {
1122  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1123  log << MSG::ERROR << "get_id: tower hash_id is out of range " << hash_id
1124  << " >= " << m_towers.hash_max() << endmsg;
1125  }
1126  } else if ( m_MODULE_INDEX == end ) {
1127  if (hash_id < m_modules.hash_max()) {
1128  id = m_modules.id (hash_id);
1129  result = 0;
1130  } else {
1131  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1132  log << MSG::ERROR << "get_id: module hash_id is out of range " << hash_id
1133  << " >= " << m_modules.hash_max() << endmsg;
1134  }
1135  } else if ( m_SIDE_INDEX == end ) {
1136  if (hash_id < regions().hash_max()) {
1137  id = regions().id (hash_id);
1138  result = 0;
1139  } else {
1140  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1141  log << MSG::ERROR << "get_id: region hash_id is out of range " << hash_id
1142  << " >= " << regions().hash_max() << endmsg;
1143  }
1144  }
1145  }
1146  return(result);
1147 }
1148 
1149 
1150 int
1152  IdentifierHash& hash_id,
1153  const IdContext* context ) const
1154 {
1155  hash_id = 0;
1156  int result = 1;
1157 
1158  size_t begin = (context) ? context->begin_index(): 0;
1159  size_t end = (context) ? context->end_index() : 0;
1160 
1161  if (0 == begin) {
1162  if ( m_ADC_INDEX == end ) {
1163  result = m_adcs.get_hash (id, hash_id);
1164  } else if ( m_PMT_INDEX == end ) {
1165  result = m_pmts.get_hash (pmt_id(id), hash_id);
1166  } else if ( m_SAMPLE_INDEX == end ) {
1167  result = channels().get_hash (cell_id(id), hash_id);
1168  } else if ( m_TOWER_INDEX == end ) {
1169  result = m_towers.get_hash (tower_id(id), hash_id);
1170  } else if ( m_MODULE_INDEX == end ) {
1171  result = m_modules.get_hash (module_id(id), hash_id);
1172  } else if ( m_SIDE_INDEX == end ) {
1173  result = regions().get_hash (region_id(id), hash_id);
1174  }
1175  }
1176 
1177  return (result);
1178 }
1179 
1180 int
1182  const std::string& group_name)
1183 {
1184  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1185  log << MSG::DEBUG << "initialize_base_from_dictionary " << endmsg;
1186 
1187  // Check whether this helper should be reinitialized
1188  if (!reinitialize(dict_mgr)) {
1189  if(m_msgSvc)log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
1190  return (0);
1191  }
1192  else {
1193  if(m_msgSvc)log << MSG::DEBUG << "(Re)initialize" << endmsg;
1194  }
1195 
1196  log << MSG::DEBUG << "calling base initialize_base_from_dictionary" << endmsg;
1197 
1198  // init base object
1200  "TileCalorimeter"))
1201  return (1);
1202 
1203  // Initialize the field indices
1204  if(initLevelsFromDict (group_name)) return (1);
1205 
1206 
1207  // Find value for the field Tile Calorimeter
1208  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary ("ATLAS");
1209  int tileField = -1;
1210  if (atlasDict->get_label_value("subdet", "TileCalorimeter", tileField)) {
1211  log << MSG::ERROR << "Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
1212  << atlasDict->m_name
1213  << endmsg;
1214  return (1);
1215  }
1216 
1217  // Set up id for region and range prefix
1218  ExpandedIdentifier tile_id;
1219  tile_id.add(tileField);
1220  ExpandedIdentifier reg_id = tile_id;
1221  Range prefix;
1222 
1223  m_full_adc_range = dict()->build_multirange(reg_id, group_name, prefix, "adc");
1224  m_full_pmt_range = dict()->build_multirange(reg_id, group_name, prefix, "pmt");
1225  m_full_cell_range = dict()->build_multirange(reg_id, group_name, prefix, "sampling");
1226  m_full_tower_range = dict()->build_multirange(reg_id, group_name, prefix, "tower");
1227  m_full_module_range = dict()->build_multirange(reg_id, group_name, prefix, "module");
1229 
1230  // Find value for the field Tile Online
1231  int tilehwField = -1;
1232  if (dict()->get_label_value("section", "Online", tilehwField)) {
1233  log << MSG::ERROR << "Could not get value for label 'Online' of field 'section' in dictionary "
1234  << dict()->m_name
1235  << endmsg;
1236  } else {
1237  // remove online ID from all ranges
1238  reg_id = tile_id;
1239  reg_id.add(tilehwField);
1246  }
1247 
1248  // Find value for the field Tile Testbeam
1249  int tiletbField = -1;
1250  if (dict()->get_label_value("section", "Testbeam", tiletbField)) {
1251  log << MSG::ERROR << "Could not get value for label 'Testbeam' of field 'section' in dictionary "
1252  << dict()->m_name
1253  << endmsg;
1254  } else {
1255  // remove testbeam ID from all ranges
1256  reg_id = tile_id;
1257  reg_id.add(tiletbField);
1264  }
1265 
1266  if (!m_quiet) {
1267  log << MSG::DEBUG << "initialize_from_dict : " << endmsg;
1268  log << MSG::DEBUG << " region range -> " << (std::string)m_full_region_range << endmsg;
1269  log << MSG::DEBUG << " module range -> " << (std::string)m_full_module_range << endmsg;
1270  log << MSG::DEBUG << " tower range -> " << (std::string)m_full_tower_range << endmsg;
1271  log << MSG::DEBUG << " cell range -> " << (std::string)m_full_cell_range << endmsg;
1272  log << MSG::DEBUG << " pmt range -> " << (std::string)m_full_pmt_range << endmsg;
1273  log << MSG::DEBUG << " adc range -> " << (std::string)m_full_adc_range << endmsg;
1274  }
1275 
1276  // Setup the hash tables
1277  if(init_hashes()) return (1);
1278 
1279  // Setup hash tables for finding neighbors
1280  if(m_do_neighbours) {
1281  // temporary workaround to get the super_cell neighbor file directly
1282  // instead of from the db. In the long term the file name should
1283  // come from the db as well
1284  std::string neighbourFile;
1285  if ( m_supercell ) {
1286  neighbourFile = "TileSuperCellNeighbour.txt";
1287  }
1288  else {
1289  neighbourFile = dict_mgr.find_metadata("TILENEIGHBORS");
1290  }
1291  if (neighbourFile.empty()) throw std::runtime_error("TileID: Cannot find the Tile Neighbour file name");
1292  if(m_neighbour.initialize(this, neighbourFile)) return (1);
1293  }
1294 
1295  return 0;
1296 }
1297 
1299 {
1300  return regions().hash_max();
1301 }
1302 
1304 {
1305  return m_modules.hash_max();
1306 }
1307 
1309 {
1310  return m_towers.hash_max();
1311 }
1312 
1314 {
1315  return channels().hash_max();
1316 }
1317 
1319 {
1320  return m_pmts.hash_max();
1321 }
1322 
1324 {
1325  return m_adcs.hash_max();
1326 }
1327 
1329 {
1330  return regions().begin();
1331 }
1332 
1334 {
1335  return regions().end();
1336 }
1337 
1339 {
1340  return regions().range();
1341 }
1342 
1344 {
1345  return m_modules.begin();
1346 }
1347 
1349 {
1350  return m_modules.end();
1351 }
1352 
1354 {
1355  return m_modules.range();
1356 }
1357 
1359 {
1360  return m_towers.begin();
1361 }
1362 
1364 {
1365  return m_towers.end();
1366 }
1367 
1369 {
1370  return m_towers.range();
1371 }
1372 
1374 {
1375  return channels().begin();
1376 }
1377 
1379 {
1380  return channels().end();
1381 }
1382 
1384 {
1385  return channels().range();
1386 }
1387 
1389 {
1390  return m_pmts.begin();
1391 }
1392 
1394 {
1395  return m_pmts.end();
1396 }
1397 
1399 {
1400  return m_pmts.range();
1401 }
1402 
1404 {
1405  return m_adcs.begin();
1406 }
1407 
1409 {
1410  return m_adcs.end();
1411 }
1412 
1414 {
1415  return m_adcs.range();
1416 }
1417 
1418 const std::vector<Identifier>& Tile_Base_ID::region_ids() const
1419 {
1420  return regions().ids();
1421 }
1422 
1423 const std::vector<Identifier>& Tile_Base_ID::module_ids() const
1424 {
1425  return m_modules.ids();
1426 }
1427 
1428 const std::vector<Identifier>& Tile_Base_ID::tower_ids() const
1429 {
1430  return m_towers.ids();
1431 }
1432 
1433 const std::vector<Identifier>& Tile_Base_ID::cell_ids() const
1434 {
1435  return channels().ids();
1436 }
1437 
1438 const std::vector<Identifier>& Tile_Base_ID::pmt_ids() const
1439 {
1440  return m_pmts.ids();
1441 }
1442 
1443 const std::vector<Identifier>& Tile_Base_ID::adc_ids() const
1444 {
1445  return m_adcs.ids();
1446 }
1447 
1448 
1450 {
1451  return this->region_id (exp_id[m_SECTION_INDEX],
1452  exp_id[m_SIDE_INDEX]);
1453 }
1454 
1456 {
1457  return this->module_id (exp_id[m_SECTION_INDEX],
1458  exp_id[m_SIDE_INDEX],
1459  exp_id[m_MODULE_INDEX]);
1460 }
1461 
1463 {
1464  return this->tower_id (exp_id[m_SECTION_INDEX],
1465  exp_id[m_SIDE_INDEX],
1466  exp_id[m_MODULE_INDEX],
1467  exp_id[m_TOWER_INDEX]);
1468 }
1469 
1471 {
1472  return this->cell_id (exp_id[m_SECTION_INDEX],
1473  exp_id[m_SIDE_INDEX],
1474  exp_id[m_MODULE_INDEX],
1475  exp_id[m_TOWER_INDEX],
1476  exp_id[m_SAMPLE_INDEX]);
1477 }
1478 
1480 {
1481  return this->pmt_id (exp_id[m_SECTION_INDEX],
1482  exp_id[m_SIDE_INDEX],
1483  exp_id[m_MODULE_INDEX],
1484  exp_id[m_TOWER_INDEX],
1485  exp_id[m_SAMPLE_INDEX],
1486  exp_id[m_PMT_INDEX]);
1487 }
1488 
1490 {
1491  return this->adc_id (exp_id[m_SECTION_INDEX],
1492  exp_id[m_SIDE_INDEX],
1493  exp_id[m_MODULE_INDEX],
1494  exp_id[m_TOWER_INDEX],
1495  exp_id[m_SAMPLE_INDEX],
1496  exp_id[m_PMT_INDEX],
1497  exp_id[m_ADC_INDEX]);
1498 }
1499 
1500 int Tile_Base_ID::eta_min(const Identifier& id, const IdContext& context) const
1501 {
1502  ExpandedIdentifier expId;
1503  if(!get_expanded_id(id, expId, &context)) {
1504  int result = -999;
1505  for (unsigned int i = 0; i < m_full_tower_range.size(); ++i) {
1506  const Range& range = m_full_tower_range[i];
1507  if (range.match(expId)) {
1508  const Range::field& eta_field = range[m_TOWER_INDEX];
1509  if (not eta_field.empty()) {
1510  int etamin = eta_field.get_minimum();
1511  if (-999 == result) {
1512  result = etamin;
1513  }
1514  else {
1515  if (etamin < result) result = etamin;
1516  }
1517  }
1518  }
1519  }
1520  return (result);
1521  }
1522  return (-999);
1523 }
1524 
1525 int Tile_Base_ID::eta_max(const Identifier& id, const IdContext& context) const
1526 {
1527  ExpandedIdentifier expId;
1528  if(!get_expanded_id(id, expId, &context)) {
1529  int result = -999;
1530  for (unsigned int i = 0; i < m_full_cell_range.size(); ++i) {
1531  const Range& range = m_full_cell_range[i];
1532  if (range.match(expId)) {
1533  const Range::field& eta_field = range[m_TOWER_INDEX];
1534  if (not eta_field.empty()) {
1535  int etamax = eta_field.get_maximum();
1536  if (result < etamax) result = etamax;
1537  }
1538  }
1539  }
1540  return (result);
1541  }
1542  return (-999); // default
1543 }
1544 
1545 int Tile_Base_ID::eta_min(const Identifier& id) const
1546 {
1547  IdContext context = tower_context();
1548  return eta_min (id, context);
1549 }
1550 
1551 int Tile_Base_ID::eta_max(const Identifier& id) const
1552 {
1553  IdContext context = cell_context();
1554  return eta_max (id, context);
1555 }
1556 
1558 {
1559  IdContext context = region_context();
1560  return eta_min (id, context);
1561 }
1562 
1564 {
1565  IdContext context = region_context();
1566  return eta_max (id, context);
1567 }
1568 
1569 int Tile_Base_ID::phi_max(const Identifier& id) const
1570 {
1571  ExpandedIdentifier expId;
1572  IdContext context = cell_context();
1573  if(!get_expanded_id(id, expId, &context)) {
1574  int result = -999;
1575  for (unsigned int i = 0; i < m_full_cell_range.size(); ++i) {
1576  const Range& range = m_full_cell_range[i];
1577  if (range.match(expId)) {
1578  const Range::field& phi_field = range[m_MODULE_INDEX];
1579  if (not phi_field.empty()) {
1580  int phimax = phi_field.get_maximum();
1581  if (result < phimax) result = phimax;
1582  }
1583  }
1584  }
1585  return (result);
1586  }
1587  return (-999); // default
1588 }
1589 
1591  ExpandedIdentifier& exp_id,
1592  const IdContext* context) const
1593 {
1594  int result = 1;
1595 
1596  size_t begin = (context) ? context->begin_index() : 0;
1597  size_t end = (context) ? context->end_index() : m_ADC_INDEX;
1598  assert (end <= m_ADC_INDEX);
1599 
1600  if (0 == end) {
1601  result = 0;
1602  }
1603  else if ( 0 == begin) {
1604  ExpandedIdentifier empty;
1605  result = dict()->unpack(id, empty, end, exp_id);
1606  }
1607  else {
1608  result = dict()->unpack(id, context->prefix_id(), end, exp_id);
1609  }
1610  return result;
1611 }
1612 
1614 {
1615  MsgStream log(m_msgSvc, "Tile_Base_ID" );
1616 
1617  if(!dict()) {
1618  log << MSG::ERROR << "initLevelsFromDict - dictionary NOT initialized "
1619  << endmsg;
1620  return (1);
1621  }
1622 
1623  // Find out which identifier field corresponds to each level.
1624 
1625  m_SYSTEM_INDEX = 999;
1626  m_SECTION_INDEX = 999;
1627  m_SIDE_INDEX = 999;
1628  m_MODULE_INDEX = 999;
1629  m_TOWER_INDEX = 999;
1630  m_SAMPLE_INDEX = 999;
1631  m_PMT_INDEX = 999;
1632  m_ADC_INDEX = 999;
1633 
1635  if ( !group ){
1636  log << MSG::ERROR << "initLevelsFromDict - cannot find " << group_name
1637  << " group' field " << endmsg;
1638  }
1639  else {
1640  m_tile_region_index = group->regions()[0]->m_index;
1641  }
1642 
1643  // Fing a Tile region
1644  IdDictField* field = dict()->find_field("subdet") ;
1645  if (field) {
1646  m_SYSTEM_INDEX = field->m_index ;
1647  }
1648  else {
1649  log << MSG::ERROR << "initLevelsFromDict - unable to find 'subdet' field "
1650  << endmsg ;
1651  return (1);
1652  }
1653 
1654  field = dict()->find_field("section") ;
1655  if (field) {
1656  m_SECTION_INDEX = field->m_index ;
1657  }
1658  else {
1659  log << MSG::ERROR << "initLevelsFromDict - unable to find 'section' field "
1660  << endmsg ;
1661  return (1);
1662  }
1663 
1664  field = dict()->find_field("side") ;
1665  if (field) {
1666  m_SIDE_INDEX = field->m_index ;
1667  }
1668  else {
1669  log << MSG::ERROR << "initLevelsFromDict - unable to find 'side' field "
1670  << endmsg ;
1671  return (1);
1672  }
1673 
1674  field = dict()->find_field("module") ;
1675  if (field) {
1676  m_MODULE_INDEX = field->m_index ;
1677  }
1678  else {
1679  log << MSG::ERROR << "initLevelsFromDict - unable to find 'module' field "
1680  << endmsg ;
1681  return (1);
1682  }
1683 
1684  field = dict()->find_field("tower") ;
1685  if (field) {
1686  m_TOWER_INDEX = field->m_index ;
1687  }
1688  else {
1689  log << MSG::ERROR << "initLevelsFromDict - unable to find 'tower' field "
1690  << endmsg ;
1691  return (1);
1692  }
1693 
1694  field = dict()->find_field("sampling") ;
1695  if (field) {
1696  m_SAMPLE_INDEX = field->m_index ;
1697  }
1698  else {
1699  log << MSG::ERROR << "initLevelsFromDict - unable to find 'sampling' field "
1700  << endmsg ;
1701  return (1);
1702  }
1703 
1704  field = dict()->find_field("pmt") ;
1705  if (field) {
1706  m_PMT_INDEX = field->m_index ;
1707  }
1708  else {
1709  log << MSG::ERROR << "initLevelsFromDict - unable to find 'pmt' field "
1710  << endmsg ;
1711  return (1);
1712  }
1713 
1714  field = dict()->find_field("adc") ;
1715  if (field) {
1716  m_ADC_INDEX = field->m_index ;
1717  }
1718  else {
1719  log << MSG::ERROR << "initLevelsFromDict - unable to find 'adc' field "
1720  << endmsg ;
1721  return (1);
1722  }
1723 
1725 
1726  m_system_impl = region.m_implementation[m_SYSTEM_INDEX];
1727  m_section_impl = region.m_implementation[m_SECTION_INDEX];
1728  m_side_impl = region.m_implementation[m_SIDE_INDEX];
1729  m_module_impl = region.m_implementation[m_MODULE_INDEX];
1730  m_tower_impl = region.m_implementation[m_TOWER_INDEX];
1731  m_sample_impl = region.m_implementation[m_SAMPLE_INDEX];
1732  m_pmt_impl = region.m_implementation[m_PMT_INDEX];
1733  m_adc_impl = region.m_implementation[m_ADC_INDEX];
1734 
1735  if (!m_quiet) {
1736  log << MSG::DEBUG << "initLevelsFromDict decode index and bit fields for each level: " << endmsg ;
1737  log << MSG::DEBUG << " system [" << m_SYSTEM_INDEX << "] " << m_system_impl.show_to_string() << endmsg ;
1738  log << MSG::DEBUG << " section [" << m_SECTION_INDEX << "] " << m_section_impl.show_to_string() << endmsg ;
1739  log << MSG::DEBUG << " side [" << m_SIDE_INDEX << "] " << m_side_impl.show_to_string() << endmsg ;
1740  log << MSG::DEBUG << " module [" << m_MODULE_INDEX << "] " << m_module_impl.show_to_string() << endmsg ;
1741  log << MSG::DEBUG << " tower [" << m_TOWER_INDEX << "] " << m_tower_impl.show_to_string() << endmsg ;
1742  log << MSG::DEBUG << " sampling [" << m_SAMPLE_INDEX << "] " << m_sample_impl.show_to_string() << endmsg ;
1743  log << MSG::DEBUG << " pmt [" << m_PMT_INDEX << "] " << m_pmt_impl.show_to_string() << endmsg ;
1744  log << MSG::DEBUG << " adc [" << m_ADC_INDEX << "] " << m_adc_impl.show_to_string() << endmsg ;
1745  }
1746 
1747  return(0) ;
1748 }
1749 
1751 {
1752  if (regions().init (*this, "regions", m_full_region_range,
1754  m_SIDE_INDEX))
1755  return 1;
1756 
1757  if (m_modules.init (*this, "modules", m_full_module_range,
1759  m_MODULE_INDEX))
1760  return 1;
1761 
1762  if (m_towers.init (*this, "towers", m_full_tower_range,
1764  m_TOWER_INDEX))
1765  return 1;
1766 
1767  if (channels().init (*this, "channels", m_full_cell_range,
1769  m_SAMPLE_INDEX))
1770  return 1;
1771 
1772  if (m_pmts.init (*this, "pmts", m_full_pmt_range,
1774  m_PMT_INDEX))
1775  return 1;
1776 
1777  if (m_adcs.init (*this, "adcs", m_full_adc_range,
1779  m_ADC_INDEX))
1780  return 1;
1781 
1782  return (0);
1783 }
1784 
1785 
1786 int Tile_Base_ID::get_neighbours(const IdentifierHash& id_orig, const LArNeighbours::neighbourOption& option,
1787  std::vector<IdentifierHash>& neighbourList) const
1788 {
1789  int result = 1;
1790 
1791  if(!m_do_neighbours) {
1792 
1793  MsgStream log(m_msgSvc, "TileID" );
1794  log << MSG::WARNING << "get_neighbours: neighbours not initialized !!! returning empty list" << endmsg;
1795 
1796  neighbourList.resize(0);
1797  return result;
1798  }
1799 
1800  neighbourList.clear();
1801 
1802  bool prevSmp = (option & prevInSamp);
1803  bool nextSmp = (option & nextInSamp);
1804 
1805  bool corners2DOnly = ( (option & all2D) == corners2D );
1806 
1807  bool prevPhi = corners2DOnly || (option & prevInPhi);
1808  bool nextPhi = corners2DOnly || (option & nextInPhi);
1809  bool prevEta = corners2DOnly || (option & prevInEta);
1810  bool nextEta = corners2DOnly || (option & nextInEta);
1811 
1812  std::vector<IdentifierHash> inpList;
1815 
1816  inpList.push_back(id_orig);
1817 
1818  // all phi neighbours (just 2)
1819  if (prevPhi) m_neighbour.prev_phi(id_orig,neighbourList);
1820  if (nextPhi) m_neighbour.next_phi(id_orig,neighbourList);
1821 
1822  if ( (option & all2D) == faces2D) {
1823  // do nothing
1824 
1825  } else if (corners2DOnly) {
1826  // neighbours of phi-neigbours are 2D corners
1827  inpList = std::move(neighbourList); // copy 2 phi neighbours to input list
1828  neighbourList.clear(); // and clear neighbour list
1829 
1830  } else if ( (option & all2D) == all2D) {
1831  // copy all neighbours to input list
1832  inpList.insert (inpList.end(), neighbourList.begin(), neighbourList.end());
1833 
1834  }
1835 
1836  // all eta neighbours
1837  inpItr = inpList.begin();
1838  inpLast = inpList.end();
1839  for ( ; inpItr != inpLast; ++inpItr) {
1840  IdentifierHash id = (*inpItr);
1841  if (prevEta) m_neighbour.prev_eta(id,neighbourList);
1842  if (nextEta) m_neighbour.next_eta(id,neighbourList);
1843  }
1844 
1845  // all sampling neighbours
1846  if( (option & all3DwithCorners) == all3DwithCorners ) {
1847 
1848  inpItr = inpList.begin();
1849  inpLast = inpList.end();
1850  for ( ; inpItr != inpLast; ++inpItr) {
1851  IdentifierHash id = (*inpItr);
1852  m_neighbour.prev_samp_wide(id,neighbourList);
1853  m_neighbour.next_samp_wide(id,neighbourList);
1854  }
1855 
1856  } else {
1857 
1858  if (prevSmp) m_neighbour.prev_samp(id_orig,neighbourList);
1859  if (nextSmp) m_neighbour.next_samp(id_orig,neighbourList);
1860 
1861  }
1862 
1863  if (!neighbourList.empty()) result = 0;
1864 
1865  return result;
1866 }
1867 
Tile_Base_ID::module_id
Identifier module_id(int section, int side, int module) const
Definition: Tile_Base_ID.cxx:505
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Tile_Base_ID::m_tower_impl
IdDictFieldImplementation m_tower_impl
Definition: Tile_Base_ID.h:354
Tile_Base_ID::eta_min
int eta_min(const Identifier &id) const
max values (-999 == failure)
Definition: Tile_Base_ID.cxx:1545
Tile_Base_ID::is_tile_aux
bool is_tile_aux(const Identifier &id) const
Definition: Tile_Base_ID.cxx:232
LArNeighbours::neighbourOption
neighbourOption
Definition: LArNeighbours.h:12
Tile_Base_ID::decode_section
int decode_section(int section) const
Definition: Tile_Base_ID.h:314
TileNeighbour::next_eta
int next_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:496
Tile_Base_ID::pmt_range
id_range pmt_range() const
Definition: Tile_Base_ID.cxx:1398
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:299
Tile_Base_ID::is_positive
bool is_positive(const Identifier &id) const
Definition: Tile_Base_ID.cxx:250
Tile_Base_ID::m_full_adc_range
MultiRange m_full_adc_range
Definition: Tile_Base_ID.h:365
Tile_Base_ID::cell_hash_max
size_type cell_hash_max(void) const
Definition: Tile_Base_ID.cxx:1313
Tile_Base_ID::tower_begin
id_iterator tower_begin() const
iterator over set of tower Identifiers
Definition: Tile_Base_ID.cxx:1358
IdDictDictionary::unpack
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
Definition: IdDictDictionary.cxx:683
Tile_Base_ID::id_iterator
std::vector< Identifier >::const_iterator id_iterator
Type for iterators over identifiers.
Definition: Tile_Base_ID.h:209
Tile_Base_ID::reg_range
id_range reg_range() const
Definition: Tile_Base_ID.cxx:1338
get_generator_info.result
result
Definition: get_generator_info.py:21
IdDictGroup
Definition: IdDictGroup.h:19
checkHVCorrections.unpack
unpack
Definition: checkHVCorrections.py:98
TileNeighbour::next_samp
int next_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:524
CaloIDHelper::HashGroup::end
id_iterator end() const
Return an end iterator over the group's Identifiers.
CaloIDHelper::HashGroup::range
id_range range() const
Return an iterator range over the group's Identifiers.
Tile_Base_ID::m_section_impl
IdDictFieldImplementation m_section_impl
Definition: Tile_Base_ID.h:351
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
Tile_Base_ID::is_tile_gap
bool is_tile_gap(const Identifier &id) const
Definition: Tile_Base_ID.cxx:223
Tile_Base_ID::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: Tile_Base_ID.h:344
LArNeighbours::corners2D
@ corners2D
Definition: LArNeighbours.h:17
Tile_Base_ID::cell_context
IdContext cell_context(void) const
id for cells
Definition: Tile_Base_ID.cxx:1059
Tile_Base_ID::cell_end
id_iterator cell_end() const
Definition: Tile_Base_ID.cxx:1378
index
Definition: index.py:1
Tile_Base_ID::m_system_impl
IdDictFieldImplementation m_system_impl
Definition: Tile_Base_ID.h:350
Tile_Base_ID::pmt
int pmt(const Identifier &id) const
Definition: Tile_Base_ID.cxx:180
Tile_Base_ID::region_ids
const std::vector< Identifier > & region_ids() const
provide access to id vectors, accessed via hash
Definition: Tile_Base_ID.cxx:1418
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:59
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
Tile_Base_ID::cell_range
id_range cell_range() const
Definition: Tile_Base_ID.cxx:1383
CaloIDHelper::HashGroup::init
int init(T &parent, const std::string &type, const MultiRange &full_range, Identifier(T::*idfunc)(const ExpandedIdentifier &) const, size_type end_index)
Initialize.
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
LArNeighbours::faces2D
@ faces2D
Definition: LArNeighbours.h:16
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
Tile_Base_ID::module_end
id_iterator module_end() const
Definition: Tile_Base_ID.cxx:1348
Tile_Base_ID::AUXDET
@ AUXDET
Definition: Tile_Base_ID.h:48
CaloIDHelper::HashGroup::id
Identifier id(IdentifierHash hashId) const
Return the identifier for a given hash code (no checking).
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
Tile_Base_ID::encode_section
int encode_section(int section) const
Definition: Tile_Base_ID.h:319
CaloIDHelper::HashGroup::begin
id_iterator begin() const
Return a begin iterator over the group's Identifiers.
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
Tile_Base_ID::region_hash_max
size_type region_hash_max(void) const
hash tables max size
Definition: Tile_Base_ID.cxx:1298
Tile_Base_ID::is_tile_extbarrel
bool is_tile_extbarrel(const Identifier &id) const
Definition: Tile_Base_ID.cxx:214
Tile_Base_ID::m_PMT_INDEX
size_type m_PMT_INDEX
Definition: Tile_Base_ID.h:347
Tile_Base_ID::initLevelsFromDict
int initLevelsFromDict(const std::string &group_name)
Definition: Tile_Base_ID.cxx:1613
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
Tile_Base_ID::cell_ids
const std::vector< Identifier > & cell_ids() const
Definition: Tile_Base_ID.cxx:1433
Tile_Base_ID::HIGHGAIN
@ HIGHGAIN
Definition: Tile_Base_ID.h:57
IdDictMgr::find_metadata
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
Definition: IdDictMgr.cxx:92
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
Tile_Base_ID::GAPDET
@ GAPDET
Definition: Tile_Base_ID.h:48
Tile_Base_ID::m_neighbour
TileNeighbour m_neighbour
Definition: Tile_Base_ID.h:372
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
Tile_Base_ID::SAMP_E
@ SAMP_E
Definition: Tile_Base_ID.h:55
Tile_Base_ID::module_hash_max
size_type module_hash_max(void) const
Definition: Tile_Base_ID.cxx:1303
Tile_Base_ID::cell_begin
id_iterator cell_begin() const
iterator over set of cell Identifiers
Definition: Tile_Base_ID.cxx:1373
Tile_Base_ID::BARREL
@ BARREL
Definition: Tile_Base_ID.h:48
Tile_Base_ID::system
int system(const Identifier &id) const
Definition: Tile_Base_ID.cxx:141
CaloIDHelper::HashGroup::get_hash
int get_hash(Identifier id, IdentifierHash &hash_id) const
Look up the hash code corresponding to an Identifier.
Definition: CaloIDHelper.cxx:68
LArNeighbours::prevInPhi
@ prevInPhi
Definition: LArNeighbours.h:12
Tile_Base_ID::get_expanded_id
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
Definition: Tile_Base_ID.cxx:1590
TileNeighbour::prev_samp
int prev_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:510
Tile_Base_ID::m_module_impl
IdDictFieldImplementation m_module_impl
Definition: Tile_Base_ID.h:353
Tile_Base_ID::is_high_gain
bool is_high_gain(const Identifier &id) const
Definition: Tile_Base_ID.cxx:286
AtlasDetectorID::tile_exp
ExpandedIdentifier tile_exp(void) const
Definition: AtlasDetectorID.h:499
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:45
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictRegion.h:20
CaloIDHelper::regions
const HashGroup & regions() const
Return the HashGroup for regions.
Tile_Base_ID::region
int region(int section, int side) const
Definition: Tile_Base_ID.cxx:119
Tile_Base_ID::module_context
IdContext module_context(void) const
id for modules
Definition: Tile_Base_ID.cxx:1047
Tile_Base_ID::initialize_base_from_dictionary
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
Definition: Tile_Base_ID.cxx:1181
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TileNeighbour::prev_eta
int prev_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:482
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TileNeighbour::prev_phi
int prev_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:456
Tile_Base_ID::get_field
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
Definition: Tile_Base_ID.cxx:108
AtlasDetectorID::m_do_neighbours
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
Definition: AtlasDetectorID.h:365
TileNeighbour::initialize
int initialize(const Tile_Base_ID *tileID, const std::string &filename="TileNeighbour.txt")
Definition: TileNeighbour.cxx:61
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Tile_Base_ID::Tile_Base_ID
Tile_Base_ID(const std::string &name, bool supercell)
Constructor.
Definition: Tile_Base_ID.cxx:33
IdDictDefs.h
Tile_Base_ID::m_SECTION_INDEX
size_type m_SECTION_INDEX
Definition: Tile_Base_ID.h:342
Tile_Base_ID::m_pmts
CaloIDHelper::HashGroup m_pmts
Definition: Tile_Base_ID.h:369
Tile_Base_ID::tile_det
Identifier tile_det(int section) const
build identifier for any Tilecal section
Definition: Tile_Base_ID.cxx:398
CaloIDHelper::size_type
Identifier::size_type size_type
Definition: CaloIDHelper.h:39
LArNeighbours::nextInSamp
@ nextInSamp
Definition: LArNeighbours.h:20
Tile_Base_ID::m_tile_region_index
size_type m_tile_region_index
Definition: Tile_Base_ID.h:340
python.PyAthena.module
module
Definition: PyAthena.py:131
Tile_Base_ID::EXTBAR
@ EXTBAR
Definition: Tile_Base_ID.h:48
Tile_Base_ID::region_id
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers
Definition: Tile_Base_ID.cxx:405
LArNeighbours::nextInPhi
@ nextInPhi
Definition: LArNeighbours.h:13
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
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
Tile_Base_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: Tile_Base_ID.cxx:1077
IdDictDictionary::find_group
IdDictGroup * find_group(const std::string &group_name) const
Definition: IdDictDictionary.cxx:115
Tile_Base_ID::adc
int adc(const Identifier &id) const
Definition: Tile_Base_ID.cxx:186
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
Tile_Base_ID::tile_gap
Identifier tile_gap() const
build identifier for Tile Gap detector (ITC + gap/crack scintillators)
Definition: Tile_Base_ID.cxx:355
Tile_Base_ID::is_tile_gapscin
bool is_tile_gapscin(const Identifier &id) const
Definition: Tile_Base_ID.cxx:268
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
IdentifierField::empty
bool empty() const
Definition: IdentifierField.h:114
Tile_Base_ID::tower_id
Identifier tower_id(int section, int side, int module, int tower) const
Definition: Tile_Base_ID.cxx:562
lumiFormat.i
int i
Definition: lumiFormat.py:85
MultiRange::remove_range
void remove_range(const ExpandedIdentifier &id)
Remove a Range made from a single ExpandedIdentifier.
Definition: MultiRange.cxx:43
CaloIDHelper::HashGroup::ids
const std::vector< Identifier > & ids() const
Return a vector of all Identifiers for this group.
LArNeighbours::all3DwithCorners
@ all3DwithCorners
Definition: LArNeighbours.h:26
CaloIDHelper::dict
const IdDictDictionary * dict() const
Return the dictionary for this subdetector.
CaloIDHelper
Base class to factor out code common among Calo ID helpers.
Definition: CaloIDHelper.h:34
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Tile_Base_ID::tile_system
Identifier tile_system() const
build identifier for whole TileCal
Definition: Tile_Base_ID.cxx:301
Tile_Base_ID::module_range
id_range module_range() const
Definition: Tile_Base_ID.cxx:1353
Tile_Base_ID::adc_range
id_range adc_range() const
Definition: Tile_Base_ID.cxx:1413
Tile_Base_ID::SUPERCELL_MASK
@ SUPERCELL_MASK
Definition: Tile_Base_ID.h:51
Tile_Base_ID::m_ADC_INDEX
size_type m_ADC_INDEX
Definition: Tile_Base_ID.h:348
Tile_Base_ID::tile_extbarrel
Identifier tile_extbarrel() const
build identifier for Tile Extended Barrel
Definition: Tile_Base_ID.cxx:336
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDictionary.h:235
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
Tile_Base_ID::tower_context
IdContext tower_context(void) const
id for towers
Definition: Tile_Base_ID.cxx:1053
Tile_Base_ID::POSITIVE
@ POSITIVE
Definition: Tile_Base_ID.h:56
mc.group_name
group_name
Definition: mc.PhPy8EG_A14NNPDF23_NNLOPS_example.py:33
TileID_Exception
Exception class for Tile Identifiers.
Definition: TileID_Exception.h:16
AtlasDetectorID::is_tile
bool is_tile(Identifier id) const
Definition: AtlasDetectorID.h:695
Tile_Base_ID::LOWGAIN
@ LOWGAIN
Definition: Tile_Base_ID.h:57
Tile_Base_ID::tower_end
id_iterator tower_end() const
Definition: Tile_Base_ID.cxx:1363
Tile_Base_ID::module_ids
const std::vector< Identifier > & module_ids() const
Definition: Tile_Base_ID.cxx:1423
Tile_Base_ID::region_eta_max
int region_eta_max(const Identifier &id) const
Definition: Tile_Base_ID.cxx:1563
Tile_Base_ID::module_begin
id_iterator module_begin() const
iterator over set of module Identifiers
Definition: Tile_Base_ID.cxx:1343
Tile_Base_ID.h
Factor out code common between TileID and Tile_SuperCell_ID.
LArNeighbours::prevInSamp
@ prevInSamp
Definition: LArNeighbours.h:19
AtlasDetectorID::m_quiet
bool m_quiet
If true, suppress DEBUG/INFO messages.
Definition: AtlasDetectorID.h:371
Tile_Base_ID::m_TOWER_INDEX
size_type m_TOWER_INDEX
Definition: Tile_Base_ID.h:345
Tile_Base_ID::reg_end
id_iterator reg_end() const
Definition: Tile_Base_ID.cxx:1333
CaloIDHelper::initialize_base_from_dictionary
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &dict_name)
Do basic initialization of the helper.
Definition: CaloIDHelper.cxx:232
Tile_Base_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: Tile_Base_ID.cxx:1151
Tile_Base_ID::init_hashes
int init_hashes(void)
Definition: Tile_Base_ID.cxx:1750
Tile_Base_ID::pmt_begin
id_iterator pmt_begin() const
iterator over set of pmt Identifiers
Definition: Tile_Base_ID.cxx:1388
Tile_Base_ID::adc_id
Identifier adc_id(const Identifier &cell_id, int pmt, int adc) const
Definition: Tile_Base_ID.cxx:802
AtlasDetectorID::tile_field_value
int tile_field_value() const
Definition: AtlasDetectorID.h:617
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:73
IdContext::prefix_id
const ExpandedIdentifier & prefix_id() const
Accessors.
Definition: IdContext.h:44
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition: StrFormat.cxx:49
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Tile_Base_ID::adc_begin
id_iterator adc_begin() const
iterator over set of adc Identifiers
Definition: Tile_Base_ID.cxx:1403
IdentifierHash.h
Tile_Base_ID::NEGATIVE
@ NEGATIVE
Definition: Tile_Base_ID.h:56
Tile_Base_ID::adc_end
id_iterator adc_end() const
Definition: Tile_Base_ID.cxx:1408
Tile_Base_ID::m_full_module_range
MultiRange m_full_module_range
Definition: Tile_Base_ID.h:361
Tile_Base_ID::m_towers
CaloIDHelper::HashGroup m_towers
Definition: Tile_Base_ID.h:368
Tile_Base_ID::m_pmt_impl
IdDictFieldImplementation m_pmt_impl
Definition: Tile_Base_ID.h:356
Tile_Base_ID::phi_max
int phi_max(const Identifier &id) const
Definition: Tile_Base_ID.cxx:1569
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
Tile_Base_ID::tower_ids
const std::vector< Identifier > & tower_ids() const
Definition: Tile_Base_ID.cxx:1428
Tile_Base_ID::m_adc_impl
IdDictFieldImplementation m_adc_impl
Definition: Tile_Base_ID.h:357
Tile_Base_ID::tile_barrel
Identifier tile_barrel() const
build identifier for Tile Barrel
Definition: Tile_Base_ID.cxx:318
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
Tile_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash &id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
Definition: Tile_Base_ID.cxx:1786
Tile_Base_ID::tower_hash_max
size_type tower_hash_max(void) const
Definition: Tile_Base_ID.cxx:1308
Tile_Base_ID::region_eta_min
int region_eta_min(const Identifier &id) const
Definition: Tile_Base_ID.cxx:1557
IdDictDictionary
Definition: IdDictDictionary.h:30
Tile_Base_ID::adc_context
IdContext adc_context(void) const
id for ADCs
Definition: Tile_Base_ID.cxx:1071
CaloIDHelper::channels
const HashGroup & channels() const
Return the HashGroup for channels (cells).
Tile_Base_ID::pmt_hash_max
size_type pmt_hash_max(void) const
Definition: Tile_Base_ID.cxx:1318
Tile_Base_ID::m_supercell
unsigned m_supercell
Definition: Tile_Base_ID.h:338
TileNeighbour::prev_samp_wide
int prev_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:538
Tile_Base_ID::m_sample_impl
IdDictFieldImplementation m_sample_impl
Definition: Tile_Base_ID.h:355
Tile_Base_ID::m_side_impl
IdDictFieldImplementation m_side_impl
Definition: Tile_Base_ID.h:352
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
Tile_Base_ID::m_full_cell_range
MultiRange m_full_cell_range
Definition: Tile_Base_ID.h:363
DeMoScan.index
string index
Definition: DeMoScan.py:364
Tile_Base_ID::m_SIDE_INDEX
size_type m_SIDE_INDEX
Definition: Tile_Base_ID.h:343
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:206
Tile_Base_ID::m_adcs
CaloIDHelper::HashGroup m_adcs
Definition: Tile_Base_ID.h:370
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
IdDictDictionary::m_name
std::string m_name
Definition: IdDictDictionary.h:216
Tile_Base_ID::m_modules
CaloIDHelper::HashGroup m_modules
Definition: Tile_Base_ID.h:367
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
Tile_Base_ID::to_string
std::string to_string(const Identifier &id, int level=0) const
Definition: Tile_Base_ID.cxx:52
Tile_Base_ID::m_full_pmt_range
MultiRange m_full_pmt_range
Definition: Tile_Base_ID.h:364
Tile_Base_ID::eta_max
int eta_max(const Identifier &id) const
Definition: Tile_Base_ID.cxx:1551
Tile_Base_ID::adc_ids
const std::vector< Identifier > & adc_ids() const
Definition: Tile_Base_ID.cxx:1443
Tile_Base_ID::pmt_id
Identifier pmt_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:640
Tile_Base_ID::pmt_end
id_iterator pmt_end() const
Definition: Tile_Base_ID.cxx:1393
LArNeighbours::nextInEta
@ nextInEta
Definition: LArNeighbours.h:15
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DEBUG
#define DEBUG
Definition: page_access.h:11
Tile_Base_ID::m_SYSTEM_INDEX
size_type m_SYSTEM_INDEX
Definition: Tile_Base_ID.h:341
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
Tile_Base_ID::is_supercell
bool is_supercell(const Identifier &id) const
Definition: Tile_Base_ID.cxx:294
Tile_Base_ID::is_twosides
bool is_twosides(const Identifier &id) const
Definition: Tile_Base_ID.cxx:259
Tile_Base_ID::tower_range
id_range tower_range() const
Definition: Tile_Base_ID.cxx:1368
LArNeighbours
Definition: LArNeighbours.h:11
Tile_Base_ID::is_negative
bool is_negative(const Identifier &id) const
Definition: Tile_Base_ID.cxx:241
Tile_Base_ID::pmt_context
IdContext pmt_context(void) const
id for PMTs
Definition: Tile_Base_ID.cxx:1065
Tile_Base_ID::m_full_tower_range
MultiRange m_full_tower_range
Definition: Tile_Base_ID.h:362
LArNeighbours::prevInEta
@ prevInEta
Definition: LArNeighbours.h:14
Tile_Base_ID::pmt_ids
const std::vector< Identifier > & pmt_ids() const
Definition: Tile_Base_ID.cxx:1438
Tile_Base_ID::id_range
boost::iterator_range< id_iterator > id_range
Type for range over identifiers.
Definition: Tile_Base_ID.h:211
Tile_Base_ID::region_context
IdContext region_context(void) const
access to IdContext's which define which levels of fields are contained in the id
Definition: Tile_Base_ID.cxx:1041
Tile_Base_ID::adc_hash_max
size_type adc_hash_max(void) const
Definition: Tile_Base_ID.cxx:1323
TileNeighbour::next_phi
int next_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:469
Tile_Base_ID::cell_hash
IdentifierHash cell_hash(const Identifier &cell_id) const
fast conversion from ID to hash for cells
Definition: Tile_Base_ID.cxx:1030
calibdata.copy
bool copy
Definition: calibdata.py:27
TileNeighbour::next_samp_wide
int next_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:552
CaloCondBlobAlgs_fillNoiseFromASCII.fields
fields
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:106
Tile_Base_ID::m_full_region_range
MultiRange m_full_region_range
Definition: Tile_Base_ID.h:360
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
IdDictField
Definition: IdDictField.h:15
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
Tile_Base_ID::is_tile_barrel
bool is_tile_barrel(const Identifier &id) const
Test of an Identifier to see if it belongs to a particular part of the calorimeter.
Definition: Tile_Base_ID.cxx:205
Tile_Base_ID::cell_id
Identifier cell_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:581
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
AtlasDetectorID::do_checks
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
Definition: AtlasDetectorID.cxx:457
Tile_Base_ID::is_low_gain
bool is_low_gain(const Identifier &id) const
Definition: Tile_Base_ID.cxx:277
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
Tile_Base_ID::m_SAMPLE_INDEX
size_type m_SAMPLE_INDEX
Definition: Tile_Base_ID.h:346
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
Tile_Base_ID::reg_begin
id_iterator reg_begin() const
iterator over set of region Identifiers
Definition: Tile_Base_ID.cxx:1328
CaloIDHelper::HashGroup::hash_max
size_type hash_max() const
Return one more than the largest hash code.
Tile_Base_ID::SAMP_X
@ SAMP_X
Definition: Tile_Base_ID.h:55
CaloIDHelper::channel_id
Identifier channel_id(IdentifierHash hashId) const
Return the channel (cell) Identifier for a given hash code (no checking).
Identifier
Definition: IdentifierFieldParser.cxx:14