 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
25 m_lvl1_region_index(0)
27 , m_DETZSIDE_INDEX(999)
28 , m_SAMPLING_INDEX(999)
36 , m_region_hash_max(0)
72 std::stringstream strm;
91 strg =
" hash_id out of range "+strm.str();
98 std::cout << strg << std::endl;
110 strg =
" hash_id out of range "+strm.str();
117 std::cout << strg << std::endl;
129 strg =
" hash_id out of range "+strm.str();
136 std::cout << strg << std::endl;
181 std::string errorMessage =
182 "Error in CaloLVL1_ID::get_hash, invalid context ";
196 std::string strg =
"initialize_from_dictionary";
201 std::cout << strg << std::endl;
213 std::stringstream strm;
214 std::stringstream strm1;
215 std::stringstream strm2;
228 strg=
" initialize_from_dict - cannot access LVL1Calorimeter dictionary ";
234 std::cout << strg << std::endl;
248 strg=
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
255 std::cout << strg << std::endl;
260 int lvl1CaloValue = -1;
268 strg =
" Could not get value for label 'positive_lvl1_side' of field 'DetZside in dictionary"+strm.str();
275 std::cout << strg << std::endl;
286 reg_id.
add(caloValue);
287 reg_id.
add(lvl1CaloValue);
301 strg =
" CaloLVL1_ID::initialize_from_dict : ";
302 strg1 =
" tower range -> "+strm1.str();
303 strg2 =
" layer range -> "+strm2.str();
312 std::cout << strg << std::endl;
313 std::cout << strg1 << std::endl;
314 std::cout << strg2 << std::endl;
348 int size = (1 << bits);
386 strg =
"Min > "+strm.str();
387 strg1=
" "+strm1.str();
388 strg2=
" "+strm2.str();
397 std::cout << strg << std::endl;
398 std::cout << strg1 << std::endl;
399 std::cout << strg2 << std::endl;
417 strg =
" ***** Error tower ranges, id, hash, i = "+strm.str();
418 strg1=
" , "+strm1.str();
419 strg2=
" , "+strm2.str();
428 std::cout << strg << std::endl;
429 std::cout << strg1 << std::endl;
430 std::cout << strg2 << std::endl;
456 if (
range.match(expId)) {
458 if (not eta_field.
empty()) {
482 if (
range.match(expId)) {
484 if (not eta_field.
empty()) {
503 if (
range.match(expId)) {
505 if (not phi_field.
empty()) {
524 if (
range.match(expId)) {
526 if (not lay_field.
empty()) {
614 std::string errorMessage =
"CaloLVL1_ID::tower_id() result is not OK: ID, range = "
629 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId) result is not OK: ID= "
637 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId,field values) result is not OK: ID, range = "
650 std::string errorMessage =
"CaloLVL1_ID::region_id() result is not OK: ID, range = "
664 std::string errorMessage =
"CaloLVL1_ID::layer_id(field values) result is not OK: ID, range = "
678 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId, layer) result is not OK: ID= "
686 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId) result is not OK: ID, range = "
696 std::stringstream strm;
697 std::stringstream strm1;
698 std::stringstream strm2;
699 std::stringstream strm3;
700 std::stringstream strm4;
701 std::stringstream strm5;
702 std::stringstream strm6;
703 std::stringstream strm7;
714 strg=
"initLevelsFromDict - dictionary NOT initialized ";
720 std::cout << strg << std::endl;
743 strg =
"initLevelsFromDict - unable to find lvl1 region ";
749 std::cout << strg << std::endl;
761 strg=
"initLevelsFromDict - unable to find 'subdet' field ";
768 std::cout << strg << std::endl;
779 strg=
"initLevelsFromDict - unable to find 'DetZside' field ";
786 std::cout << strg << std::endl;
797 strg=
"initLevelsFromDict - unable to find 'LVL1sampling' field ";
803 std::cout << strg << std::endl;
815 strg=
"initLevelsFromDict - unable to find 'region' field ";
822 std::cout << strg << std::endl;
835 strg=
"initLevelsFromDict - unable to find 'eta' field ";
842 std::cout << strg << std::endl;
854 strg=
"initLevelsFromDict - unable to find 'phi' field ";
861 std::cout << strg << std::endl;
872 strg=
"initLevelsFromDict - unable to find 'layer' field ";
878 std::cout << strg << std::endl;
903 strg =
"decode index and bit fields for each level: ";
904 strg1=
"calo "+strm1.str();
905 strg2=
"detzside "+strm2.str();
906 strg3=
"samp "+strm3.str();
907 strg4=
"reg "+strm4.str();
908 strg5=
"eta "+strm5.str();
909 strg6=
"phi "+strm6.str();
910 strg7=
"layer "+strm7.str();
924 std::cout << strg << std::endl;
925 std::cout << strg1 << std::endl;
926 std::cout << strg2 << std::endl;
927 std::cout << strg3 << std::endl;
928 std::cout << strg4 << std::endl;
929 std::cout << strg5 << std::endl;
930 std::cout << strg6 << std::endl;
931 std::cout << strg7 << std::endl;
942 std::stringstream strm;
943 std::stringstream strm1;
944 std::stringstream strm2;
951 unsigned int nids = 0;
952 std::set<Identifier>
ids;
957 auto last = rit.
end();
965 if(!(
ids.insert(tow_id)).second)
969 log << MSG::ERROR <<
" init_hashes "
970 <<
" duplicated id for TT id. nids= " << nids
971 <<
" compact Id " <<
endmsg;
975 std::cout <<
" CaloLVL1_ID::init_hashes "
976 <<
" Error: duplicated id for TT id. nids= " << nids
989 log << MSG::ERROR <<
" init_hashes "
990 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
996 std::cout <<
" CaloLVL1_ID::init_hashes "
997 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1005 std::set<Identifier>::const_iterator
first =
ids.begin();
1006 std::set<Identifier>::const_iterator last =
ids.end();
1022 auto last = rit.
end();
1032 if(!(
ids.insert(lay_id)).second)
1036 log << MSG::ERROR <<
" init_hashes "
1037 <<
" duplicated id for extended TT id. nids= " << nids
1042 std::cout <<
" CaloLVL1_ID::init_hashes "
1043 <<
" Error: duplicated id for extended TT id. nids= " << nids
1056 log << MSG::ERROR <<
" init_hashes "
1057 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1063 std::cout <<
" CaloLVL1_ID::init_hashes "
1064 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1089 auto last = rit.
end();
1095 if(!(
ids.insert(reg_id)).second)
1099 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1100 <<
" duplicated id for region id. nids= " << nids
1101 <<
" compact Id " <<
endmsg;
1105 std::cout <<
" LArEM_ID::init_hashes "
1106 <<
" Error: duplicated id for region id. nids= " << nids
1110 std::cout << std::endl;
1120 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1121 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1127 std::cout <<
" LArEM_ID::init_hashes "
1128 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1163 auto last = rit.
end();
1187 if (
get_hash(
id, hash_id,&tcontext))
1191 log << MSG::ERROR <<
" init_neighbors - unable to get hash, compact = " <<
endmsg;
1195 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get hash, compact = ";
1197 std::cout << std::endl;
1203 unsigned short index = hash_id;
1215 if (
get_hash(
id, hash_id,&tcontext))
1219 log << MSG::ERROR <<
" init_neighbors - unable to get previous phi hash, exp/compact " <<
endmsg;
1223 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1239 if (
get_hash(
id, hash_id,&tcontext))
1243 log << MSG::ERROR <<
" init_neighbors - unable to get next phi hash, exp/compact "<<
endmsg;
1247 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1262 if (
get_hash(
id, hash_id,&tcontext))
1266 log << MSG::ERROR <<
" init_neighbors - unable to get previous eta hash, exp/compact "<<
endmsg;
1270 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1286 if (
get_hash(
id, hash_id,&tcontext))
1290 log << MSG::ERROR <<
" init_neighbors - unable to get next eta hash, exp/compact ";
1294 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
element_type get_minimum() const
Query the values.
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
IdDictFieldImplementation m_phi_impl
size_type end_index() const
int calo_field_value() const
IdDictFieldImplementation m_region_impl
void add(element_type value)
Append a value into a new field.
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 :
void show() const
Send to std::cout.
const IdDictDictionary * m_dict
IMessageSvc * m_msgSvc
pointer to the message service
element_type get_maximum() const
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.
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
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
size_type begin_index() const
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)
bool get_next(element_type current, element_type &next) const
ConstRangeIterator begin() const
size_type m_DETZSIDE_INDEX
bool m_quiet
If true, suppress DEBUG/INFO messages.
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
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
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.
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
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
int sampling(const Identifier id) const
return sampling according to :
IdDictFieldImplementation m_calo_impl
void clear()
Erase all fields.
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
int initLevelsFromDict(void)
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
ConstRangeIterator end() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
size_type m_tower_hash_max
Identifier::size_type size_type