3 #include <boost/property_tree/json_parser.hpp> 4 #include <boost/property_tree/ptree.hpp> 19 using boost::property_tree::ptree;
25 r.push_back(
item.second.get_value<
T>());
41 if (!std::filesystem::exists(*filePath_)) {
43 <<
" File missing: " << *filePath_ << std::endl;
48 <<
" Opening: " << *filePath_ << std::endl;
54 for (
auto &mainTree :
json.get_child(
"OccupancyPlots")) {
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>());
93 m->getTH1F()->Add(th);
virtual void setCurrentFolder(std::string const &fullpath)
std::vector< T > as_vector(ptree const &pt, ptree::key_type const &key)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::string > pathToken_
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
BrilClient(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< std::string > jsonToken_