![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
27 log << MSG::INFO <<
"Initialize from dictionary" <<
endmsg;
31 log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
39 std::cout <<
" DEBUG (Re)initialize" << std::endl;
51 log << MSG::ERROR <<
" ZdcID::initialize_from_dict - cannot access ForwardDetectors dictionary " <<
endmsg;
67 if (atlasDict->
get_label_value(
"subdet",
"ForwardDetectors", fwdField)) {
68 log << MSG::ERROR <<
"Could not get value for label 'ForwardDetectors' of field 'subdet' in dictionary "
77 log << MSG::ERROR <<
"Could not get value for label 'ZDC' of field 'part' in dictionary "
84 <<
"Found field values: ZDC "
89 std::cout <<
" DEBUG ZdcID::initialize_from_dict "
90 <<
"Found field values: ZDC "
104 log << MSG::INFO <<
" ZdcID::initialize_from_dict " <<
endmsg;
113 std::cout <<
" INFO ZdcID::initialize_from_dict " << std::endl;
133 log << MSG::ERROR <<
" ZdcID::initLevelsFromDict - dictionary NOT initialized " <<
endmsg;
152 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find zdc region index: id, reg "
164 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg;
172 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'part' field " <<
endmsg;
180 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'side' field " <<
endmsg;
188 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'module' field " <<
endmsg;
196 log << MSG::ERROR<<
"ZdcID::initLevelsFromDict - unable to find 'type' field " <<
endmsg;
204 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'channel' field " <<
endmsg;
229 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
255 unsigned int nids = 0;
256 std::set<Identifier>
ids;
265 if(!(
ids.insert(
id)).second) {
266 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
267 <<
" Error: duplicated id for module id. nid " << nids
268 <<
" compact id " << MSG::hex <<
id.get_compact() << MSG::dec
269 <<
" id " << (std::string)exp_id <<
endmsg;
276 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
277 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
284 std::set<Identifier>::const_iterator
first =
ids.begin();
285 std::set<Identifier>::const_iterator last =
ids.end();
307 if(!(
ids.insert(
id)).second) {
308 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
309 <<
" Error: duplicated id for channel id. nid " << nids
310 <<
" compact id " << MSG::hex <<
id.get_compact() << MSG::dec
311 <<
" id " << (std::string)exp_id <<
endmsg;
318 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
319 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
352 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts not equal. New/old/expanded ids "
359 if (
id != new_id_1) {
360 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts from hash not equal. New/old/expanded ids. hash " << idHash <<
" "
371 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: tested module ids. nids, errors "
372 << nids <<
" " << nerr <<
endmsg;
375 std::cout <<
" DEBUG ZDC_ID::test_packing: tested module ids. nids, errors "
376 << nids <<
" " << nerr << std::endl;
388 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts not equal. New/old/expanded ids "
395 if (
id != new_id_1) {
396 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts from hash not equal. New/old/expanded ids hash " << idHash <<
" "
408 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: tested channel ids. nids, errors "
409 << nids <<
" " << nerr <<
endmsg;
412 std::cout <<
" DEBUG ZDC_ID::test_packing: tested channel ids. nids, errors "
413 << nids <<
" " << nerr << std::endl;
417 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: Successful tested "
422 std::cout <<
" DEBUG ZDC_ID::test_packing: Successful tested "
428 log << MSG::ERROR <<
"ZDC_ID::test_packing: Unable to test module/channel is packing - no dictionary has been defined. "
IdDictRegion * find_region(const std::string ®ion_name) const
MultiRange build_multirange() const
Get MultiRange for full dictionary.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
const IdDictDictionary * m_dict
singleton-like access to IMessageSvc via open function and helper
std::string show_to_string(void) const
IdentifierHash module_hash(Identifier module_id) const
module hash from id - optimized
int module(const Identifier &id) const
Identifier module_id(int side, int module) const
int forward_field_value() const
size_type m_FORWARD_INDEX
const_id_iterator modules_begin(void) const
Iterators over full set of ids. modules iterator is sorted.
const_id_iterator modules_end(void) const
IMessageSvc * m_msgSvc
pointer to the message service
MultiRange m_full_module_range
IdDictField * find_field(const std::string &name) const
IdDictFieldImplementation m_type_impl
size_type m_channel_hash_max
Identifier channel_id(int side, int module, int type, int channel) const
size_type m_zdc_region_index
int initLevelsFromDict(void)
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const_id_iterator channels_end(void) const
std::vector< IdDictRegion * > m_regions
IdDictFieldImplementation m_module_impl
std::vector< Identifier >::const_iterator const_id_iterator
MultiRange m_full_channel_range
const_id_iterator channels_begin(void) const
Iterators over full set of ids. channels iterator is sorted.
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
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
IdDictFieldImplementation m_forward_impl
void test_packing(void) const
Tests of packing.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
IdDictFieldImplementation m_side_impl
size_type m_CHANNEL_INDEX
int side(const Identifier &id) const
Values of different levels (failure returns 0)
int type(const Identifier &id) const
IdentifierHash channel_hash(Identifier channel_id) const
channel hash from id - optimized
int zdc_field_value() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
IdDictFieldImplementation m_zdc_impl
IdDictFieldImplementation m_channel_impl
std::vector< IdDictFieldImplementation > m_implementation
size_type m_module_hash_max
int channel(const Identifier &id) const