CMS 3D CMS Logo

SiStripConfigParser.cc
Go to the documentation of this file.
3 #include <iostream>
4 
5 //
6 // -- Constructor
7 //
9  edm::LogInfo("SiStripConfigParser") << " Creating SiStripConfigParser "
10  << "\n";
11 }
12 
14  boost::property_tree::ptree xml;
15  boost::property_tree::read_xml(filename, xml);
16 
17  auto it = xml.find("MonElementConfiguration");
18  if (it == xml.not_found()) {
19  throw cms::Exception("SiPixelConfigParser")
20  << "SiPixelConfigParser XML needs to have a MonElementConfiguration node.";
21  }
22  this->config_ = it->second;
23 }
24 
25 // -- Get List of MEs for the summary plot and the
26 //
27 bool SiStripConfigParser::getMENamesForSummary(std::map<std::string, std::string>& me_names) {
28  for (auto& kv : config_) {
29  if (kv.first == "SummaryPlot") {
30  for (auto& mekv : kv.second) {
31  if (mekv.first == "MonElement") {
32  auto name = mekv.second.get<std::string>("<xmlattr>.name");
33  auto type = mekv.second.get<std::string>("<xmlattr>.type");
34  me_names[name] = type;
35  }
36  }
37  return true;
38  }
39  }
40  return false;
41 }
42 
43 //
44 // -- Get List of MEs for the summary plot and the
45 //
47  u_freq = config_.get<int>("SummaryPlot.<xmlattr>.update_frequency", -1);
48  if (u_freq >= 0)
49  return true;
50  return false;
51 }
bool getFrequencyForSummary(int &u_freq)
void getDocument(std::string filepath)
boost::property_tree::ptree config_
Log< level::Info, false > LogInfo
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)