 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
21 m_larhvRegion_index(999),
23 m_configuration_index(999),
24 m_partition_index(999),
57 std::string strg =
" => initialize_from_dictionary()";
62 std::cout << strg << std::endl;
69 <<
"Request to reinitialize not satisfied - tags have not changed"
84 log <<
MSG::INFO <<
" => initialize_from_dictionary(dict_mgr) ="
92 strg =
" initialize_from_dictionary - cannot access LArHighVoltage dictionary ";
98 std::cout <<
"LArHVLineID::" << strg << std::endl;
121 if (atlasDict->
get_label_value(
"subdet",
"LArHighVoltage", larHVValue)) {
122 std::stringstream strm;
123 strm << atlasDict->
name();
124 strg=
" Could not get value for label 'LArHighVoltage' of field 'subdet' in dictionary "+strm.str();
129 std::cout <<
"LArHVLineID:" << strg << std::endl;
137 int configurationValue = 1;
139 std::stringstream strm;
141 strg =
"WARNING : Could not get value for label 'configuration' in dictionary "+strm.str();
146 std::cout << strg << std::endl;
150 log <<
MSG::DEBUG <<
"[init_from_dictionary] > configurationValue = "
151 << configurationValue <<
endmsg;
156 reg_id.
add(larHVValue);
157 reg_id.
add(configurationValue);
164 log <<
MSG::INFO <<
"[initialize_from_dictionary] > HV line range -> "
181 MsgStream
log(m_msgSvc,
"LArHVLineID" );
184 exp_id << lar_field_value()
190 if(context && context->end_index() >= m_hvline_index) {
191 exp_id << hv_line(
id);
205 log <<
MSG::INFO <<
"LArHVLineID::initLevelsFromDict - dictionary NOT initialized "
228 log <<
MSG::INFO <<
"WARNING : LArHVLineID::initLevelsFromDict - unable to find 'barrel-region1' region"
241 <<
"LArHVLineID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg ;
245 <<
"[initLevelsFromDict] field 'LArHighVoltage' found OK " <<
endmsg;
254 <<
"LArHVLineID::initLevelsFromDict - unable to find 'configuration' field " <<
endmsg ;
258 <<
"[initLevelsFromDict] field config=Atlas found OK " <<
endmsg;
266 log <<
MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'partition' field "
279 log <<
MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'canline' field "
293 log <<
MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'cannode' field "
307 log <<
MSG::INFO <<
"LArHVLineID::initLevelsFromDict - unable to find 'hvline' field "
328 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_larhvcalo_index " <<
endmsg;
336 log <<
MSG::DEBUG <<
"[initLevelsFromDict] Decode index and bit fields for each level: " <<
endmsg;
356 std::stringstream strm1;
357 std::stringstream strm2;
358 std::stringstream strm3;
367 unsigned int nids = 0;
368 std::set<HWIdentifier>
ids;
372 for (
const auto & exp_id :rit) {
379 if(!(
ids.insert(hv_id)).second){
381 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
383 strg3 =
" expanded Id= "+strm3.str();
395 strg1 =
"[init_hashes] >";
396 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
397 strg3 =
" hash max "+strm2.str();
406 std::cout <<
"LArOnlineID::" << strg1 << std::endl;
407 std::cout <<
"Error" << strg2 << std::endl;
408 std::cout << strg3 << std::endl;
414 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
415 std::set<HWIdentifier>::const_iterator last =
ids.end();
IdDictRegion * find_region(const std::string ®ion_name) 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
const IdDictRegion & region(size_t i) const
Region at index i.
size_type m_partition_index
void add(element_type value)
Append a value into a new field.
IdDictFieldImplementation m_configuration_impl
IdContext hvlineContext() const
IMessageSvc * m_msgSvc
pointer to the message service
IdDictFieldImplementation m_partition_impl
const std::string & name() const
Dictionary name.
IdDictField * find_field(const std::string &name) const
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
size_type m_canline_index
const IdDictFieldImplementation & implementation(size_t i) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
LArHVLineID()
only allowed constructor
IdDictFieldImplementation m_atlas_impl
Field Implementation.
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...
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
MultiRange m_full_atlas_highvoltage_range
size_type m_larhvRegion_index