![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
23 m_jgtower_region_index(0)
25 , m_DETZSIDE_INDEX(999)
26 , m_SAMPLING_INDEX(999)
32 , m_calo_region_hash_max(0)
60 std::stringstream strm;
79 strg =
" hash_id out of range "+strm.str();
86 std::cout << strg << std::endl;
98 strg =
" hash_id out of range "+strm.str();
105 std::cout << strg << std::endl;
142 std::string errorMessage =
143 "Error in JGTowerBase_ID::get_hash, invalid context ";
156 int sc =
get_hash(regId, regHash, ®ionContext);
165 std::string strg =
"initialize_from_dictionary";
170 std::cout << strg << std::endl;
182 std::stringstream strm;
183 std::stringstream strm1;
184 std::stringstream strm2;
197 strg=
" initialize_from_dict - cannot access Calorimeter dictionary ";
203 std::cout << strg << std::endl;
216 strg=
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
223 std::cout << strg << std::endl;
228 int jgtowerCaloValue = -1;
236 strg =
" Could not get value for label positive_lvl1_side of field 'DetZside in dictionary"+strm.str();
243 std::cout << strg << std::endl;
254 reg_id.
add(caloValue);
255 reg_id.
add(jgtowerCaloValue);
270 strg =
" JGTowerBase_ID::initialize_from_dict : ";
271 strg1 =
" tower range -> "+strm1.str();
280 std::cout << strg << std::endl;
281 std::cout << strg1 << std::endl;
282 std::cout << strg2 << std::endl;
316 int size = (1 << bits);
354 strg =
"Min > "+strm.str();
355 strg1=
" "+strm1.str();
356 strg2=
" "+strm2.str();
365 std::cout << strg << std::endl;
366 std::cout << strg1 << std::endl;
367 std::cout << strg2 << std::endl;
385 strg =
" ***** Error tower ranges, id, hash, i = "+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;
424 if (
range.match(expId)) {
450 if (
range.match(expId)) {
471 if (
range.match(expId)) {
586 std::string errorMessage =
"JGTowerBase_ID::tower_id() result is not OK: ID, range = "
600 std::string errorMessage =
"JGTowerBase_ID::tower_id(regionId) result is not OK: ID= "
608 std::string errorMessage =
"JGTowerBase_ID::tower_id(regionId,field values) result is not OK: ID, range = "
621 std::string errorMessage =
"JGTowerBase_ID::region_id() result is not OK: ID, range = "
630 std::stringstream strm;
631 std::stringstream strm1;
632 std::stringstream strm2;
633 std::stringstream strm3;
634 std::stringstream strm4;
635 std::stringstream strm5;
636 std::stringstream strm6;
637 std::stringstream strm7;
648 strg=
"initLevelsFromDict - dictionary NOT initialized ";
654 std::cout << strg << std::endl;
676 strg =
"initLevelsFromDict - unable to find jgtower region ";
682 std::cout << strg << std::endl;
694 strg=
"initLevelsFromDict - unable to find 'subdet' field ";
701 std::cout << strg << std::endl;
712 strg=
"initLevelsFromDict - unable to find 'DetZside' field ";
719 std::cout << strg << std::endl;
731 strg=
"initLevelsFromDict - unable to find '"+t_pre+
"sampling' field ";
738 std::cout << strg << std::endl;
750 strg=
"initLevelsFromDict - unable to find 'region' field ";
757 std::cout << strg << std::endl;
770 strg=
"initLevelsFromDict - unable to find 'eta' field ";
777 std::cout << strg << std::endl;
789 strg=
"initLevelsFromDict - unable to find 'phi' field ";
796 std::cout << strg << std::endl;
817 strg =
"decode index and bit fields for each level: ";
818 strg1=
"calo "+strm1.str();
819 strg2=
"detzside "+strm2.str();
820 strg3=
"sampling "+strm3.str();
821 strg4=
"reg "+strm4.str();
822 strg5=
"eta "+strm5.str();
823 strg6=
"phi "+strm6.str();
836 std::cout << strg << std::endl;
837 std::cout << strg1 << std::endl;
838 std::cout << strg2 << std::endl;
839 std::cout << strg3 << std::endl;
840 std::cout << strg4 << std::endl;
841 std::cout << strg5 << std::endl;
842 std::cout << strg6 << std::endl;
852 std::stringstream strm;
853 std::stringstream strm1;
854 std::stringstream strm2;
861 unsigned int nids = 0;
862 std::set<Identifier>
ids;
874 if(!(
ids.insert(tow_id)).second)
878 log << MSG::ERROR <<
" init_hashes "
879 <<
" duplicated id for J/GTower id. nids= " << nids
880 <<
" compact Id " <<
endmsg;
884 std::cout <<
" JGTowerBase_ID::init_hashes "
885 <<
" Error: duplicated id for J/GTower id. nids= " << nids
898 log << MSG::ERROR <<
" init_hashes "
899 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
905 std::cout <<
" JGTowerBase_ID::init_hashes "
906 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
914 std::set<Identifier>::const_iterator
first =
ids.begin();
915 std::set<Identifier>::const_iterator last =
ids.end();
934 if(!(
ids.insert(reg_id)).second)
938 log << MSG::ERROR <<
" JGTowerBase_ID::init_hashes "
939 <<
" duplicated id for region id. nids= " << nids
940 <<
" compact Id " <<
endmsg;
944 std::cout <<
" JGTowerBase_ID::init_hashes "
945 <<
" Error: duplicated id for region id. nids= " << nids
949 std::cout << std::endl;
959 log << MSG::ERROR <<
" JGTowerBase_ID::init_hashes "
960 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
966 std::cout <<
" JGTowerBase_ID::init_hashes "
967 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1025 if (
get_hash(
id, hash_id,&tcontext))
1029 log << MSG::ERROR <<
" init_neighbors - unable to get hash, compact = " <<
endmsg;
1033 std::cout <<
" JGTowerBase_ID::init_neighbors - unable to get hash, compact = ";
1035 std::cout << std::endl;
1041 unsigned short index = hash_id;
1053 if (
get_hash(
id, hash_id,&tcontext))
1057 log << MSG::ERROR <<
" init_neighbors - unable to get previous phi hash, exp/compact " <<
endmsg;
1061 std::cout <<
" JGTowerBase_ID::init_neighbors - unable to get previous phi hash, exp/compact ";
1077 if (
get_hash(
id, hash_id,&tcontext))
1081 log << MSG::ERROR <<
" init_neighbors - unable to get next phi hash, exp/compact "<<
endmsg;
1085 std::cout <<
" JGTowerBase_ID::init_neighbors - unable to get next phi hash, exp/compact ";
1100 if (
get_hash(
id, hash_id,&tcontext))
1104 log << MSG::ERROR <<
" init_neighbors - unable to get previous eta hash, exp/compact "<<
endmsg;
1108 std::cout <<
" JGTowerBase_ID::init_neighbors - unable to get previous eta hash, exp/compact ";
1124 if (
get_hash(
id, hash_id,&tcontext))
1128 log << MSG::ERROR <<
" init_neighbors - unable to get next eta hash, exp/compact ";
1132 std::cout <<
" JGTowerBase_ID::init_neighbors - unable to get next eta hash, exp/compact ";
IdDictRegion * find_region(const std::string ®ion_name) const
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
std::vector< const IdDictRegion * > m_vecOfDictRegions
List of IdDictRegion objects.
int eta(const Identifier id) const
return eta according to :
MultiRange build_multirange() const
Get MultiRange for full dictionary.
int fill_vec_of_dict_regions(const std::string &group_name="")
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
float phi0(const Identifier regId) const
Return the minimum phi of region, or NOT_VALID.
Scalar phi() const
phi method
std::vector< unsigned short > m_prev_eta_vec
Exception class for Calo Identifiers.
std::string show_to_string(void) const
void tower_id_checks(int pos_neg, int sampling, int region, int eta, int phi) const
Scalar eta() const
pseudorapidity method
IdentifierHash calo_region_hash(const Identifier id) const
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
int phi(const Identifier id) const
return phi according to :
int calo_field_value() 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)
IdDictFieldImplementation m_sampling_impl
void add(element_type value)
IdContext tower_context(void) const
access to IdContext's which define which levels of fields are contained in the id
std::vector< unsigned short > m_next_eta_vec
int sampling(const Identifier id) const
return sampling according to :
int region(const Identifier id) const
return region according to :
size_type end_index(void) const
IMessageSvc * m_msgSvc
pointer to the message service
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
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
IdDictFieldImplementation m_region_impl
std::vector< Identifier > m_region_vec
IdDictFieldImplementation m_pnz_reg_impl
int unpack(Identifier id) const
Identifier manipulation methods.
reg
globals -----------------------------------------------------------------—
std::vector< unsigned short > m_prev_phi_vec
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
IdDictField * find_field(const std::string &name) const
MultiRange m_full_reg_range
size_type m_calo_region_hash_max
std::vector< HashCalc > m_hash_calcs
size_type m_SAMPLING_INDEX
size_type m_jgtower_region_index
bool get_next(element_type current, element_type &next) const
virtual int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &t_pre)
initialization from the identifier dictionary
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
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)
size_type bits_offset() const
std::vector< IdDictRegion * > m_regions
std::vector< Identifier > m_tower_vec
virtual ~JGTowerBase_ID()
std::vector< unsigned short > m_next_phi_vec
float eta0(const Identifier regId) const
Return the minimum eta of region, or NOT_VALID.
element_type get_minimum() const
const IdDictDictionary * m_dict
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
void region_id_checks(int pos_neg, int sampling, int region) const
int get_label_value(const std::string &field, const std::string &label, int &value) const
size_type begin_index(void) const
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Identifier region_id(int pos_neg, int sampling, int region) const
build a region (of towers) identifier
IdDictFieldImplementation m_jgtower_impl
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
ExpandedIdentifier calo_exp(void) const
size_type m_tower_hash_max
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)
IdContext region_context(void) const
access to IdContext's which define which levels of fields are contained in the id
size_type m_DETZSIDE_INDEX
Identifier tower_id(int pos_neg, int sampling, int region, int eta, int phi) const
build a tower identifier
element_type get_maximum() const
int match(const ExpandedIdentifier &id) const
Match an identifier.
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
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.
int pos_neg(const Identifier id) const
return pos_neg according to :
IdentifierHash tower_hash_binary_search(Identifier towerId) const
create hash id from tower id – method NOT optimised, please use tower_hash() above
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
int initLevelsFromDict(const std::string &t_pre)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
float phiGranularity(const Identifier regId) const
Return the phi granularity of a region, or NOT_VALID.
IdDictFieldImplementation m_phi_impl
This is the individual specification for the range of one ExpandedIdentifier field.
size_type cardinality() const
Computes a possible cardinality from all ranges.
MultiRange m_full_tower_range
IdDictFieldImplementation m_calo_impl
Factor out code common between JTower_ID and GTower_ID.
float etaGranularity(const Identifier regId) const
Return the eta granularity of a region, or NOT_VALID.
Identifier::size_type size_type
IdDictFieldImplementation m_eta_impl