19 m_name = getAttribute(
"name");
23 double prescaleValue =
p.second.get_child(
"prescale").get_value<
double>();
25 ps.
prescale = prescaleValue < 0 ? -prescaleValue : prescaleValue;
26 ps.enabled = (prescaleValue > 0);
27 boost::optional<bool> enabledField =
p.second.get_optional<
bool>(
"enabled");
29 ps.enabled = *enabledField;
33 m_prescales[
p.first] = ps;
37 m_prescalesByHash[namehash] = ps;
43 if(
p.second.get_optional<
double>(
"prescale_express")){
44 double prescaleValue_express =
p.second.get_child(
"prescale_express").get_value<
double>();
45 ps_express.
prescale = prescaleValue_express < 0 ? -prescaleValue_express : prescaleValue_express;
46 ps_express.
enabled = (prescaleValue_express > 0);
47 boost::optional<bool> enabledField_express =
p.second.get_optional<
bool>(
"enabled_express");
48 if( enabledField_express ) {
49 ps_express.
enabled = *enabledField_express;
52 m_prescales_express[
p.first] = ps_express;
55 m_prescalesByHash_express[namehash] = ps_express;
65 m_prescalesByHash.clear();
71 return m_prescales.size();
91 return m_prescalesByHash.at(chainHash);
98 if (
search != m_prescales_express.end()) {
101 return m_notInExpress;
107 auto search = m_prescalesByHash_express.find(chainHash);
108 if (
search != m_prescalesByHash_express.end()) {
111 return m_notInExpress;
118 std::cout <<
"Name '" <<
name() <<
"'" << std::endl;
119 std::cout <<
"Prescales: " <<
size() << std::endl;
122 for(
auto & ps : m_prescales ) {
123 std::cout <<
" " <<
c++ <<
": " << ps.first <<
" -> " << ps.second.prescale << (ps.second.enabled ?
"" :
" (disabled)" ) << std::endl;