|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
20 m_larElectrodeRegion_index(999),
21 m_larelectrode_index(999),
23 m_configuration_index(999),
24 m_detector_index(999),
30 m_electrode_index(999),
53 std::string strg =
" => initialize_from_dictionary()";
58 std::cout << strg << std::endl;
65 <<
"Request to reinitialize not satisfied - tags have not changed"
80 log <<
MSG::DEBUG <<
" => initialize_from_dictionary(dict_mgr) ="
85 log <<
MSG::DEBUG <<
" => defined m_dict from find_dictionary(LArElectrode) = "
88 strg =
" initialize_from_dictionary - cannot access LArElectrode dictionary ";
93 std::cout <<
"LArElectrodeID::" << strg << std::endl;
117 std::stringstream strm;
118 strm << atlasDict->
m_name;
119 strg=
" Could not get value for label 'LArElectrode' of field 'subdet' in dictionary "+strm.str();
124 std::cout <<
"LArElectrodeID:" << strg << std::endl;
132 int configurationValue = 1;
134 std::stringstream strm;
136 strg =
"WARNING : Could not get value for label 'configuration' in dictionary "+strm.str();
141 std::cout << strg << std::endl;
145 log <<
MSG::DEBUG <<
"[init_from_dictionary] > configurationValue = "
146 << configurationValue <<
endmsg;
151 reg_id.
add(larField);
152 reg_id.
add(configurationValue);
158 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Electrode range -> "
175 MsgStream
log(m_msgSvc,
"LArElectrodeID" );
178 exp_id << lar_field_value()
186 if(context && context->end_index() >= m_electrode_index) {
187 exp_id << electrode(
id);
202 log << MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - dictionary NOT initialized "
227 log << MSG::INFO <<
"WARNING : [initLevelsFromDict] - unable to find 'EM-BARREL-ALL' region"
231 log <<
MSG::DEBUG <<
"[initLevelsFromDict] region 'EM-BARREL-ALL' found OK ... " <<
endmsg;
240 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg ;
244 <<
"[initLevelsFromDict] field 'LArElectrode' found OK " <<
endmsg;
253 <<
"LArHVLineID::initLevelsFromDict - unable to find 'configuration' field " <<
endmsg ;
257 <<
"[initLevelsFromDict] field config=Atlas found OK " <<
endmsg;
266 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'detector' field " <<
endmsg ;
270 <<
"[initLevelsFromDict] field 'detector' found OK " <<
endmsg;
279 log << MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'zside' field "
293 log << MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'module' field "
306 log << MSG::INFO <<
"initLevelsFromDict - unable to find 'hvphi' field "<<
endmsg ;
318 log << MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hveta' field "
331 log << MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hvgap' field "
345 log << MSG::INFO <<
"[initLevelsFromDict] - unable to find 'electrode' field "
375 log <<
MSG::DEBUG <<
"[initLevelsFromDict] Decode index and bit fields for each level: " <<
endmsg;
398 std::stringstream strm1;
399 std::stringstream strm2;
400 std::stringstream strm3;
409 unsigned int nids = 0;
410 std::set<HWIdentifier>
ids;
414 for (
const auto & exp_id :rit) {
424 if(!(
ids.insert(elec_id)).second){
426 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
428 strg3 =
" expanded Id= "+strm3.str();
440 strg1 =
"[init_hashes] >";
441 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
442 strg3 =
" hash max "+strm2.str();
451 std::cout <<
"LArOnlineID::" << strg1 << std::endl;
452 std::cout <<
"Error" << strg2 << std::endl;
453 std::cout << strg3 << std::endl;
459 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
460 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.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
IdDictFieldImplementation m_hveta_impl
int initLevelsFromDict(void)
IdDictFieldImplementation m_hvphi_impl
std::string show_to_string(void) const
HWIdentifier ElectrodeId(int det, int side, int mod, int phi, int eta, int gap, int elec) const
Create an Electrode identifier from fields.
LArElectrodeID(void)
Default constructor.
void add(element_type value)
Append a value into a new field.
IdDictFieldImplementation m_atlas_impl
Field Implementation.
IMessageSvc * m_msgSvc
pointer to the message service
IdDictFieldImplementation m_configuration_impl
def gap(flags, cells_name, *args, **kw)
size_type m_electrodeHashMax
IdDictField * find_field(const std::string &name) const
IdDictFieldImplementation m_hvgap_impl
MultiRange m_full_electrode_range
size_type m_larElectrodeRegion_index
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
~LArElectrodeID(void)
Default destructor.
std::vector< IdDictRegion * > m_regions
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
size_type m_configuration_index
IdDictFieldImplementation m_detector_impl
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
const IdDictDictionary * m_dict
size_type m_detector_index
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
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.
std::vector< HWIdentifier > m_electrode_vec
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_electrode_impl
IdContext electrodeContext(void) const
Define feedthrough Context.
size_type m_electrode_index
size_type cardinality() const
Computes a possible cardinality from all ranges.
IdDictFieldImplementation m_zside_impl
IdDictFieldImplementation m_module_impl
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
MultiRange m_full_larelectrode_range
std::vector< IdDictFieldImplementation > m_implementation