29 <<
" You have not called the parseXML function," 30 <<
" or your XML file is erronious" << std::endl;
32 if (plots_.find(run_type) != plots_.end()) {
33 return plots_[run_type];
35 return std::vector<SummaryPlot>();
44 boost::property_tree::ptree xmltree;
45 boost::property_tree::read_xml(
filename, xmltree);
47 auto runs = xmltree.find(rootTag_);
48 if (
runs == xmltree.not_found()) {
52 for (
auto& xml : xmltree) {
53 if (xml.first == rootTag_) {
54 for (
auto&
runtype : xml.second) {
55 if (
runtype.first == runTypeTag_) {
58 for (
auto& sumplot :
runtype.second) {
59 if (sumplot.first == summaryPlotTag_) {
65 plots_[run_type].push_back(
plot);
68 if (plots_[run_type].
empty()) {
70 ss <<
"[SummaryPlotXmlParser::" << __func__ <<
"]" 71 <<
" Unable to find any summary plot for " << runTypeTag_ <<
" nodes!" 72 <<
" Empty xml summary histo block?";
73 throw(std::runtime_error(
ss.str()));
78 ss <<
"[SummaryPlotXmlParser::" << __func__ <<
"]" 79 <<
" Unable to find any " << runTypeTag_ <<
" nodes!" 80 <<
" Empty xml run-type block?";
81 throw(std::runtime_error(
ss.str()));
87 ss <<
"[SummaryPlotXmlParser::" << __func__ <<
"]" 88 <<
" Did not find \"" << rootTag_ <<
"\" tag! " 89 <<
" Tag name is " << rootTag_;
90 throw(std::runtime_error(
ss.str()));
108 ss <<
"[SummaryPlotXmlParser::SummaryPlot::" << __func__ <<
"]" 109 <<
" Dumping contents of parsed XML file: " << std::endl;
111 typedef std::vector<SummaryPlot>
Plots;
112 std::map<RunType, Plots>::const_iterator irun = plots_.begin();
113 for (; irun != plots_.end(); irun++) {
115 if (irun->second.empty()) {
116 ss <<
" No summary plots for this RunType!";
118 Plots::const_iterator iplot = irun->second.begin();
119 for (; iplot != irun->second.end(); iplot++) {
120 ss << *iplot << std::endl;
static const std::string monitorableAttr_
static const std::string rootTag_
static const std::string runTypeTag_
static const std::string presentationAttr_
static const std::string runTypeAttr_
void parseXML(const std::string &xml_file)
static const std::string granularityAttr_
static const char mlDqmClient_[]
std::ostream & operator<<(std::ostream &os, const FEDBufferFormat &value)
static std::string runType(const sistrip::RunType &)
Parses the "summary plot" xml configuration file.
static const std::string viewAttr_
Class holding info that defines a summary plot.
static const std::string summaryPlotTag_
std::vector< SummaryPlot > summaryPlots(const sistrip::RunType &)
static const std::string levelAttr_
Log< level::Warning, false > LogWarning
void print(std::stringstream &) const