ATLAS Offline Software
Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Tile Calorimeter detector description package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: TileTBID.h,v 1.1 2009-03-30 11:19:27 tsulaia Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 // TileTBID.h
14 //
15 // Atlas detector Identifier class for Tile Calorimeter
16 //
17 
18 #ifndef TILEIDENTIFIER_TILETBID_H
19 #define TILEIDENTIFIER_TILETBID_H
20 
21 #include "CaloIdentifier/TileID.h"
22 
65 class TileTBID : public AtlasDetectorID {
66 
67 public:
68 
70 
74  TileTBID(void);
75 
79  virtual ~TileTBID();
80 
82  enum SECTION { TILE_TESTBEAM = 4 /*TileID::TESTBEAM*/ };
83  enum RO_TYPE { PROTO_TYPE = 2,
84  ADC_TYPE = 3,
85  TDC_TYPE = 4,
86  FADC_TYPE = 5,
87  INT_TYPE = 6 };
88  enum DET_NUM { S_COUNTER = 0, CIS_PAR = 0,
90  LASER = 2,
91  BACK_WALL = 3,
92  SIDE_WALL = 4,
94  PHANTOM_CALO = 6 };
95 
96 
100  Identifier tiletb_id ( void ) const;
104  Identifier type_id ( int type) const;
105  Identifier type_id ( int type, bool checks ) const;
109  Identifier module_id ( int type, int module ) const;
110  Identifier module_id ( int type, int module, bool checks ) const;
114  Identifier channel_id ( int type, int module,
115  int channel ) const;
116  Identifier channel_id ( int type, int module,
117  int channel,
118  bool checks) const;
119 
123  Identifier module_id ( const Identifier& id ) const;
127  Identifier channel_id ( const Identifier& id,
128  int channel ) const;
129 
133  bool is_tiletb ( const Identifier& id ) const;
134 
138  inline int system ( const Identifier & id ) const { return m_system_impl.unpack(id); }
142  inline int section ( const Identifier & id ) const { return m_section_impl.unpack(id); }
146  inline int type ( const Identifier & id ) const { return m_type_impl.unpack(id); }
150  inline int module ( const Identifier & id ) const { return m_module_impl.unpack(id); }
154  inline int channel ( const Identifier & id ) const { return m_channel_impl.unpack(id); }
155 
161  inline int side ( const Identifier & id ) const { return type(id); }
165  inline int phi ( const Identifier & id ) const { return module(id); }
169  inline int eta ( const Identifier & id ) const { return channel(id); }
170 
171 
181  std::string to_string ( const Identifier & id, int level=0 ) const;
182 
188  IdContext type_context (void) const;
192  IdContext module_context (void) const;
196  IdContext channel_context (void) const;
197 
198 
202  virtual int get_id (const IdentifierHash& hash_id, Identifier& id, const IdContext* context = 0 ) const;
203 
207  virtual int get_hash (const Identifier& id, IdentifierHash& hash_id, const IdContext* context = 0 ) const;
208 
212  virtual int initialize_from_dictionary (const IdDictMgr& dict_mgr);
213 
217  inline size_type type_hash_max (void) const { return m_type_hash_max; }
221  inline size_type module_hash_max (void) const { return m_module_hash_max; }
225  inline size_type channel_hash_max(void) const { return m_channel_hash_max; }
226 
230  std::vector<Identifier>::const_iterator type_begin (void) const { return(m_type_vec.begin()); }
234  std::vector<Identifier>::const_iterator type_end (void) const { return(m_type_vec.end()); }
235 
239  std::vector<Identifier>::const_iterator module_begin (void) const { return(m_module_vec.begin()); }
243  std::vector<Identifier>::const_iterator module_end (void) const { return(m_module_vec.end()); }
244 
248  std::vector<Identifier>::const_iterator channel_begin (void) const { return(m_channel_vec.begin()); }
252  std::vector<Identifier>::const_iterator channel_end (void) const { return(m_channel_vec.end()); }
253 
254  enum {NOT_VALID_HASH = 64000};
255 
256 private:
257 
261  int get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const;
262 
266  int get_field ( const Identifier & id,
267  size_type index ) const;
268 
269  int initLevelsFromDict(void) ;
270 
271  int init_hashes(void) ;
272 
273  bool module_id (const Identifier& type_id, int module, Identifier& module_id );
274  bool channel_id (const Identifier& type_id, int module, int channel, Identifier& channel_id );
276  int fill_vec (std::set<Identifier> & ids,
277  unsigned int hash_max, std::vector<Identifier> & vec);
278 
285 
287 
293 
300  std::vector<Identifier> m_type_vec;
301  std::vector<Identifier> m_module_vec;
302  std::vector<Identifier> m_channel_vec;
303 
305 };
306 
307 //using the macro below we can assign an identifier (and a version)
308 //This is required and checked at compile time when you try to record/retrieve
309 CLASS_DEF( TileTBID , 2903 , 1 )
310 
311 #endif // TILEIDENTIFIER_TILETBID_H
312 
TileTBID::m_module_vec
std::vector< Identifier > m_module_vec
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:301
TileTBID::DET_NUM
DET_NUM
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:88
TileTBID::RO_TYPE
RO_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:83
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:197
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:49
TileTBID::module_id
Identifier module_id(int type, int module) const
identifer for one module of a Tile testbeam detector
Definition: TileTBID.cxx:163
TileTBID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
Definition: TileTBID.cxx:399
TileTBID::TILE_TESTBEAM
@ TILE_TESTBEAM
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:82
TileTBID::channel_begin
std::vector< Identifier >::const_iterator channel_begin(void) const
begin iterator for channel Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:248
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:87
TileTBID::type_id
Identifier type_id(int type) const
identifer for Tile testbeam detectors of a give type
Definition: TileTBID.cxx:132
TileTBID::TDC_TYPE
@ TDC_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:85
TileTBID::module_end
std::vector< Identifier >::const_iterator module_end(void) const
end iterator for moulde Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:243
TileTBID::TileTBID
TileTBID(void)
Default constructor.
Definition: TileTBID.cxx:28
TileTBID::INT_TYPE
@ INT_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:87
TileTBID::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:283
index
Definition: index.py:1
TileTBID::PROTO_TYPE
@ PROTO_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:83
TileTBID::module_hash_max
size_type module_hash_max(void) const
module hash table max size
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:221
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
TileTBID::SECTION
SECTION
Identifier numbering.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:82
TileTBID::m_channel_impl
IdDictFieldImplementation m_channel_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:292
TileTBID::type_begin
std::vector< Identifier >::const_iterator type_begin(void) const
begin iterator for TYPE Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:230
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
TileTBID::PHANTOM_CALO
@ PHANTOM_CALO
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:94
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:683
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
TileTBID::ADC_TYPE
@ ADC_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:84
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
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:480
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
TileID.h
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:73
TileTBID::m_TYPE_INDEX
size_type m_TYPE_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:282
TileTBID::S_COUNTER
@ S_COUNTER
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:88
IdDictMgr
Definition: IdDictMgr.h:14
TileTBID::LASER
@ LASER
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:90
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
TileTBID::PATTERN_UNIT
@ PATTERN_UNIT
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:89
TileTBID::channel_hash_max
size_type channel_hash_max(void) const
channel hash table max size
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:225
TileTBID::channel_context
IdContext channel_context(void) const
idContext for channels
Definition: TileTBID.cxx:315
TileTBID::m_channel_hash_max
size_type m_channel_hash_max
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:299
TileTBID::section
int section(const Identifier &id) const
extract section field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:142
TileTBID::module_begin
std::vector< Identifier >::const_iterator module_begin(void) const
begin iterator for moulde Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:239
TileTBID::m_base_tile_type
Identifier m_base_tile_type
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:304
TileTBID::type_end
std::vector< Identifier >::const_iterator type_end(void) const
end iterator for TYPE Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:234
TileTBID::size_type
Identifier::size_type size_type
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:69
TileTBID::channel_end
std::vector< Identifier >::const_iterator channel_end(void) const
begin iterator for channel Identifiers
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:252
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:301
TileTBID::initLevelsFromDict
int initLevelsFromDict(void)
Definition: TileTBID.cxx:501
TileTBID::FADC_TYPE
@ FADC_TYPE
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:86
TileTBID::m_full_channel_range
MultiRange m_full_channel_range
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:296
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
TileTBID::type_hash_max
size_type type_hash_max(void) const
TYPE hash table max size.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:217
TileTBID::system
int system(const Identifier &id) const
extract system field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:138
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
TileTBID::module_context
IdContext module_context(void) const
idContext for modules
Definition: TileTBID.cxx:308
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:321
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
TileTBID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:254
TileTBID::SIDE_WALL
@ SIDE_WALL
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:92
TileTBID::m_tile_region_index
size_type m_tile_region_index
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:279
IdDictDictionary
Definition: IdDictDictionary.h:30
TileTBID::CRACK_WALL
@ CRACK_WALL
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:93
TileTBID::BACK_WALL
@ BACK_WALL
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:91
TileTBID::m_type_impl
IdDictFieldImplementation m_type_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:290
TileTBID::m_SYSTEM_INDEX
size_type m_SYSTEM_INDEX
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:280
TileTBID::m_full_type_range
MultiRange m_full_type_range
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:294
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:64
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:604
TileTBID::phi
int phi(const Identifier &id) const
extract phi field from MBTS identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:165
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
Identifier::size_type
unsigned long long size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:29
TileTBID::eta
int eta(const Identifier &id) const
extract eta field from MBTS identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:169
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
TileTBID::CH_COUNTER
@ CH_COUNTER
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:89
TileTBID::m_channel_vec
std::vector< Identifier > m_channel_vec
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:302
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:57
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:365
TileTBID::tiletb_id
Identifier tiletb_id(void) const
identifer for all Tile testbeam detectors
Definition: TileTBID.cxx:99
TileTBID::m_module_impl
IdDictFieldImplementation m_module_impl
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:291
TileTBID::side
int side(const Identifier &id) const
define synonyms for minimum bias scintillators
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:161
TileTBID::CIS_PAR
@ CIS_PAR
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:88
Identifier
Definition: IdentifierFieldParser.cxx:14