 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/MsgStream.h"
29 , m_calodm_region_index(0)
31 , m_DETZSIDE_INDEX(999)
33 , m_SAMPLING_INDEX(999)
38 , m_lar_zone_hash_max(0)
39 , m_lar_region_hash_max(0)
40 , m_tile_zone_hash_max(0)
41 , m_tile_region_hash_max(0)
63 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
65 if (
range.match(expId)) {
67 if (not eta_field.
empty()) {
96 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
98 if (
range.match(expId)) {
100 if (not eta_field.
empty()) {
124 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
126 if (
range.match(expId)) {
128 if (not phi_field.
empty()) {
157 for (
unsigned int i = 0;
i < (*zoneRange).size(); ++
i) {
159 if (
range.match(expId)) {
161 if (not phi_field.
empty()) {
179 std::string strg =
"initialize_from_dictionary";
184 std::cout << strg << std::endl;
186 std::stringstream strm;
207 log << MSG::ERROR <<
" initialize_from_dict - cannot access Calorimeter dictionary " <<
endmsg;
211 std::cout <<
" CaloDM_ID::initialize_from_dict - cannot access Calorimeter dictionary "
227 log << MSG::ERROR <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
232 std::cout <<
"Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "
239 int lardmCaloValue = -1;
245 log << MSG::ERROR <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
250 std::cout <<
"Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary "
257 int tiledmCaloValue = -1;
263 log << MSG::ERROR <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
269 std::cout <<
"Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary "
284 reg_id.
add(caloValue);
285 reg_id.
add(lardmCaloValue);
292 reg_id2.
add(caloValue);
293 reg_id2.
add(tiledmCaloValue);
310 std::cout <<
" CaloDM_ID::initialize_from_dict : "
352 int size = (1 << bits);
379 log << MSG::WARNING <<
" seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
383 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
397 log << MSG::WARNING <<
"min > " <<
size <<
" "
405 std::cout <<
"min > " <<
size <<
" "
421 log << MSG::ERROR <<
"lar zone ranges, id, hash, i = "
429 std::cout <<
" ***** Error ";
430 std::cout <<
"lar zone ranges, id, hash, i = "
451 log << MSG::WARNING <<
"seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) <<
endmsg;
455 std::cout <<
"WARNING !!! seting etamin to 0 because actual value not found for regId " <<
show_to_string(regId) << std::endl;
469 log << MSG::WARNING <<
"min > " <<
size <<
" "
477 std::cout <<
"min > " <<
size <<
" "
493 log << MSG::ERROR <<
"tile zone ranges, id, hash, i = "
501 std::cout <<
" ***** Error ";
502 std::cout <<
"tile zone ranges, id, hash, i = "
554 std::string errorMessage =
"CaloDM_ID::lar_region_id() result is not OK: ID, range = "
567 std::string errorMessage =
"CaloDM_ID::tile_region_id() result is not OK: ID, range = "
583 std::string errorMessage =
"CaloDM_ID::lar_zone_id() result is not OK: ID, range = "
597 std::string errorMessage =
"CaloDM_ID::tile_zone_id() result is not OK: ID, range = "
612 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID= "
621 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
627 std::string errorMessage =
"CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
642 std::stringstream strm;
646 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
651 std::cout <<
"CaloDM_ID::initLevelsFromDict - dictionary NOT initialized "
677 log << MSG::ERROR <<
"initLevelsFromDict - unable to find lardm region " <<
endmsg;
681 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find lardm region "
697 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
702 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'subdet' field "
717 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DetZside' field "
722 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DetZside' field "
737 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMvalue' field "
742 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMvalue' field "
758 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'samplingvalue' field "
763 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'samplingvalue' field "
778 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMregion' field " <<
endmsg;
782 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMregion' field "
798 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'DMEta' field "
803 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'DMEta' field "
818 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phivalue' field "
823 std::cout <<
"CaloDM_ID::initLevelsFromDict - unable to find 'phivalue' field "
872 std::cout <<
"decode index and bit fields for each level: " << std::endl;
892 std::stringstream strm;
897 unsigned int nids = 0;
898 std::set<Identifier>
ids;
903 auto last = rit.
end();
912 if(!(
ids.insert(zon_id)).second)
916 log << MSG::ERROR <<
" init_lar_hashes "
917 <<
" duplicated id for lardm id. nids= " << nids
923 std::cout <<
" CaloDM_ID::init_lar_hashes "
924 <<
" Error: duplicated id for lardm id. nids= " << nids
927 std::cout << std::endl;
937 log << MSG::ERROR <<
" init_lar_hashes "
938 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
943 std::cout <<
" CaloDM_ID::init_lar_hashes "
944 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
952 std::set<Identifier>::const_iterator
first =
ids.begin();
953 std::set<Identifier>::const_iterator last =
ids.end();
968 auto last = rit.
end();
976 if(!(
ids.insert(reg_id)).second)
980 log << MSG::ERROR <<
" init_lar_hashes (regions) "
981 <<
" duplicated id for region id. nids= " << nids
987 std::cout <<
" CaloDM_ID::init_lar_hashes (regions) "
988 <<
" Error: duplicated id for region id. nids= " << nids
992 std::cout << std::endl;
1002 log << MSG::ERROR <<
" init_lar_hashes "
1003 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1008 std::cout <<
" CaloDM_ID::init_lar_hashes "
1009 <<
" Error: set size NOT EQUAL to region hash max. size " <<
ids.size()
1035 std::stringstream strm;
1040 unsigned int nids = 0;
1041 std::set<Identifier>
ids;
1046 auto last = rit.
end();
1066 if(!(
ids.insert(zon_id)).second)
1070 log << MSG::ERROR <<
" init_tile_hashes "
1071 <<
" duplicated id for tiledm id. nids= " << nids
1077 std::cout <<
" CaloDM_ID::init_tile_hashes "
1078 <<
" Error: duplicated id for tiledm id. nids= " << nids
1081 std::cout << std::endl;
1091 log << MSG::ERROR <<
" init_tile_hashes "
1092 <<
" set size NOT EQUAL to hash max. size " <<
ids.size()
1097 std::cout <<
" CaloDM_ID::init_tile_hashes "
1098 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
1106 std::set<Identifier>::const_iterator
first =
ids.begin();
1107 std::set<Identifier>::const_iterator last =
ids.end();
1122 auto last = rit.
end();
1130 if(!(
ids.insert(reg_id)).second)
1134 log << MSG::ERROR <<
" init_tile_hashes (regions) "
1135 <<
" duplicated id for region id. nids= " << nids
1141 std::cout <<
" CaloDM_ID::init_tile_hashes (regions) "
1142 <<
" Error: duplicated id for region id. nids= " << nids
1146 std::cout << std::endl;
1156 log << MSG::ERROR <<
" init_tile_hashes "
1157 <<
" set size NOT EQUAL to region hash max. size " <<
ids.size()
1162 std::cout <<
" CaloDM_ID::init_tile_hashes "
1163 <<
" 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