11 #include "boost/filesystem.hpp" 12 #include "boost/property_tree/ptree.hpp" 13 #include "boost/property_tree/json_parser.hpp" 14 #include "boost/optional.hpp" 25 namespace pt = boost::property_tree;
30 for (
const auto& childTree :
tree.get_child(
name)) {
34 return s.substr(0,
s.size() -
token.size());
45 pt::read_json(
options.config, main_tree);
47 pt::ptree
alignments = main_tree.get_child(
"alignments");
48 pt::ptree
validation = main_tree.get_child(
"validation");
49 pt::ptree global_style;
50 pt::ptree merge_style;
51 global_style = main_tree.count(
"style") ? main_tree.get_child(
"style") : global_style;
52 merge_style = global_style.count(
"DMR") && global_style.get_child(
"DMR").count(
"merge")
53 ? global_style.get_child(
"DMR").get_child(
"merge")
60 rlabel = merge_style.count(
"Rlabel") ? merge_style.get<
std::string>(
"Rlabel") : rlabel;
61 std::string cmslabel = merge_style.count(
"CMSlabel") ? merge_style.get<
std::string>(
"CMSlabel") :
"INTERNAL";
76 std::vector<int> moduleids;
78 for (
const auto& childTree :
validation.get_child(
"moduleid")) {
79 moduleids.push_back(childTree.second.get_value<
int>());
84 TString filesAndLabels;
85 std::vector<std::pair<std::string, pt::ptree>> alignmentsOrdered;
87 alignmentsOrdered.push_back(childTree);
90 alignmentsOrdered.end(),
91 [](
const std::pair<std::string, pt::ptree>& left,
const std::pair<std::string, pt::ptree>& right) {
92 return left.second.get<
int>(
"index") < right.second.get<
int>(
"index");
94 for (
const auto& childTree : alignmentsOrdered) {
96 childTree.second.get<
std::string>(
"file") +
"/DMR.root=" + childTree.second.get<
std::string>(
"title") +
"|" +
99 filesAndLabels.Remove(filesAndLabels.Length() - 3);
109 gStyle->SetTitleH(0.07);
110 gStyle->SetTitleW(1.00);
111 gStyle->SetTitleFont(132);
115 for (
const auto& childTree : alignmentsOrdered) {
116 plotter.loadFileList((childTree.second.get<
std::string>(
"file") +
"/DMR.root").c_str(),
118 childTree.second.get<
int>(
"color"),
119 childTree.second.get<
int>(
"style"));
124 plotter.setTreeBaseDir(
"TrackHitFilter");
125 plotter.plotDMR(methods, minimum, curves);
126 plotter.plotSurfaceShapes(
"coarse");
127 plotter.plotChi2((main_tree.get<
std::string>(
"output") +
"/" +
"result.root").c_str());
129 for (
const int& moduleid : moduleids) {
130 plotter.residual_by_moduleID(moduleid);
136 #ifndef DOXYGEN_SHOULD_SKIP_THIS
int main(int argc, char *argv[])
static void set(const PublicationStatus status, const Era era=NONE, const TString customTitle="", const TString customRightTitle="")
static TString legendheader
int merge(int argc, char *argv[])
static TString legendoptions
Class PlotAlignmentValidation Class used as the last step for Offline Track Validation tool...
std::string getVecTokenized(pt::ptree &tree, const std::string &name, const std::string &token)
void doComparison(TString namesandlabels, TString legendheader="", TString lefttitle="", TString righttitle="", PublicationStatus status=INTERNAL, bool bigtext=false)
static PublicationStatus toStatus(std::string _status)