3 #include <boost/filesystem.hpp> 4 #include <boost/property_tree/json_parser.hpp> 5 #include <boost/property_tree/ptree.hpp> 19 using boost::property_tree::ptree;
24 for (
auto &item : pt.get_child(key))
25 r.push_back(item.second.get_value<
T>());
41 if (!boost::filesystem::exists(*filePath_)) {
43 <<
" File missing: " << *filePath_ << std::endl;
48 <<
" Opening: " << *filePath_ << std::endl;
54 for (
auto &mainTree : json.get_child(
"OccupancyPlots")) {
56 std::size_t
pos = title.find(
",");
59 <<
" Invalid title" << title << std::endl;
65 auto nBins = as_vector<int>(mainTree.second,
"nbins");
66 auto xrange = as_vector<int>(mainTree.second,
"xrange");
67 auto yrange = as_vector<int>(mainTree.second,
"yrange");
70 name.c_str(), title.c_str(), nBins.at(0), xrange.at(0), xrange.at(1), nBins.at(1), yrange.at(0), yrange.at(1));
72 for (
auto &dataArray : mainTree.second.get_child(
"data")) {
76 for (
auto &binContent : dataArray.second) {
77 *element++ = stoi(binContent.second.get_value<
std::string>());
82 th->SetBinContent(elements[0], elements[1], elements[2]);
91 m = ibooker_.
book2D(name, th);
std::vector< T > as_vector(ptree const &pt, ptree::key_type const &key)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< std::string > pathToken_
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
BrilClient(const edm::ParameterSet &ps)
MonitorElement * get(std::string const &path)
MonitorElement * book2D(Args &&...args)
edm::EDGetTokenT< std::string > jsonToken_