 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
26 , m_lvl1_region_index(0)
28 , m_DETZSIDE_INDEX(999)
29 , m_SAMPLING_INDEX(999)
37 , m_region_hash_max(0)
73 std::stringstream strm;
92 strg =
" hash_id out of range "+strm.str();
99 std::cout << strg << std::endl;
111 strg =
" hash_id out of range "+strm.str();
118 std::cout << strg << std::endl;
130 strg =
" hash_id out of range "+strm.str();
137 std::cout << strg << std::endl;
182 std::string errorMessage =
183 "Error in CaloLVL1_ID::get_hash, invalid context ";
197 std::string strg =
"initialize_from_dictionary";
202 std::cout << strg << std::endl;
214 std::stringstream strm;
215 std::stringstream strm1;
216 std::stringstream strm2;
229 strg=
" initialize_from_dict - cannot access LVL1Calorimeter dictionary ";
235 std::cout << strg << std::endl;
249 strg=
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
256 std::cout << strg << std::endl;
261 int lvl1CaloValue = -1;
269 strg =
" Could not get value for label 'positive_lvl1_side' of field 'DetZside in dictionary"+strm.str();
276 std::cout << strg << std::endl;
287 reg_id.
add(caloValue);
288 reg_id.
add(lvl1CaloValue);
302 strg =
" CaloLVL1_ID::initialize_from_dict : ";
303 strg1 =
" tower range -> "+strm1.str();
304 strg2 =
" layer range -> "+strm2.str();
313 std::cout << strg << std::endl;
314 std::cout << strg1 << std::endl;
315 std::cout << strg2 << std::endl;
349 int size = (1 << bits);
387 strg =
"Min > "+strm.str();
388 strg1=
" "+strm1.str();
389 strg2=
" "+strm2.str();
398 std::cout << strg << std::endl;
399 std::cout << strg1 << std::endl;
400 std::cout << strg2 << std::endl;
418 strg =
" ***** Error tower ranges, id, hash, i = "+strm.str();
419 strg1=
" , "+strm1.str();
420 strg2=
" , "+strm2.str();
429 std::cout << strg << std::endl;
430 std::cout << strg1 << std::endl;
431 std::cout << strg2 << std::endl;
457 if (
range.match(expId)) {
459 if (not eta_field.
empty()) {
483 if (
range.match(expId)) {
485 if (not eta_field.
empty()) {
504 if (
range.match(expId)) {
506 if (not phi_field.
empty()) {
525 if (
range.match(expId)) {
527 if (not lay_field.
empty()) {
615 std::string errorMessage =
"CaloLVL1_ID::tower_id() result is not OK: ID, range = "
630 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId) result is not OK: ID= "
638 std::string errorMessage =
"CaloLVL1_ID::tower_id(regionId,field values) result is not OK: ID, range = "
651 std::string errorMessage =
"CaloLVL1_ID::region_id() result is not OK: ID, range = "
665 std::string errorMessage =
"CaloLVL1_ID::layer_id(field values) result is not OK: ID, range = "
679 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId, layer) result is not OK: ID= "
687 std::string errorMessage =
"CaloLVL1_ID::layer_id(towerId) result is not OK: ID, range = "
697 std::stringstream strm;
698 std::stringstream strm1;
699 std::stringstream strm2;
700 std::stringstream strm3;
701 std::stringstream strm4;
702 std::stringstream strm5;
703 std::stringstream strm6;
704 std::stringstream strm7;
715 strg=
"initLevelsFromDict - dictionary NOT initialized ";
721 std::cout << strg << std::endl;
744 strg =
"initLevelsFromDict - unable to find lvl1 region ";
750 std::cout << strg << std::endl;
762 strg=
"initLevelsFromDict - unable to find 'subdet' field ";
769 std::cout << strg << std::endl;
780 strg=
"initLevelsFromDict - unable to find 'DetZside' field ";
787 std::cout << strg << std::endl;
798 strg=
"initLevelsFromDict - unable to find 'LVL1sampling' field ";
804 std::cout << strg << std::endl;
816 strg=
"initLevelsFromDict - unable to find 'region' field ";
823 std::cout << strg << std::endl;
836 strg=
"initLevelsFromDict - unable to find 'eta' field ";
843 std::cout << strg << std::endl;
855 strg=
"initLevelsFromDict - unable to find 'phi' field ";
862 std::cout << strg << std::endl;
873 strg=
"initLevelsFromDict - unable to find 'layer' field ";
879 std::cout << strg << std::endl;
904 strg =
"decode index and bit fields for each level: ";
905 strg1=
"calo "+strm1.str();
906 strg2=
"detzside "+strm2.str();
907 strg3=
"samp "+strm3.str();
908 strg4=
"reg "+strm4.str();
909 strg5=
"eta "+strm5.str();
910 strg6=
"phi "+strm6.str();
911 strg7=
"layer "+strm7.str();
925 std::cout << strg << std::endl;
926 std::cout << strg1 << std::endl;
927 std::cout << strg2 << std::endl;
928 std::cout << strg3 << std::endl;
929 std::cout << strg4 << std::endl;
930 std::cout << strg5 << std::endl;
931 std::cout << strg6 << std::endl;
932 std::cout << strg7 << std::endl;
943 std::stringstream strm;
944 std::stringstream strm1;
945 std::stringstream strm2;
952 unsigned int nids = 0;
953 std::set<Identifier>
ids;
958 auto last = rit.
end();
966 if(!(
ids.insert(tow_id)).second)
970 log << MSG::ERROR <<
" init_hashes "
971 <<
" duplicated id for TT id. nids= " << nids
972 <<
" compact Id " <<
endmsg;
976 std::cout <<
" CaloLVL1_ID::init_hashes "
977 <<
" Error: duplicated id for TT id. nids= " << nids
990 log << MSG::ERROR <<
" init_hashes "
991 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
997 std::cout <<
" CaloLVL1_ID::init_hashes "
998 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1006 std::set<Identifier>::const_iterator
first =
ids.begin();
1007 std::set<Identifier>::const_iterator last =
ids.end();
1023 auto last = rit.
end();
1033 if(!(
ids.insert(lay_id)).second)
1037 log << MSG::ERROR <<
" init_hashes "
1038 <<
" duplicated id for extended TT id. nids= " << nids
1043 std::cout <<
" CaloLVL1_ID::init_hashes "
1044 <<
" Error: duplicated id for extended TT id. nids= " << nids
1057 log << MSG::ERROR <<
" init_hashes "
1058 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1064 std::cout <<
" CaloLVL1_ID::init_hashes "
1065 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1090 auto last = rit.
end();
1096 if(!(
ids.insert(reg_id)).second)
1100 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1101 <<
" duplicated id for region id. nids= " << nids
1102 <<
" compact Id " <<
endmsg;
1106 std::cout <<
" LArEM_ID::init_hashes "
1107 <<
" Error: duplicated id for region id. nids= " << nids
1111 std::cout << std::endl;
1121 log << MSG::ERROR <<
" LArEM_ID::init_hashes "
1122 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1128 std::cout <<
" LArEM_ID::init_hashes "
1129 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1164 auto last = rit.
end();
1188 if (
get_hash(
id, hash_id,&tcontext))
1192 log << MSG::ERROR <<
" init_neighbors - unable to get hash, compact = " <<
endmsg;
1196 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get hash, compact = ";
1198 std::cout << std::endl;
1204 unsigned short index = hash_id;
1216 if (
get_hash(
id, hash_id,&tcontext))
1220 log << MSG::ERROR <<
" init_neighbors - unable to get previous phi hash, exp/compact " <<
endmsg;
1224 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1240 if (
get_hash(
id, hash_id,&tcontext))
1244 log << MSG::ERROR <<
" init_neighbors - unable to get next phi hash, exp/compact "<<
endmsg;
1248 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1263 if (
get_hash(
id, hash_id,&tcontext))
1267 log << MSG::ERROR <<
" init_neighbors - unable to get previous eta hash, exp/compact "<<
endmsg;
1271 std::cout <<
" CaloLVL1_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1287 if (
get_hash(
id, hash_id,&tcontext))
1291 log << MSG::ERROR <<
" init_neighbors - unable to get next eta hash, exp/compact ";
1295 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