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