|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef INDETIDENTIFIER_TRT_ID_H
6 #define INDETIDENTIFIER_TRT_ID_H
22 #include "Identifier/Identifier.h"
363 typedef std::pair<unsigned int, unsigned int>
intPair;
450 int layer_or_wheel)
const {
503 int straw_layer)
const {
534 int straw_layer)
const {
772 if (!m_is_valid) invalidMessage();
775 unsigned int hcIndex = 0;
776 int be = barrel_ec(straw_id);
777 int lw = layer_or_wheel(straw_id);
778 int sl = straw_layer(straw_id);
780 if (is_barrel(straw_id)) {
781 unsigned int index =
lw * 32 + sl;
782 if (
index < m_hash_calcs_barrel_indexes.size()) {
783 hcIndex = (
be < 0) ? m_hash_calcs_barrel_indexes[
index].
first :
786 std::cout <<
"straw_hash: index > barrel_index size - " <<
index
787 <<
" " << m_hash_calcs_barrel_indexes.size() << std::endl;
791 if (
index < m_hash_calcs_endcap_indexes.size()) {
792 hcIndex = (
be < 0) ? m_hash_calcs_endcap_indexes[
index].
first :
795 std::cout <<
"straw_hash: index > endcap_index size - " <<
index
796 <<
" " << m_hash_calcs_endcap_indexes.size() << std::endl;
803 if (hcIndex < m_hash_calcs.size()) {
804 const HashCalc& hc = m_hash_calcs[hcIndex];
814 std::cout <<
"straw_hash: hc index > hcCalc size - " << hcIndex
815 <<
" " << m_hash_calcs.size() << std::endl;
847 log << MSG::ERROR <<
" TRT_ID is NOT valid for this layout. " <<
endmsg;
848 log << MSG::ERROR <<
" Please use 'trt_id->is_valid()' if a layout test is needed. " <<
endmsg;
850 std::cout <<
" ERROR TRT_ID is NOT valid for this layout. " << std::endl;
851 std::cout <<
" ERROR Please use 'trt_id->is_valid()' if a layout test is needed. " << std::endl;
984 #endif // INDETIDENTIFIER_TRT_ID_H
IdDictFieldImplementation m_bec_impl
void test_trt_ids(void)
Tests of packing.
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
size_type m_LAYER_OR_WHEEL_INDEX
MultiRange m_full_straw_range
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
size_type m_trt_region_index
IdContext barrel_context(void) const
barrel_ec id
std::vector< HashCalc > m_hash_calcs
size_type m_PHI_MODULE_INDEX
void module_id_checks(int barrel_ec, int phi_module, int layer_or_wheel) const
int straw_max(const Identifier &id) const
hash_vec::const_iterator hash_vec_it
MultiRange m_full_straw_layer_range
size_type m_STRAW_LAYER_INDEX
void reset_straw_hash_vector(void)
int initLevelsFromDict(void)
IdDictFieldImplementation m_phi_mod_impl
IdentifierHash straw_hash(Identifier straw_id) const
straw hash from id - optimized
identifier_factory factory_begin()
IdContext module_context(void) const
module id
hash_vec m_straw_layer_vec
identifier_factory factory_end()
size_type straw_layer_hash_max(void) const
int get_straw_layer_hash_calc(const ExpandedIdentifier &id, IdentifierHash &hash_id) const
Special method for timing tests.
void barrel_ec_id_checks(int barrel_ec) const
size_type m_BARREL_EC_INDEX
IdDictFieldImplementation m_trt_impl
void pack(int value, Identifier &id) const
IMessageSvc * m_msgSvc
pointer to the message service
Identifier barrel_ec_id(int barrel_ec) const
For +/-barrel or +/-endcap id.
std::vector< Identifier >::const_iterator const_id_iterator
bool const RAWDATA *ch2 const
int trt_field_value() const
size_type m_straw_hash_max
int unpack(Identifier id) const
Identifier manipulation methods.
IdDictFieldImplementation m_str_lay_impl
const_id_iterator module_begin(void) const
Iterators over full set of module ids. Module ids are sorted.
const IdDictDictionary * m_dict
const_id_iterator straw_layer_end(void) const
void init_straw_hash_vector(void)
The init will use up ~2 MB of memory, so one should do init, use straw_id and then reset.
IdentifierHash module_hash(Identifier module_id) const
module hash from id - optimized
std::map< IdentifierHash, HashCalc > hashCalcMap
std::vector< intPair > m_hash_calcs_barrel_indexes
void reset(Identifier &id) const
Identifier::size_type size_type
bool match(element_type value) const
The basic match operation.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
const_id_iterator module_end(void) const
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)
int straw(const Identifier &id) const
size_type m_module_hash_max
size_type module_hash_max(void) const
IdContext straw_context(void) const
straw id
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)
IdentifierHash straw_hash_bin(Identifier straw_id) const
size_type m_straw_layer_hash_max
IdContext straw_layer_context(void) const
straw_layer id
void straw_id_checks(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Identifier::size_type size_type
IdDictFieldImplementation m_indet_impl
void get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context=0) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Set the IdDictionary.
int layer_or_wheel(const Identifier &id) const
std::pair< unsigned int, unsigned int > intPair
int straw_layer_max(const Identifier &id) const
Max values for each field (-999 == failure)
A MultiRange combines several Ranges.
std::vector< intPair > m_hash_calcs_endcap_indexes
const_expanded_id_iterator straw_end(void) const
int phi_module(const Identifier &id) const
MultiRange m_full_module_range
IdDictFieldImplementation m_straw_impl
bool is_barrel(const Identifier &id) const
Test for barrel.
size_type straw_hash_max(void) const
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
void layer_id_checks(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
IdDictFieldImplementation m_lay_wheel_impl
unsigned long long value_type
void invalidMessage() const
const_expanded_id_iterator straw_begin(void) const
For straw ids, only expanded id iterators are available.
const_id_iterator straw_layer_begin(void) const
Iterators over full set of straw_layer ids. Straw_layer ids are sorted.
Range::field m_barrel_field
unsigned long long size_type
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::vector< Identifier > hash_vec
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
macros to associate a CLID to a type
MultiRange::const_identifier_factory const_expanded_id_iterator
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
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: