 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
21 m_larElectrodeRegion_index(999),
22 m_larelectrode_index(999),
24 m_configuration_index(999),
25 m_detector_index(999),
31 m_electrode_index(999),
54 std::string strg =
" => initialize_from_dictionary()";
59 std::cout << strg << std::endl;
66 <<
"Request to reinitialize not satisfied - tags have not changed"
81 log <<
MSG::DEBUG <<
" => initialize_from_dictionary(dict_mgr) ="
86 log <<
MSG::DEBUG <<
" => defined m_dict from find_dictionary(LArElectrode) = "
89 strg =
" initialize_from_dictionary - cannot access LArElectrode dictionary ";
94 std::cout <<
"LArElectrodeID::" << strg << std::endl;
118 std::stringstream strm;
119 strm << atlasDict->
name();
120 strg=
" Could not get value for label 'LArElectrode' of field 'subdet' in dictionary "+strm.str();
125 std::cout <<
"LArElectrodeID:" << strg << std::endl;
133 int configurationValue = 1;
135 std::stringstream strm;
137 strg =
"WARNING : Could not get value for label 'configuration' in dictionary "+strm.str();
142 std::cout << strg << std::endl;
146 log <<
MSG::DEBUG <<
"[init_from_dictionary] > configurationValue = "
147 << configurationValue <<
endmsg;
152 reg_id.
add(larField);
153 reg_id.
add(configurationValue);
159 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Electrode range -> "
176 MsgStream
log(m_msgSvc,
"LArElectrodeID" );
179 exp_id << lar_field_value()
187 if(context && context->end_index() >= m_electrode_index) {
188 exp_id << electrode(
id);
203 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - dictionary NOT initialized "
228 log <<
MSG::INFO <<
"WARNING : [initLevelsFromDict] - unable to find 'EM-BARREL-ALL' region"
232 log <<
MSG::DEBUG <<
"[initLevelsFromDict] region 'EM-BARREL-ALL' found OK ... " <<
endmsg;
241 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg ;
245 <<
"[initLevelsFromDict] field 'LArElectrode' found OK " <<
endmsg;
254 <<
"LArHVLineID::initLevelsFromDict - unable to find 'configuration' field " <<
endmsg ;
258 <<
"[initLevelsFromDict] field config=Atlas found OK " <<
endmsg;
267 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'detector' field " <<
endmsg ;
271 <<
"[initLevelsFromDict] field 'detector' found OK " <<
endmsg;
280 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'zside' field "
294 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'module' field "
319 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hveta' field "
332 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hvgap' field "
346 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'electrode' field "
376 log <<
MSG::DEBUG <<
"[initLevelsFromDict] Decode index and bit fields for each level: " <<
endmsg;
399 std::stringstream strm1;
400 std::stringstream strm2;
401 std::stringstream strm3;
410 unsigned int nids = 0;
411 std::set<HWIdentifier>
ids;
415 for (
const auto & exp_id :rit) {
425 if(!(
ids.insert(elec_id)).second){
427 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
429 strg3 =
" expanded Id= "+strm3.str();
441 strg1 =
"[init_hashes] >";
442 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
443 strg3 =
" hash max "+strm2.str();
452 std::cout <<
"LArOnlineID::" << strg1 << std::endl;
453 std::cout <<
"Error" << strg2 << std::endl;
454 std::cout << strg3 << std::endl;
460 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
461 std::set<HWIdentifier>::const_iterator last =
ids.end();
IdDictRegion * find_region(const std::string ®ion_name) const
~LArElectrodeID()
Default destructor.
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
IdDictFieldImplementation m_hvphi_impl
std::string show_to_string(void) const
const IdDictRegion & region(size_t i) const
Region at index i.
HWIdentifier ElectrodeId(int det, int side, int mod, int phi, int eta, int gap, int elec) const
Create an Electrode identifier from fields.
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
const std::string & name() const
Dictionary name.
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
IdContext electrodeContext() const
Define feedthrough Context.
const IdDictFieldImplementation & implementation(size_t i) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
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.
LArElectrodeID()
Default constructor.
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
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
This class provides an interface to generate or decode an identifier for the upper levels of the dete...