Loading [MathJax]/jax/input/TeX/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
28 log << MSG::INFO <<
"Initialize from dictionary" <<
endmsg;
32 log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
40 std::cout <<
" DEBUG (Re)initialize" << std::endl;
52 log << MSG::ERROR <<
" ZdcID::initialize_from_dict - cannot access ForwardDetectors dictionary " <<
endmsg;
68 if (atlasDict->
get_label_value(
"subdet",
"ForwardDetectors", fwdField)) {
69 log << MSG::ERROR <<
"Could not get value for label 'ForwardDetectors' of field 'subdet' in dictionary "
78 log << MSG::ERROR <<
"Could not get value for label 'ZDC' of field 'part' in dictionary "
85 <<
"Found field values: ZDC "
90 std::cout <<
" DEBUG ZdcID::initialize_from_dict "
91 <<
"Found field values: ZDC "
105 log << MSG::INFO <<
" ZdcID::initialize_from_dict " <<
endmsg;
114 std::cout <<
" INFO ZdcID::initialize_from_dict " << std::endl;
134 log << MSG::ERROR <<
" ZdcID::initLevelsFromDict - dictionary NOT initialized " <<
endmsg;
153 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find zdc region index: id, reg "
165 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg;
173 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'part' field " <<
endmsg;
181 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'side' field " <<
endmsg;
189 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'module' field " <<
endmsg;
197 log << MSG::ERROR<<
"ZdcID::initLevelsFromDict - unable to find 'type' field " <<
endmsg;
205 log << MSG::ERROR <<
"ZdcID::initLevelsFromDict - unable to find 'channel' field " <<
endmsg;
230 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
256 unsigned int nids = 0;
257 std::set<Identifier>
ids;
262 auto last = rit.
end();
267 if(!(
ids.insert(
id)).second) {
268 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
269 <<
" Error: duplicated id for module id. nid " << nids
270 <<
" compact id " << MSG::hex <<
id.get_compact() << MSG::dec
271 <<
" id " << (std::string)exp_id <<
endmsg;
278 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
279 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
286 std::set<Identifier>::const_iterator
first =
ids.begin();
287 std::set<Identifier>::const_iterator last =
ids.end();
302 auto last = rit.
end();
310 if(!(
ids.insert(
id)).second) {
311 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
312 <<
" Error: duplicated id for channel id. nid " << nids
313 <<
" compact id " << MSG::hex <<
id.get_compact() << MSG::dec
314 <<
" id " << (std::string)exp_id <<
endmsg;
321 log << MSG::ERROR <<
" ZDC_ID::init_hashes "
322 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
355 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts not equal. New/old/expanded ids "
362 if (
id != new_id_1) {
363 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts from hash not equal. New/old/expanded ids. hash " << idHash <<
" "
374 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: tested module ids. nids, errors "
375 << nids <<
" " << nerr <<
endmsg;
378 std::cout <<
" DEBUG ZDC_ID::test_packing: tested module ids. nids, errors "
379 << nids <<
" " << nerr << std::endl;
391 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts not equal. New/old/expanded ids "
398 if (
id != new_id_1) {
399 log << MSG::ERROR <<
"ZDC_ID::test_packing: new and old compacts from hash not equal. New/old/expanded ids hash " << idHash <<
" "
411 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: tested channel ids. nids, errors "
412 << nids <<
" " << nerr <<
endmsg;
415 std::cout <<
" DEBUG ZDC_ID::test_packing: tested channel ids. nids, errors "
416 << nids <<
" " << nerr << std::endl;
420 log <<
MSG::DEBUG <<
"ZDC_ID::test_packing: Successful tested "
425 std::cout <<
" DEBUG ZDC_ID::test_packing: Successful tested "
431 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
ConstRangeIterator begin() const
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
ConstRangeIterator end() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
IdDictFieldImplementation m_zdc_impl
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
IdDictFieldImplementation m_channel_impl
std::vector< IdDictFieldImplementation > m_implementation
size_type m_module_hash_max
int channel(const Identifier &id) const