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