|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
20 m_larhvRegion_index(999),
22 m_configuration_index(999),
23 m_partition_index(999),
56 std::string strg =
" => initialize_from_dictionary()";
61 std::cout << strg << std::endl;
68 <<
"Request to reinitialize not satisfied - tags have not changed"
83 log << MSG::INFO <<
" => initialize_from_dictionary(dict_mgr) ="
91 strg =
" initialize_from_dictionary - cannot access LArHighVoltage dictionary ";
97 std::cout <<
"LArHVLineID::" << strg << std::endl;
105 log << MSG::INFO <<
"Register_dict_tag of LArHighVoltage is OK" <<
endmsg;
110 log << MSG::INFO <<
"setDictVersion of LArHighVoltage is OK" <<
endmsg;
120 if (atlasDict->
get_label_value(
"subdet",
"LArHighVoltage", larHVValue)) {
121 std::stringstream strm;
122 strm << atlasDict->
m_name;
123 strg=
" Could not get value for label 'LArHighVoltage' of field 'subdet' in dictionary "+strm.str();
128 std::cout <<
"LArHVLineID:" << strg << std::endl;
136 int configurationValue = 1;
138 std::stringstream strm;
140 strg =
"WARNING : Could not get value for label 'configuration' in dictionary "+strm.str();
145 std::cout << strg << std::endl;
149 log <<
MSG::DEBUG <<
"[init_from_dictionary] > configurationValue = "
150 << configurationValue <<
endmsg;
155 reg_id.
add(larHVValue);
156 reg_id.
add(configurationValue);
163 log << MSG::INFO <<
"[initialize_from_dictionary] > HV line range -> "
180 MsgStream
log(m_msgSvc,
"LArHVLineID" );
183 exp_id << lar_field_value()
189 if(context && context->end_index() >= m_hvline_index) {
190 exp_id << hv_line(
id);
204 log << MSG::INFO <<
"LArHVLineID::initLevelsFromDict - dictionary NOT initialized "
209 log << MSG::INFO <<
"[initLevelsFromDict] m_dict OK ... " <<
endmsg;
227 log << MSG::INFO <<
"WARNING : LArHVLineID::initLevelsFromDict - unable to find 'barrel-region1' region"
240 <<
"LArHVLineID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg ;
244 <<
"[initLevelsFromDict] field 'LArHighVoltage' found OK " <<
endmsg;
253 <<
"LArHVLineID::initLevelsFromDict - unable to find 'configuration' field " <<
endmsg ;
257 <<
"[initLevelsFromDict] field config=Atlas found OK " <<
endmsg;
265 log << MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'partition' field "
278 log << MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'canline' field "
292 log << MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'cannode' field "
306 log << MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'hvline' field "
327 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_larhvcalo_index " <<
endmsg;
335 log <<
MSG::DEBUG <<
"[initLevelsFromDict] Decode index and bit fields for each level: " <<
endmsg;
355 std::stringstream strm1;
356 std::stringstream strm2;
357 std::stringstream strm3;
366 unsigned int nids = 0;
367 std::set<HWIdentifier>
ids;
371 for (
const auto & exp_id :rit) {
378 if(!(
ids.insert(hv_id)).second){
380 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
382 strg3 =
" expanded Id= "+strm3.str();
394 strg1 =
"[init_hashes] >";
395 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
396 strg3 =
" hash max "+strm2.str();
405 std::cout <<
"LArOnlineID::" << strg1 << std::endl;
406 std::cout <<
"Error" << strg2 << std::endl;
407 std::cout << strg3 << std::endl;
413 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
414 std::set<HWIdentifier>::const_iterator last =
ids.end();
IdDictRegion * find_region(const std::string ®ion_name) const
IdContext hvlineContext(void) const
MultiRange build_multirange() const
Get MultiRange for full dictionary.
std::vector< HWIdentifier > m_hvline_vec
HWIdentifier HVLineId(int part, int canline, int cannode, int line) const
Create an HighVoltage line identifier from fields.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
size_type m_cannode_index
std::string show_to_string(void) const
size_type m_partition_index
void add(element_type value)
Append a value into a new field.
IdDictFieldImplementation m_configuration_impl
IMessageSvc * m_msgSvc
pointer to the message service
IdDictFieldImplementation m_partition_impl
IdDictField * find_field(const std::string &name) const
LArHVLineID(void)
only allowed constructor
int initLevelsFromDict(void)
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
size_type m_canline_index
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
IdDictFieldImplementation m_atlas_impl
Field Implementation.
std::vector< IdDictRegion * > m_regions
MultiRange m_full_hvline_range
size_type m_configuration_index
const IdDictDictionary * m_dict
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
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
IdDictFieldImplementation m_cannode_impl
size_type m_hvlineHashMax
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
size_type cardinality() const
Computes a possible cardinality from all ranges.
MultiRange m_full_canline_range
IdDictFieldImplementation m_canline_impl
IdDictFieldImplementation m_hvline_impl
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::vector< IdDictFieldImplementation > m_implementation
MultiRange m_full_atlas_highvoltage_range
size_type m_larhvRegion_index