 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
26 , m_calodm_region_index(0)
28 , m_DETZSIDE_INDEX(999)
30 , m_SAMPLING_INDEX(999)
35 , m_lar_zone_hash_max(0)
36 , m_lar_region_hash_max(0)
37 , m_tile_zone_hash_max(0)
38 , m_tile_region_hash_max(0)
60 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
62 if (
range.match(expId)) {
64 if (not eta_field.
empty()) {
93 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
95 if (
range.match(expId)) {
97 if (not eta_field.
empty()) {
121 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
123 if (
range.match(expId)) {
125 if (not phi_field.
empty()) {
154 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
156 if (
range.match(expId)) {
158 if (not phi_field.
empty()) {
176 std::string strg =
"initialize_from_dictionary";
181 std::cout << strg << std::endl;
183 std::stringstream strm;
204 log << MSG::ERROR <<
" initialize_from_dict - cannot access Calorimeter dictionary " <<
endmsg;
208 std::cout <<
" CaloDM_ID::initialize_from_dict - cannot access Calorimeter dictionary "
224 log << MSG::ERROR <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
229 std::cout <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
236 int lardmCaloValue = -1;
242 log << MSG::ERROR <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
247 std::cout <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
254 int tiledmCaloValue = -1;
260 log << MSG::ERROR <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
266 std::cout <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
281 reg_id.
add(caloValue);
282 reg_id.
add(lardmCaloValue);
289 reg_id2.
add(caloValue);
290 reg_id2.
add(tiledmCaloValue);
307 std::cout <<
" CaloDM_ID::initialize_from_dict : "
349 int size = (1 << bits);
376 log << MSG::WARNING <<
" seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
380 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
394 log << MSG::WARNING <<
"min > " <<
size <<
" "
402 std::cout <<
"min > " <<
size <<
" "
418 log << MSG::ERROR <<
"lar zone ranges, id, hash, i = "
426 std::cout <<
" ***** Error ";
427 std::cout <<
"lar zone ranges, id, hash, i = "
448 log << MSG::WARNING <<
"seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
452 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
466 log << MSG::WARNING <<
"min > " <<
size <<
" "
474 std::cout <<
"min > " <<
size <<
" "
490 log << MSG::ERROR <<
"tile zone ranges, id, hash, i = "
498 std::cout <<
" ***** Error ";
499 std::cout <<
"tile zone ranges, id, hash, i = "
551 std::string errorMessage =
"CaloDM_ID::lar_region_id() result is not OK: ID, range = "
564 std::string errorMessage =
"CaloDM_ID::tile_region_id() result is not OK: ID, range = "
580 std::string errorMessage =
"CaloDM_ID::lar_zone_id() result is not OK: ID, range = "
594 std::string errorMessage =
"CaloDM_ID::tile_zone_id() result is not OK: ID, range = "
609 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID= "
618 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
624 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
639 std::stringstream strm;
643 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
648 std::cout <<
"CaloDM_ID::initLevelsFromDict - dictionary NOT initialized "
674 log << MSG::ERROR <<
"initLevelsFromDict - unable to find lardm region " <<
endmsg;
678 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find lardm region "
694 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
699 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'subdet' field "
714 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DetZside' field "
719 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DetZside' field "
734 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMvalue' field "
739 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMvalue' field "
755 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'samplingvalue' field "
760 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'samplingvalue' field "
775 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMregion' field " <<
endmsg;
779 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMregion' field "
795 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMEta' field "
800 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMEta' field "
815 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phivalue' field "
820 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'phivalue' field "
869 std::cout <<
"decode index and bit fields for each level: " << std::endl;
889 std::stringstream strm;
894 unsigned int nids = 0;
895 std::set<Identifier>
ids;
900 auto last = rit.
end();
909 if(!(
ids.insert(zon_id)).second)
913 log << MSG::ERROR <<
" init_lar_hashes "
914 <<
" duplicated id for lardm id. nids= " << nids
920 std::cout <<
" CaloDM_ID::init_lar_hashes "
921 <<
" Error: duplicated id for lardm id. nids= " << nids
924 std::cout << std::endl;
934 log << MSG::ERROR <<
" init_lar_hashes "
935 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
940 std::cout <<
" CaloDM_ID::init_lar_hashes "
941 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
949 std::set<Identifier>::const_iterator
first =
ids.begin();
950 std::set<Identifier>::const_iterator last =
ids.end();
965 auto last = rit.
end();
973 if(!(
ids.insert(reg_id)).second)
977 log << MSG::ERROR <<
" init_lar_hashes (regions) "
978 <<
" duplicated id for region id. nids= " << nids
984 std::cout <<
" CaloDM_ID::init_lar_hashes (regions) "
985 <<
" Error: duplicated id for region id. nids= " << nids
989 std::cout << std::endl;
999 log << MSG::ERROR <<
" init_lar_hashes "
1000 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1005 std::cout <<
" CaloDM_ID::init_lar_hashes "
1006 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1032 std::stringstream strm;
1037 unsigned int nids = 0;
1038 std::set<Identifier>
ids;
1043 auto last = rit.
end();
1063 if(!(
ids.insert(zon_id)).second)
1067 log << MSG::ERROR <<
" init_tile_hashes "
1068 <<
" duplicated id for tiledm id. nids= " << nids
1074 std::cout <<
" CaloDM_ID::init_tile_hashes "
1075 <<
" Error: duplicated id for tiledm id. nids= " << nids
1078 std::cout << std::endl;
1088 log << MSG::ERROR <<
" init_tile_hashes "
1089 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1094 std::cout <<
" CaloDM_ID::init_tile_hashes "
1095 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1103 std::set<Identifier>::const_iterator
first =
ids.begin();
1104 std::set<Identifier>::const_iterator last =
ids.end();
1119 auto last = rit.
end();
1127 if(!(
ids.insert(reg_id)).second)
1131 log << MSG::ERROR <<
" init_tile_hashes (regions) "
1132 <<
" duplicated id for region id. nids= " << nids
1138 std::cout <<
" CaloDM_ID::init_tile_hashes (regions) "
1139 <<
" Error: duplicated id for region id. nids= " << nids
1143 std::cout << std::endl;
1153 log << MSG::ERROR <<
" init_tile_hashes "
1154 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1159 std::cout <<
" CaloDM_ID::init_tile_hashes "
1160 <<
" 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.
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
const IdDictRegion & region(size_t i) const
Region at index i.
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
const std::string & name() const
Dictionary name.
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
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
void set_bits(size_type bits, size_type bits_offset)
IdDictFieldImplementation m_calo_impl
MultiRange m_full_lar_region_range
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
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
IdContext region_context() const
access to IdContext's which define which levels of fields are contained in a region 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
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)
IdContext zone_context() const
access to IdContext's which define which levels of fields are contained in a zone id
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
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
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Identifier::size_type size_type