![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
24 m_lvl1_region_index(0)
26 , m_DETZSIDE_INDEX(999)
27 , m_SAMPLING_INDEX(999)
35 , m_region_hash_max(0)
71 std::stringstream strm;
90 strg =
" hash_id out of range "+strm.str();
97 std::cout << strg << std::endl;
109 strg =
" hash_id out of range "+strm.str();
116 std::cout << strg << std::endl;
128 strg =
" hash_id out of range "+strm.str();
135 std::cout << strg << std::endl;
180 std::string errorMessage =
181 "Error in CaloLVL1_ID::get_hash, invalid context ";
195 std::string strg =
"initialize_from_dictionary";
200 std::cout << strg << std::endl;
212 std::stringstream strm;
213 std::stringstream strm1;
214 std::stringstream strm2;
227 strg=
" initialize_from_dict - cannot access LVL1Calorimeter dictionary ";
233 std::cout << strg << std::endl;
247 strg=
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
254 std::cout << strg << std::endl;
259 int lvl1CaloValue = -1;
267 strg =
" Could not get value for label 'positive_lvl1_side' of field 'DetZside in dictionary"+strm.str();
274 std::cout << strg << std::endl;
285 reg_id.
add(caloValue);
286 reg_id.
add(lvl1CaloValue);
300 strg =
" CaloLVL1_ID::initialize_from_dict : ";
301 strg1 =
" tower range -> "+strm1.str();
302 strg2 =
" layer range -> "+strm2.str();
311 std::cout << strg << std::endl;
312 std::cout << strg1 << std::endl;
313 std::cout << strg2 << std::endl;
347 int size = (1 << bits);
385 strg =
"Min > "+strm.str();
386 strg1=
" "+strm1.str();
387 strg2=
" "+strm2.str();
396 std::cout << strg << std::endl;
397 std::cout << strg1 << std::endl;
398 std::cout << strg2 << std::endl;
416 strg =
" ***** Error tower ranges, id, hash, i = "+strm.str();
417 strg1=
" , "+strm1.str();
418 strg2=
" , "+strm2.str();
427 std::cout << strg << std::endl;
428 std::cout << strg1 << std::endl;
429 std::cout << strg2 << std::endl;
455 if (
range.match(expId)) {
481 if (
range.match(expId)) {
502 if (
range.match(expId)) {
523 if (
range.match(expId)) {
613 std::string errorMessage =
"CaloLVL1_ID::tower_id() result is not OK: ID, range = "
628 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId) result is not OK: ID= "
636 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId,field values) result is not OK: ID, range = "
649 std::string errorMessage =
"CaloLVL1_ID::region_id() result is not OK: ID, range = "
663 std::string errorMessage =
"CaloLVL1_ID::layer_id(field values) result is not OK: ID, range = "
677 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId, layer) result is not OK: ID= "
685 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId) result is not OK: ID, range = "
695 std::stringstream strm;
696 std::stringstream strm1;
697 std::stringstream strm2;
698 std::stringstream strm3;
699 std::stringstream strm4;
700 std::stringstream strm5;
701 std::stringstream strm6;
702 std::stringstream strm7;
713 strg=
"initLevelsFromDict - dictionary NOT initialized ";
719 std::cout << strg << std::endl;
742 strg =
"initLevelsFromDict - unable to find lvl1 region ";
748 std::cout << strg << std::endl;
760 strg=
"initLevelsFromDict - unable to find 'subdet' field ";
767 std::cout << strg << std::endl;
778 strg=
"initLevelsFromDict - unable to find 'DetZside' field ";
785 std::cout << strg << std::endl;
796 strg=
"initLevelsFromDict - unable to find 'LVL1sampling' field ";
802 std::cout << strg << std::endl;
814 strg=
"initLevelsFromDict - unable to find 'region' field ";
821 std::cout << strg << std::endl;
834 strg=
"initLevelsFromDict - unable to find 'eta' field ";
841 std::cout << strg << std::endl;
853 strg=
"initLevelsFromDict - unable to find 'phi' field ";
860 std::cout << strg << std::endl;
871 strg=
"initLevelsFromDict - unable to find 'layer' field ";
877 std::cout << strg << std::endl;
902 strg =
"decode index and bit fields for each level: ";
903 strg1=
"calo "+strm1.str();
904 strg2=
"detzside "+strm2.str();
905 strg3=
"samp "+strm3.str();
906 strg4=
"reg "+strm4.str();
907 strg5=
"eta "+strm5.str();
908 strg6=
"phi "+strm6.str();
909 strg7=
"layer "+strm7.str();
923 std::cout << strg << std::endl;
924 std::cout << strg1 << std::endl;
925 std::cout << strg2 << std::endl;
926 std::cout << strg3 << std::endl;
927 std::cout << strg4 << std::endl;
928 std::cout << strg5 << std::endl;
929 std::cout << strg6 << std::endl;
930 std::cout << strg7 << std::endl;
941 std::stringstream strm;
942 std::stringstream strm1;
943 std::stringstream strm2;
950 unsigned int nids = 0;
951 std::set<Identifier>
ids;
963 if(!(
ids.insert(tow_id)).second)
967 log << MSG::ERROR <<
" init_hashes "
968 <<
" duplicated id for TT id. nids= " << nids
969 <<
" compact Id " <<
endmsg;
973 std::cout <<
" CaloLVL1_ID::init_hashes "
974 <<
" Error: duplicated id for TT id. nids= " << nids
987 log << MSG::ERROR <<
" init_hashes "
988 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
994 std::cout <<
" CaloLVL1_ID::init_hashes "
995 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1003 std::set<Identifier>::const_iterator
first =
ids.begin();
1004 std::set<Identifier>::const_iterator last =
ids.end();
1029 if(!(
ids.insert(lay_id)).second)
1033 log << MSG::ERROR <<
" init_hashes "
1034 <<
" duplicated id for extended TT id. nids= " << nids
1039 std::cout <<
" CaloLVL1_ID::init_hashes "
1040 <<
" Error: duplicated id for extended TT id. nids= " << nids
1053 log << MSG::ERROR <<
" init_hashes "
1054 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1060 std::cout <<
" CaloLVL1_ID::init_hashes "
1061 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1091 if(!(
ids.insert(reg_id)).second)
1095 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1096 <<
" duplicated id for region id. nids= " << nids
1097 <<
" compact Id " <<
endmsg;
1101 std::cout <<
" LArEM_ID::init_hashes "
1102 <<
" Error: duplicated id for region id. nids= " << nids
1106 std::cout << std::endl;
1116 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1117 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1123 std::cout <<
" LArEM_ID::init_hashes "
1124 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1182 if (
get_hash(
id, hash_id,&tcontext))
1186 log << MSG::ERROR <<
" init_neighbors - unable to get hash, compact = " <<
endmsg;
1190 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get hash, compact = ";
1192 std::cout << std::endl;
1198 unsigned short index = hash_id;
1210 if (
get_hash(
id, hash_id,&tcontext))
1214 log << MSG::ERROR <<
" init_neighbors - unable to get previous phi hash, exp/compact " <<
endmsg;
1218 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1234 if (
get_hash(
id, hash_id,&tcontext))
1238 log << MSG::ERROR <<
" init_neighbors - unable to get next phi hash, exp/compact "<<
endmsg;
1242 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1257 if (
get_hash(
id, hash_id,&tcontext))
1261 log << MSG::ERROR <<
" init_neighbors - unable to get previous eta hash, exp/compact "<<
endmsg;
1265 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1281 if (
get_hash(
id, hash_id,&tcontext))
1285 log << MSG::ERROR <<
" init_neighbors - unable to get next eta hash, exp/compact ";
1289 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get next eta hash, exp/compact ";
IdDictRegion * find_region(const std::string ®ion_name) const
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
access to hashes for neighbours in eta – towers only (no extended) return == 0 for neighbours found
std::vector< unsigned short > m_next_phi_vec
MultiRange build_multirange() const
Get MultiRange for full dictionary.
IdContext tower_context(void) const
access to IdContext's which define which levels of fields are contained in the id
int layer_max(const Identifier regId) const
max value of phi index (-999 == failure)
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
Scalar phi() const
phi method
void layer_id_checks(int pos_neg_z, int sampling, int region, int eta, int phi, int layer) const
Exception class for Calo Identifiers.
std::vector< unsigned short > m_prev_eta_vec
std::string show_to_string(void) const
IdContext region_context(void) const
access to IdContext's which define which levels of fields are contained in the id
IdDictFieldImplementation m_sampling_impl
Scalar eta() const
pseudorapidity method
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
IdDictFieldImplementation m_phi_impl
int calo_field_value() const
IdDictFieldImplementation m_region_impl
void add(element_type value)
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
std::vector< Identifier > m_region_vec
int region(const Identifier id) const
return region according to :
const IdDictDictionary * m_dict
size_type end_index(void) const
IMessageSvc * m_msgSvc
pointer to the message service
IdDictFieldImplementation m_layer_impl
Identifier region_id(int pos_neg_z, int sampling, int region) const
build a region (of towers) identifier
int unpack(Identifier id) const
Identifier manipulation methods.
reg
globals -----------------------------------------------------------------—
IdContext layer_context(void) const
access to IdContext's which define which levels of fields are contained in the id
int layer(const Identifier id) const
return layer according to :
IdDictField * find_field(const std::string &name) const
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
access to hashes for neighbours in eta – towers only (no extended) return == 0 for neighbours found
MultiRange m_full_layer_range
bool get_next(element_type current, element_type &next) const
Identifier layer_id(int pos_neg_z, int sampling, int region, int eta, int phi, int layer) const
build a layer identifier
int phi(const Identifier id) const
return phi according to :
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< unsigned short > m_next_eta_vec
IdDictFieldImplementation m_eta_impl
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
std::vector< HashCalc > m_hash_calcs
small class holding the starting hash value, the min eta and the number of phi bins of each region
void set_bits(size_type bits, size_type bits_offset)
std::vector< unsigned short > m_prev_phi_vec
std::vector< Identifier > m_tower_vec
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
access to hashes for neighbours in phi – towers only (no extended) return == 0 for neighbours found
size_type bits_offset() const
std::vector< IdDictRegion * > m_regions
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)
size_type m_DETZSIDE_INDEX
bool m_quiet
If true, suppress DEBUG/INFO messages.
element_type get_minimum() const
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int get_label_value(const std::string &field, const std::string &label, int &value) const
size_type begin_index(void) const
IdDictFieldImplementation m_lvl1_impl
size_type m_SAMPLING_INDEX
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)
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
size_type m_region_hash_max
IdDictFieldImplementation m_pnz_reg_impl
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
access to hashes for neighbours in phi – towers only (no extended) return == 0 for neighbours found
IdentifierHash tower_hash_binary_search(Identifier towerId) const
create hash id from tower id – method NOT optimised, please use tower_hash() above
int eta(const Identifier id) const
return eta according to :
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
ExpandedIdentifier calo_exp(void) const
size_type m_lvl1_region_index
MultiRange m_full_region_range
void region_id_checks(int pos_neg_z, int sampling, int region) const
element_type get_maximum() const
int pos_neg_z(const Identifier id) const
return pos_neg_z according to :
int match(const ExpandedIdentifier &id) const
Match an identifier.
std::vector< Identifier > m_layer_vec
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
void tower_id_checks(int pos_neg_z, int sampling, int region, int eta, int phi) const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
int sampling(const Identifier id) const
return sampling according to :
IdDictFieldImplementation m_calo_impl
int initLevelsFromDict(void)
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
This is the individual specification for the range of one ExpandedIdentifier field.
size_type cardinality() const
Computes a possible cardinality from all ranges.
size_type m_layer_hash_max
MultiRange m_full_tower_range
Identifier tower_id(int pos_neg_z, int sampling, int region, int eta, int phi) const
build a tower identifier
size_type m_tower_hash_max
Identifier::size_type size_type