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;
59 float m_dxyPhiNormMax =
validation.count(
"m_dxyPhiNormMax") ?
validation.get<
float>(
"m_dxyPhiNormMax") : 0.5;
60 float m_dzPhiNormMax =
validation.count(
"m_dzPhiNormMax") ?
validation.get<
float>(
"m_dzPhiNormMax") : 0.5;
61 float m_dxyEtaNormMax =
validation.count(
"m_dxyEtaNormMax") ?
validation.get<
float>(
"m_dxyEtaNormMax") : 0.5;
62 float m_dzEtaNormMax =
validation.count(
"m_dzEtaNormMax") ?
validation.get<
float>(
"m_dzEtaNormMax") : 0.5;
63 float m_dxyPtNormMax =
validation.count(
"m_dxyPtNormMax") ?
validation.get<
float>(
"m_dxyPtNormMax") : 0.5;
64 float m_dzPtNormMax =
validation.count(
"m_dzPtNormMax") ?
validation.get<
float>(
"m_dzPtNormMax") : 0.5;
65 float w_dxyPhiMax =
validation.count(
"w_dxyPhiMax") ?
validation.get<
float>(
"w_dxyPhiMax") : 150;
67 float w_dxyEtaMax =
validation.count(
"w_dxyEtaMax") ?
validation.get<
float>(
"w_dxyEtaMax") : 150;
71 float w_dxyPhiNormMax =
validation.count(
"w_dxyPhiNormMax") ?
validation.get<
float>(
"w_dxyPhiNormMax") : 1.8;
72 float w_dzPhiNormMax =
validation.count(
"w_dzPhiNormMax") ?
validation.get<
float>(
"w_dzPhiNormMax") : 1.8;
73 float w_dxyEtaNormMax =
validation.count(
"w_dxyEtaNormMax") ?
validation.get<
float>(
"w_dxyEtaNormMax") : 1.8;
74 float w_dzEtaNormMax =
validation.count(
"w_dzEtaNormMax") ?
validation.get<
float>(
"w_dzEtaNormMax") : 1.8;
75 float w_dxyPtNormMax =
validation.count(
"w_dxyPtNormMax") ?
validation.get<
float>(
"w_dxyPtNormMax") : 1.8;
76 float w_dzPtNormMax =
validation.count(
"w_dzPtNormMax") ?
validation.get<
float>(
"w_dzPtNormMax") : 1.8;
79 rlabel = merge_style.count(
"Rlabel") ? merge_style.get<
std::string>(
"Rlabel") : rlabel;
80 std::string cmslabel = merge_style.count(
"CMSlabel") ? merge_style.get<
std::string>(
"CMSlabel") :
"INTERNAL";
88 thePlotLimits->init(m_dxyPhiMax,
115 std::vector<std::pair<std::string, pt::ptree>> alignmentsOrdered;
116 for (
const auto& childTree : alignments) {
117 alignmentsOrdered.push_back(childTree);
120 alignmentsOrdered.end(),
121 [](
const std::pair<std::string, pt::ptree>& left,
const std::pair<std::string, pt::ptree>& right) {
122 return left.second.get<
int>(
"index") < right.second.get<
int>(
"index");
124 for (
const auto& childTree : alignmentsOrdered) {
125 if (childTree.second.get<
bool>(
"isMC")) {
127 (childTree.second.get<
string>(
"file") + Form(
"/PVValidation_%s_%d.root", childTree.first.c_str(), 1)).c_str(),
129 childTree.second.get<
string>(
"title"),
130 childTree.second.get<
int>(
"color"),
131 childTree.second.get<
int>(
"style"));
134 (childTree.second.get<
string>(
"file") + Form(
"/PVValidation_%s_%d.root", childTree.first.c_str(), iov))
137 childTree.second.get<
string>(
"title"),
138 childTree.second.get<
int>(
"color"),
139 childTree.second.get<
int>(
"style"));
144 FitPVResiduals(
"", stdResiduals, doMaps,
"", autoLimits, cmslabel, rlabel);
149 #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)