ATLAS Offline Software
TileTBID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Access to Tile Calorimeter TB data
7  -----------------------------------------
8  ***************************************************************************/
9 
10 
12 #include "IdDict/IdDictDefs.h"
15 #include "CxxUtils/StrFormat.h"
16 #include "GaudiKernel/MsgStream.h"
17 
18 #include <algorithm>
19 #include <cassert>
20 #include <cstdio>
21 #include <iostream>
22 
24 
25 
27  : AtlasDetectorID("TileTBID", "tile")
28  , m_tile_region_index(0)
29  , m_SYSTEM_INDEX(999)
30  , m_SECTION_INDEX(999)
31  , m_TYPE_INDEX(999)
32  , m_MODULE_INDEX(999)
33  , m_CHANNEL_INDEX(999)
34  , m_dict(nullptr)
35  , m_type_hash_max(0)
36  , m_module_hash_max(0)
37  , m_channel_hash_max(0)
38 {
39 }
40 
41 TileTBID::~TileTBID() = default;
42 
43 //
44 // TileTBID methods
45 //
46 std::string
47 TileTBID::to_string( const Identifier & id, int level ) const
48 {
49  IdContext context;
50  switch (level) {
51  case 1: case -3:
52  case 2: case -2: context = type_context(); break;
53  case 3: case -1: context = module_context(); break;
54  case 4: case 0: context = channel_context(); break;
55  default:
56  return "TileTBID::to_string - unknown context";
57  }
58 
59  ExpandedIdentifier exp_id;
60  if ( get_expanded_id(id,exp_id,&context) ) {
61  return "TileTBID::to_string - can not expand ID";
62  } else {
63  return (std::string)(exp_id);
64  }
65 }
66 
67 //
68 // get methods
69 //
70 int
72 {
73  int field = 0;
74  if(!m_dict->unpack(id, 0, index, m_tile_region_index, field)) {
75  return field;
76  } else {
77  return 0;
78  }
79 }
80 
81 //
82 // check methods
83 //
84 bool
86 {
87  bool result = is_tile(id)
88  && ( section(id) == TileTBID::TILE_TESTBEAM );
89 
90  return result;
91 }
92 
93 //
94 // TileCal TB ID
95 //
98 {
99  Identifier compactID(m_base_tile_type);
100  return compactID;
101 }
102 
103 //
104 // Build type & module id
105 //
107 TileTBID::type_id ( int type, bool checks ) const
108 {
109  if(checks) {
110 
111  // Check that id is within allowed range
112 
113  // Fill expanded id
114  ExpandedIdentifier expId(tile_exp());
115  expId << TileTBID::TILE_TESTBEAM << type;
116 
117  if (!m_full_type_range.match(expId)) {
118  std::string errorMessage = "TileTBID::type_id() result is not OK: ID, range = "
119  + std::string(expId) + " , " + (std::string)m_full_type_range;
120  throw TileID_Exception(errorMessage , 2);
121  }
122  }
123 
124  Identifier compactID(m_base_tile_type);
125  m_type_impl.pack (type,compactID);
126 
127  return (compactID);
128 }
130 TileTBID::type_id ( int type ) const
131 {
132  return type_id (type, do_checks());
133 }
134 
135 
137 TileTBID::module_id ( int type, int module, bool checks ) const
138 {
139  if(checks) {
140 
141  // Check that id is within allowed range
142 
143  // Fill expanded id
144  ExpandedIdentifier expId(tile_exp());
145  expId << TileTBID::TILE_TESTBEAM << type << module;
146 
147  if (!m_full_module_range.match(expId)) {
148  std::string errorMessage = "TileTBID::module_id() result is not OK: ID, range = "
149  + std::string(expId) + " , " + (std::string)m_full_type_range;
150  throw TileID_Exception(errorMessage , 1);
151  }
152  }
153 
154  Identifier compactID(m_base_tile_type);
155  m_type_impl.pack (type,compactID);
156  m_module_impl.pack (module,compactID);
157 
158  return (compactID);
159 }
161 TileTBID::module_id ( int type, int module ) const
162 {
163  return module_id (type, module, do_checks());
164 }
165 
166 //
167 // Build channel id
168 //
170 TileTBID::channel_id ( int type, int module, int channel, bool checks ) const
171 {
172  if(checks) {
173 
174  // Check that id is within allowed range
175 
176  // Fill expanded id
177  ExpandedIdentifier expId(tile_exp());
178  expId << TileTBID::TILE_TESTBEAM << type << module << channel;
179 
180  if (!m_full_channel_range.match(expId)) {
181  std::string errorMessage = "TileTBID::channel_id() result is not OK: ID, range = "
182  + std::string(expId) + " , " + (std::string)m_full_type_range;
183  throw TileID_Exception(errorMessage , 1);
184  }
185  }
186 
187  Identifier compactID(m_base_tile_type);
188  m_type_impl.pack (type,compactID);
189  m_module_impl.pack (module,compactID);
190  m_channel_impl.pack (channel,compactID);
191 
192  return (compactID);
193 }
195 TileTBID::channel_id ( int type, int module, int channel ) const
196 {
197  return channel_id (type, module, channel, do_checks());
198 }
199 
201 TileTBID::module_id ( const Identifier & any_id ) const
202 {
203  Identifier compactId(any_id);
204  m_channel_impl.reset(compactId);
205 
206  return (compactId);
207 }
208 
210 TileTBID::channel_id ( const Identifier & module_id,
211  int channel ) const
212 {
213  Identifier compactId(module_id);
214  m_channel_impl.pack(channel,compactId);
215 
216  if(m_do_checks) {
217 
218  // Check that id is within allowed range
219 
220  // Fill expanded id
221  ExpandedIdentifier expId;
222 
223  IdContext context = module_context();
224  if (get_expanded_id(compactId, expId, &context)) {
225  std::string errorMessage = "TileTBID::channel_id(module_id,channel) result is not OK: ID = "
226  + compactId.getString() ;
227  throw TileID_Exception(errorMessage , 1);
228 
229  // region_id.show();
230  }
231 
232  expId << channel;
233 
234  if (!m_full_channel_range.match(expId)) {
235  std::string errorMessage = "TileTBID::channel_id() result is not OK: ID, range = "
236  + (std::string)expId + " , " + (std::string)m_full_type_range;
237  throw TileID_Exception(errorMessage , 1);
238  }
239  }
240 
241  return compactId;
242 }
243 
244 bool TileTBID::module_id ( const Identifier& type_id,
245  int module, Identifier& module_id )
246 {
248  IdContext context = type_context();
249  get_expanded_id(type_id, id, &context);
250  id << module;
251  if (!m_full_module_range.match(id)) {
252  return false;
253  }
254 
255  Identifier compactId(0);
256  if (!m_dict->pack32(id,0, id.fields() - 1,compactId)) {
257  module_id = compactId;
258  }
259  return true;
260 }
261 
262 bool TileTBID::channel_id ( const Identifier& type_id,
263  int module, int channel, Identifier& channel_id )
264 {
266  IdContext context = type_context();
267  get_expanded_id(type_id, id, &context);
268  id << module << channel;
269  if (!m_full_channel_range.match(id)) {
270  return false;
271  }
272 
273  Identifier compactId(0);
274  if (!m_dict->pack32(id,0, id.fields() - 1,compactId)) {
275  channel_id = compactId;
276  }
277  return true;
278 }
279 
280 bool TileTBID::channel_id ( const Identifier& module_id,
281  int channel, Identifier& channel_id )
282 {
284  IdContext context = module_context();
285  get_expanded_id(module_id, id, &context);
286  id << channel;
287  if (!m_full_channel_range.match(id)) {
288  return false;
289  }
290 
291  Identifier compactId(0);
292  if (!m_dict->pack32(id,0, id.fields() - 1,compactId)) {
293  channel_id = compactId;
294  }
295  return true;
296 }
297 
298 IdContext
300 {
302  return {id, 0, m_TYPE_INDEX};
303 }
304 
305 IdContext
307 {
309  return {id, 0, m_MODULE_INDEX};
310 }
311 
312 IdContext
314 {
316  return {id, 0, m_CHANNEL_INDEX};
317 }
318 
319 int TileTBID::get_id (const IdentifierHash& hash_id, Identifier& id, const IdContext* context ) const
320 {
321  int result = 1;
322  id.clear();
323 
324  size_t begin = (context) ? context->begin_index(): 0;
325  // cannot get hash if end is 0:
326  size_t end = (context) ? context->end_index() : 0;
327 
328  if (0 == begin) {
329 
330  if ( m_CHANNEL_INDEX == end ) {
331  if (hash_id < (unsigned int)(m_channel_vec.end() - m_channel_vec.begin())) {
332  id = m_channel_vec[hash_id];
333  result = 0;
334  } else {
335  MsgStream log(m_msgSvc, "TileTBID" );
336  log << MSG::ERROR << "get_id: channel hash_id is out of range " << hash_id
337  << " => " << m_channel_vec.size() << endmsg;
338  }
339  } else if ( m_MODULE_INDEX == end ) {
340  if (hash_id < (unsigned int)(m_module_vec.end() - m_module_vec.begin())) {
341  id = m_module_vec[hash_id];
342  result = 0;
343  } else {
344  MsgStream log(m_msgSvc, "TileTBID" );
345  log << MSG::ERROR << "get_id: module hash_id is out of range "
346  << hash_id << " => " << m_module_vec.size() << endmsg;
347  }
348  } else if ( m_TYPE_INDEX == end ) {
349  if (hash_id < (unsigned int)(m_type_vec.end() - m_type_vec.begin())) {
350  id = m_type_vec[hash_id];
351  result = 0;
352  } else {
353  MsgStream log(m_msgSvc, "TileTBID" );
354  log << MSG::ERROR << "get_id: TYPE hash_id is out of range " << hash_id
355  << " => " << m_type_vec.size() << endmsg;
356  }
357  }
358  }
359  return(result);
360 }
361 
362 
363 int TileTBID::get_hash (const Identifier& id, IdentifierHash& hash_id, const IdContext* context ) const
364 {
365 
366  hash_id = 0;
367  int result = 1;
368 
369  size_t begin = (context) ? context->begin_index(): 0;
370  size_t end = (context) ? context->end_index() : 0;
371 
372  if (0 == begin) {
373  if ( m_CHANNEL_INDEX == end ) {
374  std::vector<Identifier>::const_iterator it = std::lower_bound(m_channel_vec.begin(),m_channel_vec.end(),id);
375  if ( it != m_channel_vec.end() ){
376  hash_id = it - m_channel_vec.begin();
377  result = 0;
378  }
379  } else if ( m_MODULE_INDEX == end ) {
380  std::vector<Identifier>::const_iterator it = std::lower_bound(m_module_vec.begin(),m_module_vec.end(),id);
381  if ( it != m_module_vec.end() ){
382  hash_id = it - m_module_vec.begin();
383  result = 0;
384  }
385  } else if ( m_TYPE_INDEX == end ) {
386  std::vector<Identifier>::const_iterator it = std::lower_bound(m_type_vec.begin(),m_type_vec.end(),id);
387  if ( it != m_type_vec.end() ){
388  hash_id = it - m_type_vec.begin();
389  result = 0;
390  }
391  }
392  }
393 
394  return (result);
395 }
396 
398 {
399  MsgStream log(m_msgSvc, "TileTBID" );
400  log << MSG::INFO << "initialize_from_dictionary " << endmsg;
401 
402  // Check whether this helper should be reinitialized
403  if (!reinitialize(dict_mgr)) {
404  log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
405  return (0);
406  }
407  else {
408  log << MSG::DEBUG << "(Re)initialize" << endmsg;
409  }
410 
411  log << MSG::DEBUG << "calling base initialize_from_dictionary" << endmsg;
412 
413  // init base object
414  if(AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return (1);
415 
416  // Register version of the TileCalo dictionary
417  if (register_dict_tag(dict_mgr, "TileCalorimeter")) return(1);
418 
419  m_dict = dict_mgr.find_dictionary ("TileCalorimeter");
420  if(!m_dict) {
421  log << MSG::ERROR << "cannot access TileCalorimeter dictionary " << endmsg;
422  return 1;
423  }
424 
425  // Initialize the field indices
426  if(initLevelsFromDict()) return (1);
427 
428 
429  // Find value for the field Tile Calorimeter
430  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary ("ATLAS");
431  int tileField = -1;
432  if (atlasDict->get_label_value("subdet", "TileCalorimeter", tileField)) {
433  log << MSG::ERROR << "Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
434  << atlasDict->name()
435  << endmsg;
436  return (1);
437  }
438 
439  // Find value for the field Tile Testbeam
440  int tiletbField = -1;
441  if (m_dict->get_label_value("section", "Testbeam", tiletbField)) {
442  log << MSG::ERROR << "Could not get value for label 'Testbeam' of field 'section' in dictionary "
443  << m_dict->name()
444  << endmsg;
445  return (1);
446  }
447 
448  /*
449  log << MSG::DEBUG << "TileTB_ID::initialize_from_dict - found field values: TileTB "
450  << TileTBField
451  << endmsg;
452  */
453 
454  // Set up id for region and range prefix
455  ExpandedIdentifier reg_id;
456  reg_id.add(tileField);
457  reg_id.add(tiletbField);
458  Range prefix;
459 
460  m_full_channel_range= m_dict->build_multirange(reg_id, prefix, "tbchannel");
461  m_full_module_range = m_dict->build_multirange(reg_id, prefix, "tbmodule");
462  m_full_type_range = m_dict->build_multirange(reg_id, prefix, "type");
463 
464  if (!m_quiet) {
465  log << MSG::DEBUG << "initialize_from_dict : " << endmsg;
466  log << MSG::DEBUG << " type range -> " << (std::string)m_full_type_range << endmsg;
467  log << MSG::DEBUG << " module range -> " << (std::string)m_full_module_range << endmsg;
468  log << MSG::DEBUG << " channel range -> " << (std::string)m_full_channel_range << endmsg;
469  }
470 
471  // Setup the hash tables
472  if(init_hashes()) return (1);
473 
474  return 0;
475 
476 }
477 
478 int TileTBID::get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const
479 {
480  int result = 1;
481 
482  size_t begin = (context) ? context->begin_index() : 0;
483  size_t end = (context) ? context->end_index() : m_CHANNEL_INDEX;
484  assert (end <= m_CHANNEL_INDEX);
485 
486  if (0 == end) {
487  result = 0;
488  }
489  else if ( 0 == begin) {
490  ExpandedIdentifier empty;
491  result = m_dict->unpack(group(), id, empty, end, exp_id);
492  }
493  else {
494  result = m_dict->unpack(group(), id, context->prefix_id(), end, exp_id);
495  }
496  return result;
497 }
498 
500 {
501  MsgStream log(m_msgSvc, "TileTBID" );
502 
503  if(!m_dict) {
504  log << MSG::ERROR << "initLevelsFromDict - dictionary NOT initialized "
505  << endmsg ;
506  return (1);
507  }
508 
509  // Find out which identifier field corresponds to each level.
510 
511  m_SYSTEM_INDEX = 999;
512  m_SECTION_INDEX = 999;
513  m_TYPE_INDEX = 999;
514  m_MODULE_INDEX = 999;
515  m_CHANNEL_INDEX = 999;
516 
517  // Save index to a Tile region for unpacking
518  ExpandedIdentifier expId(tile_exp());
520  log << MSG::ERROR << "initLevelsFromDict - unable to find tile region index: expId, reg "
521  << (std::string)expId << " " << m_tile_region_index
522  << endmsg;
523  return (1);
524  }
525 
526  // Fing a Tile region
527  IdDictField* field = m_dict->find_field("subdet") ;
528  if (field) {
529  m_SYSTEM_INDEX = field->index();
530  }
531  else {
532  log << MSG::ERROR << "initLevelsFromDict - unable to find 'subdet' field "
533  << endmsg ;
534  return (1);
535  }
536 
537  field = m_dict->find_field("section") ;
538  if (field) {
539  m_SECTION_INDEX = field->index();
540  }
541  else {
542  log << MSG::ERROR << "initLevelsFromDict - unable to find 'section' field "
543  << endmsg ;
544  return (1);
545  }
546 
547  field = m_dict->find_field("type") ;
548  if (field) {
549  m_TYPE_INDEX = field->index();
550  }
551  else {
552  log << MSG::ERROR << "initLevelsFromDict - unable to find 'type' field "
553  << endmsg ;
554  return (1);
555  }
556 
557  field = m_dict->find_field("tbmodule") ;
558  if (field) {
559  m_MODULE_INDEX = field->index();
560  }
561  else {
562  log << MSG::ERROR << "initLevelsFromDict - unable to find 'tbmodule' field "
563  << endmsg ;
564  return (1);
565  }
566 
567  field = m_dict->find_field("tbchannel") ;
568  if (field) {
569  m_CHANNEL_INDEX = field->index();
570  }
571  else {
572  log << MSG::ERROR << "initLevelsFromDict - unable to find 'tbchannel' field "
573  << endmsg ;
574  return (1);
575  }
576 
577  /* Set the field implementations */
578  const IdDictRegion& region = m_dict->region(m_tile_region_index);
579 
585 
589 
590  if (!m_quiet) {
591  log << MSG::DEBUG << "initLevelsFromDict decode index and bit fields for each level: " << endmsg ;
592  log << MSG::DEBUG << " system [" << m_SYSTEM_INDEX << "] " << m_system_impl.show_to_string() << endmsg ;
593  log << MSG::DEBUG << " section [" << m_SECTION_INDEX << "] " << m_section_impl.show_to_string() << endmsg ;
594  log << MSG::DEBUG << " type [" << m_TYPE_INDEX << "] " << m_type_impl.show_to_string() << endmsg ;
595  log << MSG::DEBUG << " module [" << m_MODULE_INDEX << "] " << m_module_impl.show_to_string() << endmsg ;
596  log << MSG::DEBUG << " channel [" << m_CHANNEL_INDEX << "] " << m_channel_impl.show_to_string() << endmsg ;
597  }
598 
599  return(0) ;
600 }
601 
603 {
604  MsgStream log(m_msgSvc, "TileTBID" );
605 
606  // type hash
607  unsigned int nids = 0;
608  std::set<Identifier> ids;
609  for (unsigned int i = 0; i < m_full_type_range.size(); ++i) {
610  const Range& range = m_full_type_range[i];
612  auto first = rit.begin();
613  auto last = rit.end();
614  for (; first != last; ++first) {
615  const ExpandedIdentifier& exp_id = (*first);
616  Identifier id = type_id (exp_id[m_TYPE_INDEX]);
617  if(!(ids.insert(id)).second){
618  log << MSG::ERROR << "init_hashes "
619  << " Error: duplicated id for type id. nids= " << nids
620  << " compact Id " << show_to_string(id)
621  << endmsg;
622  }
623  nids++;
624  }
625  }
627  if ( fill_vec(ids, m_type_hash_max, m_type_vec) ) return (1);
628 
629  // module hash
630  nids = 0;
631  ids.clear();
632  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
633  const Range& range = m_full_module_range[i];
635  auto first = rit.begin();
636  auto last = rit.end();
637  for (; first != last; ++first) {
638  const ExpandedIdentifier& exp_id = (*first);
639  Identifier id = module_id (exp_id[m_TYPE_INDEX],
640  exp_id[m_MODULE_INDEX]);
641  if(!(ids.insert(id)).second){
642  log << MSG::ERROR << "init_hashes "
643  << " Error: duplicated id for module id. nids= " << nids
644  << " compact Id " << show_to_string(id)
645  << endmsg;
646  }
647  nids++;
648  }
649  }
651  if ( fill_vec(ids, m_module_hash_max, m_module_vec) ) return (1);
652 
653  // channel hash
654  nids = 0;
655  ids.clear();
656  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
657  const Range& range = m_full_channel_range[i];
659  auto first = rit.begin();
660  auto last = rit.end();
661  for (; first != last; ++first) {
662  const ExpandedIdentifier& exp_id = (*first);
663  Identifier id = channel_id (exp_id[m_TYPE_INDEX],
664  exp_id[m_MODULE_INDEX],
665  exp_id[m_CHANNEL_INDEX]);
666  if(!(ids.insert(id)).second){
667  log << MSG::ERROR << "init_hashes "
668  << " Error: duplicated id for channel id. nids= " << nids
669  << " compact Id " << show_to_string(id)
670  << endmsg;
671  }
672  nids++;
673  }
674  }
676  if ( fill_vec(ids, m_channel_hash_max, m_channel_vec) ) return (1);
677 
678  return (0);
679 }
680 
681 int TileTBID::fill_vec (std::set<Identifier> & ids,
682  unsigned int hash_max, std::vector<Identifier> & vec)
683 {
684 
685  if(ids.size() != hash_max) {
686 
687  MsgStream log(m_msgSvc, "TileTBID" );
688  log << MSG::ERROR << "fill_vec "
689  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
690  << " hash max " << hash_max
691  << endmsg;
692 
693  return (1);
694  }
695 
696  vec.resize(hash_max);
697 
698  std::set<Identifier>::const_iterator first = ids.begin();
699  std::set<Identifier>::const_iterator last = ids.end();
700 
701  int index = 0;
702  for (;first != last; ++first) {
703  vec[index++] = (*first);
704  }
705 
706  return (0);
707 }
708 
712 
TileTBID::m_module_vec
std::vector< Identifier > m_module_vec
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:301
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictDictionary.cxx:92
ConstRangeIterator
Definition: RangeIterator.h:46
TileTBID::channel_id
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
Definition: TileTBID.cxx:195
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:291
TileTBID::m_SECTION_INDEX
size_type m_SECTION_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:281
TileTBID::to_string
std::string to_string(const Identifier &id, int level=0) const
extract all fields from TileTB identifier Identifier get_all_fields ( const Identifier & id,...
Definition: TileTBID.cxx:47
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:250
TileTBID::initLevelsFromDict
int initLevelsFromDict()
Definition: TileTBID.cxx:499
get_generator_info.result
result
Definition: get_generator_info.py:21
TileTBID::module_id
Identifier module_id(int type, int module) const
identifer for one module of a Tile testbeam detector
Definition: TileTBID.cxx:161
TileTBID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
Definition: TileTBID.cxx:397
TileTBID::type_context
IdContext type_context() const
access to IdContext's which define which levels of fields are contained in the id
Definition: TileTBID.cxx:299
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileTBID::TILE_TESTBEAM
@ TILE_TESTBEAM
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:82
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:85
TileTBID::type_id
Identifier type_id(int type) const
identifer for Tile testbeam detectors of a give type
Definition: TileTBID.cxx:130
TileTBID::channel_context
IdContext channel_context() const
idContext for channels
Definition: TileTBID.cxx:313
TileTBID::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:283
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
index
Definition: index.py:1
IdDictDictionary::region
const IdDictRegion & region(size_t i) const
Region at index i.
Definition: IdDictDictionary.h:341
TileTBID::tiletb_id
Identifier tiletb_id() const
identifer for all Tile testbeam detectors
Definition: TileTBID.cxx:97
TileTBID::m_system_impl
IdDictFieldImplementation m_system_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:288
TileTBID::m_section_impl
IdDictFieldImplementation m_section_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:289
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TileTBID::m_channel_impl
IdDictFieldImplementation m_channel_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:292
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
TileTBID::m_type_hash_max
size_type m_type_hash_max
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:297
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:173
TileTBID::module_context
IdContext module_context() const
idContext for modules
Definition: TileTBID.cxx:306
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:369
TileTBID::m_dict
const IdDictDictionary * m_dict
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:286
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
TileTBID::fill_vec
int fill_vec(std::set< Identifier > &ids, unsigned int hash_max, std::vector< Identifier > &vec)
Definition: TileTBID.cxx:681
AtlasDetectorID::m_do_checks
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
Definition: AtlasDetectorID.h:363
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
IdDictDictionary::name
const std::string & name() const
Dictionary name.
Definition: IdDictDictionary.h:323
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
IdDictDictionary::pack32
int pack32(const ExpandedIdentifier &id, size_t index1, size_t index2, Identifier &packedId) const
Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic,...
Definition: IdDictDictionary.cxx:449
AtlasDetectorID::tile_exp
ExpandedIdentifier tile_exp(void) const
Definition: AtlasDetectorID.h:494
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:36
TileTBID::get_expanded_id
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
Definition: TileTBID.cxx:478
IdDictRegion
Definition: IdDictRegion.h:20
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TileTBID::get_field
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
Definition: TileTBID.cxx:71
TileTBID::m_TYPE_INDEX
size_type m_TYPE_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:282
IdDictFieldImplementation::reset
void reset(Identifier &id) const
Definition: IdDictFieldImplementation.h:183
IdDictDefs.h
python.PyAthena.module
module
Definition: PyAthena.py:131
IdDictRegion::implementation
const IdDictFieldImplementation & implementation(size_t i) const
Definition: IdDictRegion.cxx:17
IdDictMgr
Definition: IdDictMgr.h:14
TileTBID.h
IdContext::begin_index
size_type begin_index() const
Definition: IdContext.h:45
StrFormat.h
Provide helper functions to create formatted strings.
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
TileTBID::~TileTBID
virtual ~TileTBID()
Default destructor.
TileTBID::m_full_module_range
MultiRange m_full_module_range
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:295
TileTBID::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:284
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileTBID::m_channel_hash_max
size_type m_channel_hash_max
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:299
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TileTBID::section
int section(const Identifier &id) const
extract section field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:142
createCoolChannelIdFile.channel_id
channel_id
Definition: createCoolChannelIdFile.py:51
TileTBID::m_base_tile_type
Identifier m_base_tile_type
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:304
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
TileTBID::size_type
Identifier::size_type size_type
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:69
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
AtlasDetectorID::group
const std::string & group() const
Group name for this helper.
Definition: AtlasDetectorID.cxx:27
ConstRangeIterator::begin
ConstRangeIterator begin() const
Definition: RangeIterator.cxx:18
TileTBID::m_full_channel_range
MultiRange m_full_channel_range
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:296
AtlasDetectorID::m_quiet
bool m_quiet
If true, suppress DEBUG/INFO messages.
Definition: AtlasDetectorID.h:372
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
AtlasDetectorID::register_dict_tag
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
Definition: AtlasDetectorID.cxx:196
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:64
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:669
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
TileTBID::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: TileTBID.cxx:319
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
IdentifierHash.h
RangeIterator.h
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
TileTBID::m_tile_region_index
size_type m_tile_region_index
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:279
IdDictDictionary
Definition: IdDictDictionary.h:30
TileTBID::m_type_impl
IdDictFieldImplementation m_type_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:290
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
TileTBID::m_SYSTEM_INDEX
size_type m_SYSTEM_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:280
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:216
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:360
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
TileTBID::m_full_type_range
MultiRange m_full_type_range
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:294
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TileTBID::TileTBID
TileTBID()
Default constructor.
Definition: TileTBID.cxx:26
TileTBID::m_module_hash_max
size_type m_module_hash_max
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:298
TileTBID::init_hashes
int init_hashes()
Definition: TileTBID.cxx:602
ConstRangeIterator::end
ConstRangeIterator end() const
Definition: RangeIterator.cxx:32
IdDictField
Definition: IdDictField.h:15
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: MultiRange.cxx:82
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
TileTBID::m_channel_vec
std::vector< Identifier > m_channel_vec
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:302
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:471
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
TileTBID::m_type_vec
std::vector< Identifier > m_type_vec
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:300
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:52
TileTBID::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: TileTBID.cxx:363
TileTBID::m_module_impl
IdDictFieldImplementation m_module_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:291
Identifier
Definition: IdentifierFieldParser.cxx:14