|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
25 m_calodm_region_index(0)
27 , m_DETZSIDE_INDEX(999)
29 , m_SAMPLING_INDEX(999)
34 , m_lar_zone_hash_max(0)
35 , m_lar_region_hash_max(0)
36 , m_tile_zone_hash_max(0)
37 , m_tile_region_hash_max(0)
59 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
61 if (
range.match(expId)) {
63 if (not eta_field.
empty()) {
92 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
94 if (
range.match(expId)) {
96 if (not eta_field.
empty()) {
120 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
122 if (
range.match(expId)) {
124 if (not phi_field.
empty()) {
153 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
155 if (
range.match(expId)) {
157 if (not phi_field.
empty()) {
175 std::string strg =
"initialize_from_dictionary";
180 std::cout << strg << std::endl;
182 std::stringstream strm;
186 if(
m_msgSvc)
log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
203 log << MSG::ERROR <<
" initialize_from_dict - cannot access Calorimeter dictionary " <<
endmsg;
207 std::cout <<
" CaloDM_ID::initialize_from_dict - cannot access Calorimeter dictionary "
223 log << MSG::ERROR <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
228 std::cout <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
235 int lardmCaloValue = -1;
241 log << MSG::ERROR <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
246 std::cout <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
253 int tiledmCaloValue = -1;
259 log << MSG::ERROR <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
265 std::cout <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
280 reg_id.
add(caloValue);
281 reg_id.
add(lardmCaloValue);
288 reg_id2.
add(caloValue);
289 reg_id2.
add(tiledmCaloValue);
306 std::cout <<
" CaloDM_ID::initialize_from_dict : "
348 int size = (1 << bits);
375 log << MSG::WARNING <<
" seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
379 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
393 log << MSG::WARNING <<
"min > " <<
size <<
" "
401 std::cout <<
"min > " <<
size <<
" "
417 log << MSG::ERROR <<
"lar zone ranges, id, hash, i = "
425 std::cout <<
" ***** Error ";
426 std::cout <<
"lar zone ranges, id, hash, i = "
447 log << MSG::WARNING <<
"seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
451 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
465 log << MSG::WARNING <<
"min > " <<
size <<
" "
473 std::cout <<
"min > " <<
size <<
" "
489 log << MSG::ERROR <<
"tile zone ranges, id, hash, i = "
497 std::cout <<
" ***** Error ";
498 std::cout <<
"tile zone ranges, id, hash, i = "
550 std::string errorMessage =
"CaloDM_ID::lar_region_id() result is not OK: ID, range = "
563 std::string errorMessage =
"CaloDM_ID::tile_region_id() result is not OK: ID, range = "
579 std::string errorMessage =
"CaloDM_ID::lar_zone_id() result is not OK: ID, range = "
593 std::string errorMessage =
"CaloDM_ID::tile_zone_id() result is not OK: ID, range = "
608 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID= "
617 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
623 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
638 std::stringstream strm;
642 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
647 std::cout <<
"CaloDM_ID::initLevelsFromDict - dictionary NOT initialized "
673 log << MSG::ERROR <<
"initLevelsFromDict - unable to find lardm region " <<
endmsg;
677 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find lardm region "
693 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
698 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'subdet' field "
713 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DetZside' field "
718 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DetZside' field "
733 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMvalue' field "
738 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMvalue' field "
754 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'samplingvalue' field "
759 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'samplingvalue' field "
774 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMregion' field " <<
endmsg;
778 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMregion' field "
794 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMEta' field "
799 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMEta' field "
814 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phivalue' field "
819 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'phivalue' field "
868 std::cout <<
"decode index and bit fields for each level: " << std::endl;
888 std::stringstream strm;
893 unsigned int nids = 0;
894 std::set<Identifier>
ids;
899 auto last = rit.
end();
908 if(!(
ids.insert(zon_id)).second)
912 log << MSG::ERROR <<
" init_lar_hashes "
913 <<
" duplicated id for lardm id. nids= " << nids
919 std::cout <<
" CaloDM_ID::init_lar_hashes "
920 <<
" Error: duplicated id for lardm id. nids= " << nids
923 std::cout << std::endl;
933 log << MSG::ERROR <<
" init_lar_hashes "
934 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
939 std::cout <<
" CaloDM_ID::init_lar_hashes "
940 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
948 std::set<Identifier>::const_iterator
first =
ids.begin();
949 std::set<Identifier>::const_iterator last =
ids.end();
964 auto last = rit.
end();
972 if(!(
ids.insert(reg_id)).second)
976 log << MSG::ERROR <<
" init_lar_hashes (regions) "
977 <<
" duplicated id for region id. nids= " << nids
983 std::cout <<
" CaloDM_ID::init_lar_hashes (regions) "
984 <<
" Error: duplicated id for region id. nids= " << nids
988 std::cout << std::endl;
998 log << MSG::ERROR <<
" init_lar_hashes "
999 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1004 std::cout <<
" CaloDM_ID::init_lar_hashes "
1005 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1031 std::stringstream strm;
1036 unsigned int nids = 0;
1037 std::set<Identifier>
ids;
1042 auto last = rit.
end();
1062 if(!(
ids.insert(zon_id)).second)
1066 log << MSG::ERROR <<
" init_tile_hashes "
1067 <<
" duplicated id for tiledm id. nids= " << nids
1073 std::cout <<
" CaloDM_ID::init_tile_hashes "
1074 <<
" Error: duplicated id for tiledm id. nids= " << nids
1077 std::cout << std::endl;
1087 log << MSG::ERROR <<
" init_tile_hashes "
1088 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1093 std::cout <<
" CaloDM_ID::init_tile_hashes "
1094 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1102 std::set<Identifier>::const_iterator
first =
ids.begin();
1103 std::set<Identifier>::const_iterator last =
ids.end();
1118 auto last = rit.
end();
1126 if(!(
ids.insert(reg_id)).second)
1130 log << MSG::ERROR <<
" init_tile_hashes (regions) "
1131 <<
" duplicated id for region id. nids= " << nids
1137 std::cout <<
" CaloDM_ID::init_tile_hashes (regions) "
1138 <<
" Error: duplicated id for region id. nids= " << nids
1142 std::cout << std::endl;
1152 log << MSG::ERROR <<
" init_tile_hashes "
1153 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1158 std::cout <<
" CaloDM_ID::init_tile_hashes "
1159 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
IdDictRegion * find_region(const std::string ®ion_name) const
int phi_min(const Identifier &id) const
min value of phi index (-999 == failure)
MultiRange build_multirange() const
Get MultiRange for full dictionary.
IdContext region_context(void) const
access to IdContext's which define which levels of fields are contained in a region id
int dmat(const Identifier &id) const
return DMtype according to :
size_type m_SAMPLING_INDEX
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
MultiRange m_full_tile_region_range
Scalar phi() const
phi method
Exception class for Calo Identifiers.
std::string show_to_string(void) const
Scalar eta() const
pseudorapidity method
void tile_region_id_checks(int pos_neg_z, int dmat, int sampling, int region) const
size_type m_DETZSIDE_INDEX
Identifier tile_region_id(IdentifierHash tile_region_hash_id) const
create a tile region id from hash id
element_type get_minimum() const
Query the values.
int region(const Identifier &id) const
return region according to :
size_type end_index() const
int calo_field_value() const
Identifier tile_zone_id(IdentifierHash tile_zone_hash_id) const
create a tile zone id from hash id
void add(element_type value)
Append a value into a new field.
int eta_min(const Identifier &id) const
min value of eta index (-999 == failure)
IdentifierHash lar_zone_hash_binary_search(Identifier zoneId) const
IMessageSvc * m_msgSvc
pointer to the message service
size_type m_lar_region_hash_max
const IdDictDictionary * m_dict
element_type get_maximum() const
std::vector< Identifier > m_tile_zone_vec
int unpack(Identifier id) const
Identifier manipulation methods.
std::vector< Identifier > m_lar_region_vec
IdDictField * find_field(const std::string &name) const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
void lar_region_id_checks(int pos_neg_z, int dmat, int sampling, int region) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
MultiRange m_full_tile_zone_range
void set_bits(size_type bits, size_type bits_offset)
IdDictFieldImplementation m_calo_impl
MultiRange m_full_lar_region_range
IdContext zone_context(void) const
access to IdContext's which define which levels of fields are contained in a zone id
int pos_neg_z(const Identifier &id) const
return pos_neg_z according to :
size_type bits_offset() const
std::vector< HashCalc > m_lar_hash_calcs
std::vector< IdDictRegion * > m_regions
IdDictFieldImplementation m_eta_impl
bool is_lar(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
ConstRangeIterator begin() const
IdentifierHash tile_zone_hash(Identifier TileZoneId) const
create a tile hash id from zone id
std::vector< Identifier > m_lar_zone_vec
small class holding the starting hash value, the min eta and the number of phi bins of each region
bool m_quiet
If true, suppress DEBUG/INFO messages.
IdDictFieldImplementation m_calodm_impl
size_type m_tile_region_hash_max
IdDictFieldImplementation m_phi_impl
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
IdDictFieldImplementation m_sampling_impl
size_type m_tile_zone_hash_max
int get_label_value(const std::string &field, const std::string &label, int &value) const
int eta_max(const Identifier &id) const
max value of eta index (-999 == failure)
Identifier region_id(int pos_neg_z, int dmat, int sampling, int region) const
build a region identifier valid for both LAr and Tiles
int init_lar_hashes(void)
A MultiRange combines several Ranges.
IdentifierHash tile_zone_hash_binary_search(Identifier zoneId) const
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
int sampling(const Identifier &id) const
return sampling according to :
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
ExpandedIdentifier calo_exp(void) const
int phi_max(const Identifier &id) const
max value of phi index (-999 == failure)
MultiRange m_full_lar_zone_range
int match(const ExpandedIdentifier &id) const
Match an identifier.
IdentifierHash lar_zone_hash(Identifier LArZoneId) const
create a lar hash id from zone id
int eta(const Identifier &id) const
return eta
size_type m_calodm_region_index
IdDictFieldImplementation m_region_impl
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
void tile_zone_id_checks(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
std::vector< HashCalc > m_tile_hash_calcs
IdDictFieldImplementation m_dmat_impl
Identifier lar_zone_id(IdentifierHash lar_zone_hash_id) const
create a lar zone id from hash id
int phi(const Identifier &id) const
return phi
void lar_zone_id_checks(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Identifier lar_region_id(IdentifierHash lar_region_hash_id) const
create a lar region id from hash id
void clear()
Erase all fields.
bool is_tile(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
size_type m_lar_zone_hash_max
int initLevelsFromDict(void)
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...
Identifier zone_id(int pos_neg_z, int dat, int sampling, int region, int eta, int phi) const
build a zone identifier valid for both LAr and Tiles
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
IdDictFieldImplementation m_pnz_reg_impl
std::vector< Identifier > m_tile_region_vec
void zone_id_checks(const Identifier ®ionId, int eta, int phi) const
int init_tile_hashes(void)
Identifier::size_type size_type