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;
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")) {
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);