 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/MsgStream.h"
29 , m_lvl1_region_index(0)
31 , m_DETZSIDE_INDEX(999)
32 , m_SAMPLING_INDEX(999)
40 , m_region_hash_max(0)
76 std::stringstream strm;
95 strg =
" hash_id out of range "+strm.str();
102 std::cout << strg << std::endl;
114 strg =
" hash_id out of range "+strm.str();
121 std::cout << strg << std::endl;
133 strg =
" hash_id out of range "+strm.str();
140 std::cout << strg << std::endl;
185 std::string errorMessage =
186 "Error in CaloLVL1_ID::get_hash, invalid context ";
200 std::string strg =
"initialize_from_dictionary";
205 std::cout << strg << std::endl;
217 std::stringstream strm;
218 std::stringstream strm1;
219 std::stringstream strm2;
232 strg=
" initialize_from_dict - cannot access LVL1Calorimeter dictionary ";
238 std::cout << strg << std::endl;
252 strg=
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
259 std::cout << strg << std::endl;
264 int lvl1CaloValue = -1;
272 strg =
" Could not get value for label 'positive_lvl1_side' of field 'DetZside in dictionary"+strm.str();
279 std::cout << strg << std::endl;
290 reg_id.
add(caloValue);
291 reg_id.
add(lvl1CaloValue);
305 strg =
" CaloLVL1_ID::initialize_from_dict : ";
306 strg1 =
" tower range -> "+strm1.str();
307 strg2 =
" layer range -> "+strm2.str();
316 std::cout << strg << std::endl;
317 std::cout << strg1 << std::endl;
318 std::cout << strg2 << std::endl;
352 int size = (1 << bits);
390 strg =
"Min > "+strm.str();
391 strg1=
" "+strm1.str();
392 strg2=
" "+strm2.str();
401 std::cout << strg << std::endl;
402 std::cout << strg1 << std::endl;
403 std::cout << strg2 << std::endl;
421 strg =
" ***** Error tower ranges, id, hash, i = "+strm.str();
422 strg1=
" , "+strm1.str();
423 strg2=
" , "+strm2.str();
432 std::cout << strg << std::endl;
433 std::cout << strg1 << std::endl;
434 std::cout << strg2 << std::endl;
460 if (
range.match(expId)) {
462 if (not eta_field.
empty()) {
486 if (
range.match(expId)) {
488 if (not eta_field.
empty()) {
507 if (
range.match(expId)) {
509 if (not phi_field.
empty()) {
528 if (
range.match(expId)) {
530 if (not lay_field.
empty()) {
618 std::string errorMessage =
"CaloLVL1_ID::tower_id() result is not OK: ID, range = "
633 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId) result is not OK: ID= "
641 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId,field values) result is not OK: ID, range = "
654 std::string errorMessage =
"CaloLVL1_ID::region_id() result is not OK: ID, range = "
668 std::string errorMessage =
"CaloLVL1_ID::layer_id(field values) result is not OK: ID, range = "
682 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId, layer) result is not OK: ID= "
690 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId) result is not OK: ID, range = "
700 std::stringstream strm;
701 std::stringstream strm1;
702 std::stringstream strm2;
703 std::stringstream strm3;
704 std::stringstream strm4;
705 std::stringstream strm5;
706 std::stringstream strm6;
707 std::stringstream strm7;
718 strg=
"initLevelsFromDict - dictionary NOT initialized ";
724 std::cout << strg << std::endl;
747 strg =
"initLevelsFromDict - unable to find lvl1 region ";
753 std::cout << strg << std::endl;
765 strg=
"initLevelsFromDict - unable to find 'subdet' field ";
772 std::cout << strg << std::endl;
783 strg=
"initLevelsFromDict - unable to find 'DetZside' field ";
790 std::cout << strg << std::endl;
801 strg=
"initLevelsFromDict - unable to find 'LVL1sampling' field ";
807 std::cout << strg << std::endl;
819 strg=
"initLevelsFromDict - unable to find 'region' field ";
826 std::cout << strg << std::endl;
839 strg=
"initLevelsFromDict - unable to find 'eta' field ";
846 std::cout << strg << std::endl;
858 strg=
"initLevelsFromDict - unable to find 'phi' field ";
865 std::cout << strg << std::endl;
876 strg=
"initLevelsFromDict - unable to find 'layer' field ";
882 std::cout << strg << std::endl;
907 strg =
"decode index and bit fields for each level: ";
908 strg1=
"calo "+strm1.str();
909 strg2=
"detzside "+strm2.str();
910 strg3=
"samp "+strm3.str();
911 strg4=
"reg "+strm4.str();
912 strg5=
"eta "+strm5.str();
913 strg6=
"phi "+strm6.str();
914 strg7=
"layer "+strm7.str();
928 std::cout << strg << std::endl;
929 std::cout << strg1 << std::endl;
930 std::cout << strg2 << std::endl;
931 std::cout << strg3 << std::endl;
932 std::cout << strg4 << std::endl;
933 std::cout << strg5 << std::endl;
934 std::cout << strg6 << std::endl;
935 std::cout << strg7 << std::endl;
946 std::stringstream strm;
947 std::stringstream strm1;
948 std::stringstream strm2;
955 unsigned int nids = 0;
956 std::set<Identifier>
ids;
961 auto last = rit.
end();
969 if(!(
ids.insert(tow_id)).second)
973 log << MSG::ERROR <<
" init_hashes "
974 <<
" duplicated id for TT id. nids= " << nids
975 <<
" compact Id " <<
endmsg;
979 std::cout <<
" CaloLVL1_ID::init_hashes "
980 <<
" Error: duplicated id for TT id. nids= " << nids
993 log << MSG::ERROR <<
" init_hashes "
994 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1000 std::cout <<
" CaloLVL1_ID::init_hashes "
1001 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1009 std::set<Identifier>::const_iterator
first =
ids.begin();
1010 std::set<Identifier>::const_iterator last =
ids.end();
1026 auto last = rit.
end();
1036 if(!(
ids.insert(lay_id)).second)
1040 log << MSG::ERROR <<
" init_hashes "
1041 <<
" duplicated id for extended TT id. nids= " << nids
1046 std::cout <<
" CaloLVL1_ID::init_hashes "
1047 <<
" Error: duplicated id for extended TT id. nids= " << nids
1060 log << MSG::ERROR <<
" init_hashes "
1061 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1067 std::cout <<
" CaloLVL1_ID::init_hashes "
1068 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1093 auto last = rit.
end();
1099 if(!(
ids.insert(reg_id)).second)
1103 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1104 <<
" duplicated id for region id. nids= " << nids
1105 <<
" compact Id " <<
endmsg;
1109 std::cout <<
" LArEM_ID::init_hashes "
1110 <<
" Error: duplicated id for region id. nids= " << nids
1114 std::cout << std::endl;
1124 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1125 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1131 std::cout <<
" LArEM_ID::init_hashes "
1132 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1167 auto last = rit.
end();
1191 if (
get_hash(
id, hash_id,&tcontext))
1195 log << MSG::ERROR <<
" init_neighbors - unable to get hash, compact = " <<
endmsg;
1199 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get hash, compact = ";
1201 std::cout << std::endl;
1207 unsigned short index = hash_id;
1219 if (
get_hash(
id, hash_id,&tcontext))
1223 log << MSG::ERROR <<
" init_neighbors - unable to get previous phi hash, exp/compact " <<
endmsg;
1227 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1243 if (
get_hash(
id, hash_id,&tcontext))
1247 log << MSG::ERROR <<
" init_neighbors - unable to get next phi hash, exp/compact "<<
endmsg;
1251 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1266 if (
get_hash(
id, hash_id,&tcontext))
1270 log << MSG::ERROR <<
" init_neighbors - unable to get previous eta hash, exp/compact "<<
endmsg;
1274 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1290 if (
get_hash(
id, hash_id,&tcontext))
1294 log << MSG::ERROR <<
" init_neighbors - unable to get next eta hash, exp/compact ";
1298 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.
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
IdContext layer_context() const
access to IdContext's which define which levels of fields are contained in the id
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
IdDictFieldImplementation m_sampling_impl
Scalar eta() const
pseudorapidity method
const IdDictRegion & region(size_t i) const
Region at index i.
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
const std::string & name() const
Dictionary name.
int unpack(Identifier id) const
Identifier manipulation methods.
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.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
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
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
const std::string & group() const
Group name for this helper.
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 :
IdContext tower_context() const
access to IdContext's which define which levels of fields are contained in the id
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.
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...
IdContext region_context() const
access to IdContext's which define which levels of fields are contained in the id
size_type m_tower_hash_max
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Identifier::size_type size_type