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" 20 #include "Alignment/OfflineValidation/macros/FitPVResiduals.C" 26 namespace pt = boost::property_tree;
37 pt::read_json(
options.config, main_tree);
39 pt::ptree alignments = main_tree.get_child(
"alignments");
40 pt::ptree
validation = main_tree.get_child(
"validation");
41 pt::ptree global_style;
42 pt::ptree merge_style;
43 global_style = main_tree.count(
"style") ? main_tree.get_child(
"style") : global_style;
44 merge_style = global_style.count(
"PV") && global_style.get_child(
"PV").count(
"merge")
45 ? global_style.get_child(
"PV").get_child(
"merge")
50 bool stdResiduals =
validation.count(
"stdResiduals") ?
validation.get<
bool>(
"stdResiduals") :
true;
57 float m_dxyPhiNormMax =
validation.count(
"m_dxyPhiNormMax") ?
validation.get<
float>(
"m_dxyPhiNormMax") : 0.5;
58 float m_dzPhiNormMax =
validation.count(
"m_dzPhiNormMax") ?
validation.get<
float>(
"m_dzPhiNormMax") : 0.5;
59 float m_dxyEtaNormMax =
validation.count(
"m_dxyEtaNormMax") ?
validation.get<
float>(
"m_dxyEtaNormMax") : 0.5;
60 float m_dzEtaNormMax =
validation.count(
"m_dzEtaNormMax") ?
validation.get<
float>(
"m_dzEtaNormMax") : 0.5;
61 float w_dxyPhiMax =
validation.count(
"w_dxyPhiMax") ?
validation.get<
float>(
"w_dxyPhiMax") : 150;
63 float w_dxyEtaMax =
validation.count(
"w_dxyEtaMax") ?
validation.get<
float>(
"w_dxyEtaMax") : 150;
65 float w_dxyPhiNormMax =
validation.count(
"w_dxyPhiNormMax") ?
validation.get<
float>(
"w_dxyPhiNormMax") : 1.8;
66 float w_dzPhiNormMax =
validation.count(
"w_dzPhiNormMax") ?
validation.get<
float>(
"w_dzPhiNormMax") : 1.8;
67 float w_dxyEtaNormMax =
validation.count(
"w_dxyEtaNormMax") ?
validation.get<
float>(
"w_dxyEtaNormMax") : 1.8;
68 float w_dzEtaNormMax =
validation.count(
"w_dzEtaNormMax") ?
validation.get<
float>(
"w_dzEtaNormMax") : 1.8;
71 rlabel = merge_style.count(
"Rlabel") ? merge_style.get<
std::string>(
"Rlabel") : rlabel;
72 std::string cmslabel = merge_style.count(
"CMSlabel") ? merge_style.get<
std::string>(
"CMSlabel") :
"INTERNAL";
80 thePlotLimits->init(m_dxyPhiMax,
99 std::vector<std::pair<std::string, pt::ptree>> alignmentsOrdered;
100 for (
const auto& childTree : alignments) {
101 alignmentsOrdered.push_back(childTree);
104 alignmentsOrdered.end(),
105 [](
const std::pair<std::string, pt::ptree>& left,
const std::pair<std::string, pt::ptree>& right) {
106 return left.second.get<
int>(
"index") < right.second.get<
int>(
"index");
108 for (
const auto& childTree : alignmentsOrdered) {
109 if (childTree.second.get<
bool>(
"isMC")) {
111 (childTree.second.get<
string>(
"file") + Form(
"/PVValidation_%s_%d.root", childTree.first.c_str(), 1)).c_str(),
113 childTree.second.get<
string>(
"title"),
114 childTree.second.get<
int>(
"color"),
115 childTree.second.get<
int>(
"style"));
118 (childTree.second.get<
string>(
"file") + Form(
"/PVValidation_%s_%d.root", childTree.first.c_str(), iov))
121 childTree.second.get<
string>(
"title"),
122 childTree.second.get<
int>(
"color"),
123 childTree.second.get<
int>(
"style"));
128 FitPVResiduals(
"", stdResiduals, doMaps,
"", autoLimits, cmslabel, rlabel);
133 #ifndef DOXYGEN_SHOULD_SKIP_THIS
static void set(const PublicationStatus status, const Era era=NONE, const TString customTitle="", const TString customRightTitle="")
int merge(int argc, char *argv[])
int main(int argc, char *argv[])
static PublicationStatus toStatus(std::string _status)