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