ATLAS Offline Software
Loading...
Searching...
No Matches
Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.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/***************************************************************************
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
22
64
65class TileTBID : public AtlasDetectorID {
66
67public:
68
69 typedef Identifier::size_type size_type ;
70
74 TileTBID();
75
79 virtual ~TileTBID();
80
82 enum SECTION { TILE_TESTBEAM = 4 /*TileID::TESTBEAM*/ };
83 enum RO_TYPE { PROTO_TYPE = 2,
87 INT_TYPE = 6 };
88 enum DET_NUM { S_COUNTER = 0, CIS_PAR = 0,
90 LASER = 2,
95
96
100 Identifier tiletb_id ( ) 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
157
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
177
181 std::string to_string ( const Identifier & id, int level=0 ) const;
182
184
188 IdContext type_context () const;
192 IdContext module_context () const;
196 IdContext channel_context () 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 () const { return m_type_hash_max; }
221 inline size_type module_hash_max () const { return m_module_hash_max; }
226
230 std::vector<Identifier>::const_iterator type_begin () const { return(m_type_vec.begin()); }
234 std::vector<Identifier>::const_iterator type_end () const { return(m_type_vec.end()); }
235
239 std::vector<Identifier>::const_iterator module_begin () const { return(m_module_vec.begin()); }
243 std::vector<Identifier>::const_iterator module_end () const { return(m_module_vec.end()); }
244
248 std::vector<Identifier>::const_iterator channel_begin () const { return(m_channel_vec.begin()); }
252 std::vector<Identifier>::const_iterator channel_end () const { return(m_channel_vec.end()); }
253
254 enum {NOT_VALID_HASH = 64000};
255
256private:
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();
270
271 int init_hashes();
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
309CLASS_DEF( TileTBID , 2903 , 1 )
310
311#endif // TILEIDENTIFIER_TILETBID_H
312
std::vector< size_t > vec
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
AtlasDetectorID(const std::string &name, const std::string &group)
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
int unpack(Identifier id) const
Identifier manipulation methods.
This is a "hash" representation of an Identifier.
A MultiRange combines several Ranges.
Definition MultiRange.h:17
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
virtual ~TileTBID()
Default destructor.
std::vector< Identifier >::const_iterator type_end() const
end iterator for TYPE Identifiers
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
Definition TileTBID.cxx:396
Identifier type_id(int type) const
identifer for Tile testbeam detectors of a give type
Definition TileTBID.cxx:132
int fill_vec(std::set< Identifier > &ids, unsigned int hash_max, std::vector< Identifier > &vec)
Definition TileTBID.cxx:653
int side(const Identifier &id) const
define synonyms for minimum bias scintillators
std::vector< Identifier >::const_iterator channel_begin() const
begin iterator for channel Identifiers
int initLevelsFromDict()
Definition TileTBID.cxx:487
int system(const Identifier &id) const
extract system field from TileTB identifier
IdContext channel_context() const
idContext for channels
Definition TileTBID.cxx:315
int phi(const Identifier &id) const
extract phi field from MBTS identifier
std::vector< Identifier >::const_iterator channel_end() const
begin iterator for channel Identifiers
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition TileTBID.cxx:87
std::vector< Identifier >::const_iterator module_end() const
end iterator for moulde Identifiers
std::vector< Identifier >::const_iterator type_begin() const
begin iterator for TYPE Identifiers
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
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:466
size_type type_hash_max() const
TYPE hash table max size.
Identifier module_id(int type, int module) const
identifer for one module of a Tile testbeam detector
Definition TileTBID.cxx:163
TileTBID()
Default constructor.
Definition TileTBID.cxx:28
int section(const Identifier &id) const
extract section field from TileTB identifier
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
size_type channel_hash_max() const
channel hash table max size
std::vector< Identifier >::const_iterator module_begin() const
begin iterator for moulde Identifiers
int init_hashes()
Definition TileTBID.cxx:579
int type(const Identifier &id) const
extract type field from TileTB identifier
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
Definition TileTBID.cxx:197
IdContext type_context() const
access to IdContext's which define which levels of fields are contained in the id
Definition TileTBID.cxx:301
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
Definition TileTBID.cxx:73
int channel(const Identifier &id) const
extract channel field from TileTB identifier
size_type module_hash_max() const
module hash table max size
int eta(const Identifier &id) const
extract eta field from MBTS identifier
IdContext module_context() const
idContext for modules
Definition TileTBID.cxx:308
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:362
Identifier tiletb_id() const
identifer for all Tile testbeam detectors
Definition TileTBID.cxx:99
Definition index.py:1