ATLAS Offline Software
TRT_ID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef INDETIDENTIFIER_TRT_ID_H
6 #define INDETIDENTIFIER_TRT_ID_H
7 
20 #include "Identifier/Identifier.h"
22 #include "Identifier/MultiRange.h"
23 #include "Identifier/IdHelper.h"
25 #include "AthenaKernel/CLASS_DEF.h"
26 
27 #include <algorithm>
28 #include <string>
29 #include <map>
30 #include <cassert>
31 
32 
33 class IdDictDictionary;
34 
82 {
83 public:
85 
87  typedef std::vector<Identifier>::const_iterator const_id_iterator;
90 
92 
93  TRT_ID();
96 
98 
99  bool is_valid() const;
101 
103 
104  Identifier barrel_ec_id(int barrel_ec) const;
106  Identifier barrel_ec_id(int barrel_ec, bool checks) const;
107 
110  int phi_module,
111  int layer_or_wheel) const;
113  int phi_module,
114  int layer_or_wheel,
115  bool checks) const;
116 
119 
122  int phi_module,
123  int layer_or_wheel,
124  int straw_layer) const;
126  int phi_module,
127  int layer_or_wheel,
128  int straw_layer,
129  bool checks) const;
130 
133 
136  int straw_layer) const;
138  int straw_layer,
139  bool checks) const;
140 
142  Identifier layer_id(const Identifier& straw_id) const;
143 
146  int phi_module,
147  int layer_or_wheel,
148  int straw_layer,
149  int straw) const;
151  int phi_module,
152  int layer_or_wheel,
153  int straw_layer,
154  int straw,
155  bool checks) const;
156 
158  int straw_layer,
159  int straw) const;
161  int straw_layer,
162  int straw,
163  bool checks) const;
164 
166  int straw) const;
168  int straw,
169  bool checks) const;
170 
175 
177 
178  void init_straw_hash_vector();
183 
185 
186  size_type module_hash_max() const;
188  size_type straw_hash_max() const;
190 
191 
193 
205 
207 
210 
212  IdentifierHash straw_layer_hash(Identifier straw_layer_id) const;
213 
216 
218  bool is_barrel(const Identifier& id) const;
219 
221  int barrel_ec(const Identifier& id) const;
222  int phi_module(const Identifier& id) const;
223  int layer_or_wheel(const Identifier& id) const;
224  int straw_layer(const Identifier& id) const;
225  int straw(const Identifier& id) const;
226 
228  int straw_layer_max(const Identifier& id) const;
229  int straw_max(const Identifier& id) const;
231 
232 
234 
235  IdContext barrel_context() const;
238  IdContext module_context() const;
242  IdContext straw_context() const;
244 
245 
247 
248  virtual int get_id(const IdentifierHash& hash_id,
250  Identifier& id,
251  const IdContext* context = 0) const override final;
252 
254  virtual int get_hash(const Identifier& id,
255  IdentifierHash& hash_id,
256  const IdContext* context = 0) const override final;
258 
260 
261 
265 
266 
267 
269  virtual int initialize_from_dictionary(const IdDictMgr& dict_mgr) override final;
270 
273  IdentifierHash& hash_id) const;
274 
275 
278  ExpandedIdentifier& exp_id,
279  const IdContext* context = 0) const;
280 
282  void test_trt_ids();
284 
285 
288  };
289 private:
290  typedef std::vector<Identifier> hash_vec;
291  typedef hash_vec::const_iterator hash_vec_it;
292 
293  enum VALUES {
294  BARREL_VALUE = 1
295  };
296 
297  void barrel_ec_id_checks(int barrel_ec) const;
298  void module_id_checks(int barrel_ec,
299  int phi_module,
300  int layer_or_wheel) const;
301  void straw_id_checks(int barrel_ec,
302  int phi_module,
303  int layer_or_wheel,
304  int straw_layer,
305  int straw) const;
306  void layer_id_checks(int barrel_ec,
307  int phi_module,
308  int layer_or_wheel,
309  int straw_layer) const;
310 
311  int initLevelsFromDict();
312 
313  void init_hashes();
314  // Private access only for hash from binary search - must have
315  // done init_straw_hashes for this to work
317 
318  // print out the invalid message
319  void invalidMessage() const;
320 
341 
342  class HashCalc
343  {
344  public:
346  m_hash(0),
347  m_deltaPhi(0),
348  m_layerMin(0),
349  m_strLayerMin(0),
350  m_nStrawLayers(0),
351  m_nstraws(0)
352  {}
359  };
360 
361  typedef std::pair<unsigned int, unsigned int> intPair;
362  typedef std::map<IdentifierHash, HashCalc> hashCalcMap;
363  std::vector<HashCalc> m_hash_calcs;
364  std::vector<intPair> m_hash_calcs_barrel_indexes;
365  std::vector<intPair> m_hash_calcs_endcap_indexes;
366 
374 };
375 
376 
377 
378 //using the macros below we can assign an identifier (and a version)
379 //This is required and checked at compile time when you try to record/retrieve
380 CLASS_DEF(TRT_ID, 2518, 1)
381 
382 
383 //----------------------------------------------------------------------------
384 inline bool
385 TRT_ID::is_valid() const {
386  return(m_is_valid);
387 }
388 
389 //----------------------------------------------------------------------------
390 inline Identifier
391 TRT_ID::barrel_ec_id(int barrel_ec, bool checks) const {
392  // Check if TRT_ID is valid for this layout
393  if (!m_is_valid) invalidMessage();
394 
395  // Build identifier
397 
398  // Pack fields independently
402 
403  if (checks) {
405  }
406 
407  return result;
408 }
409 
410 inline Identifier
411 TRT_ID::barrel_ec_id(int barrel_ec) const {
412  return barrel_ec_id(barrel_ec, do_checks());
413 }
414 
415 //----------------------------------------------------------------------------
416 inline Identifier
417 TRT_ID::module_id(int barrel_ec,
418  int phi_module,
419  int layer_or_wheel,
420  bool checks) const {
421  // Check if TRT_ID is valid for this layout
422  if (!m_is_valid) invalidMessage();
423 
424  // Build identifier
426 
427  // Pack fields independently
433 
434  if (checks) {
436  }
437 
438  return result;
439 }
440 
441 inline Identifier
442 TRT_ID::module_id(int barrel_ec,
443  int phi_module,
444  int layer_or_wheel) const {
446 }
447 
448 //----------------------------------------------------------------------------
449 inline Identifier
450 TRT_ID::module_id(IdentifierHash module_hash) const {
451  // Check if TRT_ID is valid for this layout
452  if (!m_is_valid) invalidMessage();
453 
454  return(m_module_vec[module_hash]);
455 }
456 
457 //----------------------------------------------------------------------------
458 inline Identifier TRT_ID::layer_id(IdentifierHash layer_hash) const {
459  // Check if TRT_ID is valid for this layout
460  if (!m_is_valid) invalidMessage();
461 
462  return(m_straw_layer_vec[layer_hash]);
463 }
464 
465 //----------------------------------------------------------------------------
466 inline Identifier
467 TRT_ID::layer_id(int barrel_ec,
468  int phi_module,
469  int layer_or_wheel,
470  int straw_layer,
471  bool checks) const {
472  // Check if TRT_ID is valid for this layout
473  if (!m_is_valid) invalidMessage();
474 
475  // Build identifier
477 
478  // Pack fields independently
485 
486  if (checks) {
488  }
489 
490  return result;
491 }
492 
493 inline Identifier
494 TRT_ID::layer_id(int barrel_ec,
495  int phi_module,
496  int layer_or_wheel,
497  int straw_layer) const {
499  do_checks());
500 }
501 
502 //----------------------------------------------------------------------------
503 inline Identifier
504 TRT_ID::layer_id(const Identifier& module_id,
505  int straw_layer,
506  bool checks) const {
507  // Check if TRT_ID is valid for this layout
508  if (!m_is_valid) invalidMessage();
509 
510  // Build identifier
512 
513  // Reset field and then pack it
516 
517  if (checks) {
521  straw_layer);
522  }
523  return result;
524 }
525 
526 inline Identifier
527 TRT_ID::layer_id(const Identifier& module_id,
528  int straw_layer) const {
530 }
531 
532 //----------------------------------------------------------------------------
533 inline Identifier
534 TRT_ID::layer_id(const Identifier& straw_id) const {
535  // Check if TRT_ID is valid for this layout
536  if (!m_is_valid) invalidMessage();
537 
539  // Reset the straw field
541  return(result);
542 }
543 
544 //----------------------------------------------------------------------------
545 inline Identifier
546 TRT_ID::straw_id(int barrel_ec,
547  int phi_module,
548  int layer_or_wheel,
549  int straw_layer,
550  int straw,
551  bool checks) const {
552  // Check if TRT_ID is valid for this layout
553  if (!m_is_valid) invalidMessage();
554 
555  // Build identifier
557 
558  // Pack fields independently
566 
567  if (checks) {
569  }
570 
571  return result;
572 }
573 
574 inline Identifier
575 TRT_ID::straw_id(int barrel_ec,
576  int phi_module,
577  int layer_or_wheel,
578  int straw_layer,
579  int straw) const {
581  do_checks());
582 }
583 
584 //----------------------------------------------------------------------------
585 inline Identifier
586 TRT_ID::straw_id(const Identifier& module_id,
587  int straw_layer,
588  int straw,
589  bool checks) const {
590  // Check if TRT_ID is valid for this layout
591  if (!m_is_valid) invalidMessage();
592 
593  // Build identifier
595 
596  // Reset fields and then pack them
601 
602  if (checks) {
606  straw_layer,
607  straw);
608  }
609  return result;
610 }
611 
612 inline Identifier
613 TRT_ID::straw_id(const Identifier& module_id,
614  int straw_layer,
615  int straw) const {
617 }
618 
619 //----------------------------------------------------------------------------
620 inline Identifier
621 TRT_ID::straw_id(const Identifier& layer_id,
622  int straw,
623  bool checks) const {
624  // Check if TRT_ID is valid for this layout
625  if (!m_is_valid) invalidMessage();
626 
627  // Build identifier
629 
630  // Reset field and then pack it
633 
634  if (checks) {
639  straw);
640  }
641  return result;
642 }
643 
644 inline Identifier
645 TRT_ID::straw_id(const Identifier& layer_id,
646  int straw) const {
647  return straw_id(layer_id, straw, do_checks());
648 }
649 
650 //----------------------------------------------------------------------------
651 inline Identifier
652 TRT_ID::straw_id(IdentifierHash straw_hash) const {
653  // Check if TRT_ID is valid for this layout
654  if (!m_is_valid) invalidMessage();
655 
656 
657  // Access id from vector ONLY if the vector has been initialized
658  // (done via init_straw_hash_vector();
659  // and reset by reset_straw_hash_vector();
660  if (straw_hash < m_straw_vec.size()) {
661  return(m_straw_vec[straw_hash]);
662  }
663  // Else return invalid id
665  return(result); // return hash in invalid state
666 }
667 
668 //----------------------------------------------------------------------------
670  // Check if TRT_ID is valid for this layout
671  if (!m_is_valid) invalidMessage();
672 
673  hash_vec_it it = std::lower_bound(m_module_vec.begin(),
674  m_module_vec.end(),
675  module_id);
676  // Require that module_id matches the one in vector
677  if (it != m_module_vec.end() && module_id == (*it)) {
678  return(it - m_module_vec.begin());
679  }
681  return(result); // return hash in invalid state
682 }
683 
684 //----------------------------------------------------------------------------
685 inline
687 TRT_ID::straw_layer_hash(Identifier straw_layer_id) const {
688  // Check if TRT_ID is valid for this layout
689  if (!m_is_valid) invalidMessage();
690 
691  hash_vec_it it = std::lower_bound(m_straw_layer_vec.begin(),
692  m_straw_layer_vec.end(),
693  straw_layer_id);
694  // Require that straw_layer_id matches the one in vector
695  if (it != m_straw_layer_vec.end() && straw_layer_id == (*it)) {
696  return(it - m_straw_layer_vec.begin());
697  }
699  return(result); // return hash in invalid state
700 }
701 
702 //----------------------------------------------------------------------------
703 inline
706 //TRT_ID::straw_hash (Identifier straw_id, bool debug) const
707 {
708  // Check if TRT_ID is valid for this layout
709  if (!m_is_valid) invalidMessage();
710 
711  // Get index into hashCalc vector
712  unsigned int hcIndex = 0;
713  int be = barrel_ec(straw_id);
714  int lw = layer_or_wheel(straw_id);
715  int sl = straw_layer(straw_id);
716 
717  if (is_barrel(straw_id)) {
718  unsigned int index = lw * 32 + sl;
719  if (index < m_hash_calcs_barrel_indexes.size()) {
720  hcIndex = (be < 0) ? m_hash_calcs_barrel_indexes[index].first :
721  m_hash_calcs_barrel_indexes[index].second;
722  } else {
723  std::cout << "straw_hash: index > barrel_index size - " << index
724  << " " << m_hash_calcs_barrel_indexes.size() << std::endl;
725  }
726  } else {
727  unsigned int index = lw;
728  if (index < m_hash_calcs_endcap_indexes.size()) {
729  hcIndex = (be < 0) ? m_hash_calcs_endcap_indexes[index].first :
730  m_hash_calcs_endcap_indexes[index].second;
731  } else {
732  std::cout << "straw_hash: index > endcap_index size - " << index
733  << " " << m_hash_calcs_endcap_indexes.size() << std::endl;
734  }
735  }
736 
737 
738 
740  if (hcIndex < m_hash_calcs.size()) {
741  const HashCalc& hc = m_hash_calcs[hcIndex];
742  result = hc.m_hash +
743  phi_module(straw_id) * hc.m_deltaPhi +
744  (lw - hc.m_layerMin) * hc.m_nStrawLayers +
745  (sl - hc.m_strLayerMin) * hc.m_nstraws +
746  straw(straw_id);
747 
748 
749  return(result);
750  } else {
751  std::cout << "straw_hash: hc index > hcCalc size - " << hcIndex
752  << " " << m_hash_calcs.size() << std::endl;
753  }
754  return(result);
755 }
756 
757 //----------------------------------------------------------------------------
758 inline
761  // Check if TRT_ID is valid for this layout
762  if (!m_is_valid) invalidMessage();
763 
764  hash_vec_it it = std::lower_bound(m_straw_vec.begin(),
765  m_straw_vec.end(),
766  straw_id);
767 
768 
769 
770  if (it != m_straw_vec.end()) {
771  return(it - m_straw_vec.begin());
772  }
774  return(result); // return hash in invalid state
775 }
776 
777 //----------------------------------------------------------------------------
778 inline
779 void
781  MsgStream log(m_msgSvc, "TRT_ID");
782 
783  if (m_msgSvc) {
784  log << MSG::ERROR << " TRT_ID is NOT valid for this layout. " << endmsg;
785  log << MSG::ERROR << " Please use 'trt_id->is_valid()' if a layout test is needed. " << endmsg;
786  } else {
787  std::cout << " ERROR TRT_ID is NOT valid for this layout. " << std::endl;
788  std::cout << " ERROR Please use 'trt_id->is_valid()' if a layout test is needed. " << std::endl;
789  }
790 }
791 
792 //----------------------------------------------------------------------------
793 inline bool
794 TRT_ID::is_barrel(const Identifier& id) const {
795  // Check if TRT_ID is valid for this layout
796  if (!m_is_valid) invalidMessage();
797 
798  return(m_barrel_field.match(m_bec_impl.unpack(id)));
799 }
800 
801 //----------------------------------------------------------------------------
802 inline int
803 TRT_ID::barrel_ec(const Identifier& id) const {
804  // Check if TRT_ID is valid for this layout
805  if (!m_is_valid) invalidMessage();
806 
807  return(m_bec_impl.unpack(id));
808 }
809 
810 //----------------------------------------------------------------------------
811 inline int
812 TRT_ID::phi_module(const Identifier& id) const {
813  // Check if TRT_ID is valid for this layout
814  if (!m_is_valid) invalidMessage();
815 
816  return(m_phi_mod_impl.unpack(id));
817 }
818 
819 //----------------------------------------------------------------------------
820 inline int
822  // Check if TRT_ID is valid for this layout
823  if (!m_is_valid) invalidMessage();
824 
825  return(m_lay_wheel_impl.unpack(id));
826 }
827 
828 //----------------------------------------------------------------------------
829 inline int
830 TRT_ID::straw_layer(const Identifier& id) const {
831  // Check if TRT_ID is valid for this layout
832  if (!m_is_valid) invalidMessage();
833 
834  return(m_str_lay_impl.unpack(id));
835 }
836 
837 //----------------------------------------------------------------------------
838 inline int
839 TRT_ID::straw(const Identifier& id) const {
840  // Check if TRT_ID is valid for this layout
841  if (!m_is_valid) invalidMessage();
842 
843  return(m_straw_impl.unpack(id));
844 }
845 
846 //----------------------------------------------------------------------------
847 inline TRT_ID::size_type
849  // Check if TRT_ID is valid for this layout
850  if (!m_is_valid) invalidMessage();
851 
852  return m_module_hash_max;
853 }
854 
855 //----------------------------------------------------------------------------
856 inline TRT_ID::size_type
858  // Check if TRT_ID is valid for this layout
859  if (!m_is_valid) invalidMessage();
860 
861  return m_straw_layer_hash_max;
862 }
863 
864 //----------------------------------------------------------------------------
865 inline TRT_ID::size_type
867  // Check if TRT_ID is valid for this layout
868  if (!m_is_valid) invalidMessage();
869 
870  return m_straw_hash_max;
871 }
872 
873 //----------------------------------------------------------------------------
875  // Check if TRT_ID is valid for this layout
876  if (!m_is_valid) invalidMessage();
877 
878  return(m_module_vec.begin());
879 }
880 
881 //----------------------------------------------------------------------------
883  // Check if TRT_ID is valid for this layout
884  if (!m_is_valid) invalidMessage();
885 
886  return(m_module_vec.end());
887 }
888 
889 //----------------------------------------------------------------------------
891  // Check if TRT_ID is valid for this layout
892  if (!m_is_valid) invalidMessage();
893 
894  return(m_straw_layer_vec.begin());
895 }
896 
897 //----------------------------------------------------------------------------
899  // Check if TRT_ID is valid for this layout
900  if (!m_is_valid) invalidMessage();
901 
902  return(m_straw_layer_vec.end());
903 }
904 
905 //----------------------------------------------------------------------------
907  // Check if TRT_ID is valid for this layout
908  if (!m_is_valid) invalidMessage();
909 
911 }
912 
913 //----------------------------------------------------------------------------
915  // Check if TRT_ID is valid for this layout
916  if (!m_is_valid) invalidMessage();
917 
919 }
920 
921 #endif // INDETIDENTIFIER_TRT_ID_H
TRT_ID::m_bec_impl
IdDictFieldImplementation m_bec_impl
Definition: TRT_ID.h:369
TRT_ID::m_is_valid
bool m_is_valid
Definition: TRT_ID.h:321
AtlasDetectorID::indet_field_value
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
Definition: AtlasDetectorID.h:480
TRT_ID::m_LAYER_OR_WHEEL_INDEX
size_type m_LAYER_OR_WHEEL_INDEX
Definition: TRT_ID.h:327
TRT_ID::m_full_straw_range
MultiRange m_full_straw_range
Definition: TRT_ID.h:331
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:494
TRT_ID::m_trt_region_index
size_type m_trt_region_index
Definition: TRT_ID.h:322
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
TRT_ID::m_hash_calcs
std::vector< HashCalc > m_hash_calcs
Definition: TRT_ID.h:363
TRT_ID::m_PHI_MODULE_INDEX
size_type m_PHI_MODULE_INDEX
Definition: TRT_ID.h:326
TRT_ID::module_id_checks
void module_id_checks(int barrel_ec, int phi_module, int layer_or_wheel) const
Definition: TRT_ID.cxx:69
get_generator_info.result
result
Definition: get_generator_info.py:21
TRT_ID::straw_max
int straw_max(const Identifier &id) const
Definition: TRT_ID.cxx:807
TRT_ID::hash_vec_it
hash_vec::const_iterator hash_vec_it
Definition: TRT_ID.h:291
TRT_ID::m_full_straw_layer_range
MultiRange m_full_straw_layer_range
Definition: TRT_ID.h:332
TRT_ID::init_straw_hash_vector
void init_straw_hash_vector()
The init will use up ~2 MB of memory, so one should do init, use straw_id and then reset.
Definition: TRT_ID.cxx:512
TRT_ID::init_hashes
void init_hashes()
Definition: TRT_ID.cxx:265
TRT_ID::m_STRAW_LAYER_INDEX
size_type m_STRAW_LAYER_INDEX
Definition: TRT_ID.h:328
TRT_ID::m_phi_mod_impl
IdDictFieldImplementation m_phi_mod_impl
Definition: TRT_ID.h:370
TRT_ID::straw_hash
IdentifierHash straw_hash(Identifier straw_id) const
straw hash from id - optimized
Definition: TRT_ID.h:705
MultiRange::factory_begin
identifier_factory factory_begin()
Definition: MultiRange.cxx:112
TRT_ID::BARREL_VALUE
@ BARREL_VALUE
Definition: TRT_ID.h:294
index
Definition: index.py:1
TRT_ID::m_straw_layer_vec
hash_vec m_straw_layer_vec
Definition: TRT_ID.h:339
TRT_ID::HashCalc::m_deltaPhi
size_type m_deltaPhi
Definition: TRT_ID.h:354
MultiRange::factory_end
identifier_factory factory_end()
Definition: MultiRange.cxx:124
python.LumiCalcWorking.lw
lw
Definition: LumiCalcWorking.py:111
TRT_ID::get_straw_layer_hash_calc
int get_straw_layer_hash_calc(const ExpandedIdentifier &id, IdentifierHash &hash_id) const
Special method for timing tests.
Definition: TRT_ID.cxx:695
TRT_ID::barrel_ec_id_checks
void barrel_ec_id_checks(int barrel_ec) const
Definition: TRT_ID.cxx:52
TRT_ID::straw_layer_end
const_id_iterator straw_layer_end() const
Definition: TRT_ID.h:898
TRT_ID::straw_layer_begin
const_id_iterator straw_layer_begin() const
Iterators over full set of straw_layer ids. Straw_layer ids are sorted.
Definition: TRT_ID.h:890
skel.it
it
Definition: skel.GENtoEVGEN.py:407
python.SystemOfUnits.second
float second
Definition: SystemOfUnits.py:135
TRT_ID::module_end
const_id_iterator module_end() const
Definition: TRT_ID.h:882
TRT_ID::m_BARREL_EC_INDEX
size_type m_BARREL_EC_INDEX
Definition: TRT_ID.h:325
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
TRT_ID::m_trt_impl
IdDictFieldImplementation m_trt_impl
Definition: TRT_ID.h:368
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:173
TRT_ID::is_valid
bool is_valid() const
Definition: TRT_ID.h:385
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:369
TRT_ID::VALUES
VALUES
Definition: TRT_ID.h:293
IdHelper.h
TRT_ID::barrel_ec_id
Identifier barrel_ec_id(int barrel_ec) const
For +/-barrel or +/-endcap id.
Definition: TRT_ID.h:411
TRT_ID::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: TRT_ID.h:87
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
AtlasDetectorID::trt_field_value
int trt_field_value() const
Definition: AtlasDetectorID.h:501
TRT_ID::m_TRT_INDEX
size_type m_TRT_INDEX
Definition: TRT_ID.h:324
TRT_ID::m_straw_hash_max
size_type m_straw_hash_max
Definition: TRT_ID.h:336
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
TRT_ID::m_str_lay_impl
IdDictFieldImplementation m_str_lay_impl
Definition: TRT_ID.h:372
TRT_ID::m_dict
const IdDictDictionary * m_dict
Definition: TRT_ID.h:330
TRT_ID::~TRT_ID
~TRT_ID()
TRT_ID::HashCalc::m_layerMin
size_type m_layerMin
Definition: TRT_ID.h:355
TRT_ID::module_hash
IdentifierHash module_hash(Identifier module_id) const
module hash from id - optimized
Definition: TRT_ID.h:669
TRT_ID::HashCalc::m_nStrawLayers
size_type m_nStrawLayers
Definition: TRT_ID.h:357
TRT_ID::hashCalcMap
std::map< IdentifierHash, HashCalc > hashCalcMap
Definition: TRT_ID.h:362
TRT_ID::m_hash_calcs_barrel_indexes
std::vector< intPair > m_hash_calcs_barrel_indexes
Definition: TRT_ID.h:364
TRT_ID::barrel_context
IdContext barrel_context() const
barrel_ec id
Definition: TRT_ID.cxx:979
IdDictFieldImplementation::reset
void reset(Identifier &id) const
Definition: IdDictFieldImplementation.h:183
AtlasDetectorID::size_type
Identifier::size_type size_type
Definition: AtlasDetectorID.h:385
TRT_ID::m_STRAW_INDEX
size_type m_STRAW_INDEX
Definition: TRT_ID.h:329
TRT_ID::HashCalc::m_nstraws
size_type m_nstraws
Definition: TRT_ID.h:358
IdentifierField::match
bool match(element_type value) const
The basic match operation Given a value, test to see if it satisfies the constraints for this field.
Definition: IdentifierField.cxx:71
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictMgr
Definition: IdDictMgr.h:15
TRT_ID::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override final
Create compact id from hash id (return == 0 for OK)
Definition: TRT_ID.cxx:703
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:839
TRT_ID::m_module_hash_max
size_type m_module_hash_max
Definition: TRT_ID.h:334
TRT_ID::NUMBER_OF_EC_MODULES
@ NUMBER_OF_EC_MODULES
Definition: TRT_ID.h:287
TRT_ID::get_hash
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override final
Create hash id from compact id (return == 0 for OK)
Definition: TRT_ID.cxx:752
TRT_ID::m_INDET_INDEX
size_type m_INDET_INDEX
Definition: TRT_ID.h:323
MultiRange::const_identifier_factory
Definition: MultiRange.h:52
TRT_ID::module_context
IdContext module_context() const
module id
Definition: TRT_ID.cxx:989
TRT_ID::straw_hash_bin
IdentifierHash straw_hash_bin(Identifier straw_id) const
Definition: TRT_ID.h:760
TRT_ID::m_straw_layer_hash_max
size_type m_straw_layer_hash_max
Definition: TRT_ID.h:335
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TRT_ID::straw_id_checks
void straw_id_checks(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Definition: TRT_ID.cxx:89
TRT_ID::TRT_ID
TRT_ID()
Definition: TRT_ID.cxx:29
TRT_ID::size_type
Identifier::size_type size_type
Definition: TRT_ID.h:86
TRT_ID::m_indet_impl
IdDictFieldImplementation m_indet_impl
Definition: TRT_ID.h:367
TRT_ID::m_straw_vec
hash_vec m_straw_vec
Definition: TRT_ID.h:340
TRT_ID::HashCalc
Definition: TRT_ID.h:343
TRT_ID::get_expanded_id
void get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context=0) const
Definition: TRT_ID.cxx:734
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:803
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:830
TRT_ID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Set the IdDictionary.
Definition: TRT_ID.cxx:134
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:821
columnar::final
CM final
Definition: ColumnAccessor.h:106
TRT_ID::intPair
std::pair< unsigned int, unsigned int > intPair
Definition: TRT_ID.h:361
TRT_ID::m_module_vec
hash_vec m_module_vec
Definition: TRT_ID.h:338
TRT_ID::module_hash_max
size_type module_hash_max() const
Definition: TRT_ID.h:848
TRT_ID::straw_layer_max
int straw_layer_max(const Identifier &id) const
Max values for each field (-999 == failure)
Definition: TRT_ID.cxx:786
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
TRT_ID::m_hash_calcs_endcap_indexes
std::vector< intPair > m_hash_calcs_endcap_indexes
Definition: TRT_ID.h:365
TRT_ID::straw_layer_context
IdContext straw_layer_context() const
straw_layer id
Definition: TRT_ID.cxx:999
IdentifierHash.h
TRT_ID::HashCalc::HashCalc
HashCalc()
Definition: TRT_ID.h:345
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:812
MultiRange.h
TRT_ID::test_trt_ids
void test_trt_ids()
Tests of packing.
Definition: TRT_ID.cxx:826
IdDictDictionary
Definition: IdDictDictionary.h:30
TRT_ID::straw_hash_max
size_type straw_hash_max() const
Definition: TRT_ID.h:866
IdDictFieldImplementation.h
TRT_ID::m_full_module_range
MultiRange m_full_module_range
Definition: TRT_ID.h:333
TRT_ID::straw_context
IdContext straw_context() const
straw id
Definition: TRT_ID.cxx:1009
TRT_ID::m_straw_impl
IdDictFieldImplementation m_straw_impl
Definition: TRT_ID.h:373
TRT_ID
Definition: TRT_ID.h:82
TRT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel.
Definition: TRT_ID.h:794
TRT_ID::initLevelsFromDict
int initLevelsFromDict()
Definition: TRT_ID.cxx:567
TRT_ID::MODULE_RANGE
MODULE_RANGE
Definition: TRT_ID.h:286
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
DeMoScan.first
bool first
Definition: DeMoScan.py:534
TRT_ID::layer_id_checks
void layer_id_checks(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
Definition: TRT_ID.cxx:111
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:83
TRT_ID::m_lay_wheel_impl
IdDictFieldImplementation m_lay_wheel_impl
Definition: TRT_ID.h:371
TRT_ID::HashCalc::m_hash
IdentifierHash m_hash
Definition: TRT_ID.h:353
TRT_ID::reset_straw_hash_vector
void reset_straw_hash_vector()
Definition: TRT_ID.cxx:507
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
TRT_ID::invalidMessage
void invalidMessage() const
Definition: TRT_ID.h:780
TRT_ID::m_barrel_field
Range::field m_barrel_field
Definition: TRT_ID.h:337
TRT_ID::module_begin
const_id_iterator module_begin() const
Iterators over full set of module ids. Module ids are sorted.
Definition: TRT_ID.h:874
Identifier::size_type
unsigned long long size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:29
IdDictFieldImplementation
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
Definition: IdDictFieldImplementation.h:58
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
TRT_ID::straw_layer_hash_max
size_type straw_layer_hash_max() const
Definition: TRT_ID.h:857
TRT_ID::hash_vec
std::vector< Identifier > hash_vec
Definition: TRT_ID.h:290
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:478
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
PlotCalibFromCool.be
be
Definition: PlotCalibFromCool.py:398
CLASS_DEF.h
macros to associate a CLID to a type
TRT_ID::const_expanded_id_iterator
MultiRange::const_identifier_factory const_expanded_id_iterator
Definition: TRT_ID.h:88
TRT_ID::straw_end
const_expanded_id_iterator straw_end() const
Definition: TRT_ID.h:914
TRT_ID::HashCalc::m_strLayerMin
size_type m_strLayerMin
Definition: TRT_ID.h:356
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:52
TRT_ID::straw_layer_hash
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
Definition: TRT_ID.h:687
TRT_ID::module_id
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Definition: TRT_ID.h:442
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:575
TRT_ID::straw_begin
const_expanded_id_iterator straw_begin() const
For straw ids, only expanded id iterators are available.
Definition: TRT_ID.h:906
Identifier
Definition: IdentifierFieldParser.cxx:14