 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/MsgStream.h"
24 m_larElectrodeRegion_index(999),
25 m_larelectrode_index(999),
27 m_configuration_index(999),
28 m_detector_index(999),
34 m_electrode_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::DEBUG <<
" => initialize_from_dictionary(dict_mgr) ="
89 log <<
MSG::DEBUG <<
" => defined m_dict from find_dictionary(LArElectrode) = "
92 strg =
" initialize_from_dictionary - cannot access LArElectrode dictionary ";
97 std::cout <<
"LArElectrodeID::" << strg << std::endl;
121 std::stringstream strm;
122 strm << atlasDict->
name();
123 strg=
" Could not get value for label 'LArElectrode' of field 'subdet' in dictionary "+strm.str();
128 std::cout <<
"LArElectrodeID:" << 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(larField);
156 reg_id.
add(configurationValue);
162 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Electrode range -> "
179 MsgStream
log(m_msgSvc,
"LArElectrodeID" );
182 exp_id << lar_field_value()
190 if(context && context->end_index() >= m_electrode_index) {
191 exp_id << electrode(
id);
206 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - dictionary NOT initialized "
231 log <<
MSG::INFO <<
"WARNING : [initLevelsFromDict] - unable to find 'EM-BARREL-ALL' region"
235 log <<
MSG::DEBUG <<
"[initLevelsFromDict] region 'EM-BARREL-ALL' found OK ... " <<
endmsg;
244 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'subdet' field " <<
endmsg ;
248 <<
"[initLevelsFromDict] field 'LArElectrode' found OK " <<
endmsg;
257 <<
"LArHVLineID::initLevelsFromDict - unable to find 'configuration' field " <<
endmsg ;
261 <<
"[initLevelsFromDict] field config=Atlas found OK " <<
endmsg;
270 <<
"LArElectrodeID::initLevelsFromDict - unable to find 'detector' field " <<
endmsg ;
274 <<
"[initLevelsFromDict] field 'detector' found OK " <<
endmsg;
283 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'zside' field "
297 log <<
MSG::INFO <<
"LArElectrodeID::initLevelsFromDict - unable to find 'module' field "
322 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hveta' field "
335 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'hvgap' field "
349 log <<
MSG::INFO <<
"[initLevelsFromDict] - unable to find 'electrode' field "
379 log <<
MSG::DEBUG <<
"[initLevelsFromDict] Decode index and bit fields for each level: " <<
endmsg;
402 std::stringstream strm1;
403 std::stringstream strm2;
404 std::stringstream strm3;
413 unsigned int nids = 0;
414 std::set<HWIdentifier>
ids;
418 for (
const auto & exp_id :rit) {
428 if(!(
ids.insert(elec_id)).second){
430 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
432 strg3 =
" expanded Id= "+strm3.str();
444 strg1 =
"[init_hashes] >";
445 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
446 strg3 =
" hash max "+strm2.str();
455 std::cout <<
"LArOnlineID::" << strg1 << std::endl;
456 std::cout <<
"Error" << strg2 << std::endl;
457 std::cout << strg3 << std::endl;
463 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
464 std::set<HWIdentifier>::const_iterator last =
ids.end();
IdDictRegion * find_region(const std::string ®ion_name) const
virtual ~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...