51 pt::read_json(
options.config, main_tree);
53 pt::ptree alignments = main_tree.get_child(
"alignments");
54 pt::ptree
validation = main_tree.get_child(
"validation");
55 pt::ptree
style = main_tree.get_child(
"style");
58 string outputdir = main_tree.get<
string>(
"output");
61 TString lumiInputFile =
style.get_child(
"trends").count(
"lumiInputFile")
62 ?
style.get_child(
"trends").get<
string>(
"lumiInputFile")
63 :
"Alignment/OfflineValidation/data/lumiPerRun_Run2.txt";
64 fs::path lumiFile = lumiInputFile.Data();
67 if (!fs::exists(lumiFile)) {
70 pathToLumiFile = lumiFile;
72 if (!fs::exists(pathToLumiFile)) {
73 cout <<
"ERROR: lumi-per-run file (" << lumiFile.string().data() <<
") not found!" << endl
74 <<
"Please check!" << endl;
77 cout <<
"Found lumi-per-run file: " << pathToLumiFile.string().data() << endl;
79 if (!lumiInputFile.Contains(
year)) {
80 cout <<
"ERROR: lumi-per-run file must contain (" <<
year.data() <<
")!" << endl <<
"Please check!" << endl;
84 string lumiAxisType =
"recorded";
85 if (lumiInputFile.Contains(
"delivered"))
86 lumiAxisType =
"delivered";
88 std::cout << Form(
"NOTE: using %s luminosity!", lumiAxisType.data()) << std::endl;
92 for (
auto const &childTree :
validation.get_child(
"IOV")) {
93 int iov = childTree.second.get_value<
int>();
94 IOVlist.push_back(iov);
95 TString mergeFile =
validation.get<
string>(
"mergeFile");
96 string input = Form(
"%s/OfflineValidationSummary.root", mergeFile.ReplaceAll(
"{}",
to_string(iov)).Data());
100 string labels_to_add =
"";
103 labels_to_add +=
"_";
104 labels_to_add +=
label.second.get_value<
string>();
110 vector<TString> structures{
"BPIX",
"BPIX_y",
"FPIX",
"FPIX_y",
"TIB",
"TID",
"TOB",
"TEC"};
112 map<TString, int> nlayers{{
"BPIX", 4}, {
"FPIX", 3}, {
"TIB", 4}, {
"TID", 3}, {
"TOB", 6}, {
"TEC", 9}};
114 nlayers = {{
"BPIX", 3}, {
"FPIX", 2}, {
"TIB", 4}, {
"TID", 3}, {
"TOB", 6}, {
"TEC", 9}};
120 IOVlist,
Variable.second.get_value<
string>(),
inputFiles, structures, nlayers, FORCE);
123 prepareTrends.compileDMRTrends(IOVlist,
"median",
inputFiles, structures, nlayers, FORCE);
127 float convertUnit =
style.get_child(
"trends").count(
"convertUnit")
128 ?
style.get_child(
"trends").get<
float>(
"convertUnit")
135 auto f = TFile::Open(
pname.c_str());
138 vector<tuple<TString, TString, float, float>> DMRs{{
"mu",
"#mu [#mum]", -6, 6},
139 {
"sigma",
"#sigma_{#mu} [#mum]", -5, 5},
140 {
"muplus",
"#mu outward [#mum]", -6, 6},
141 {
"sigmaplus",
"#sigma_{#mu outward} [#mum]", -5, 5},
142 {
"muminus",
"#mu inward [#mum]", -6, 6},
143 {
"sigmaminus",
"#sigma_{#mu inward} [#mum]", -5, 5},
144 {
"deltamu",
"#Delta#mu [#mum]", -5, 5},
145 {
"sigmadeltamu",
"#sigma_{#Delta#mu} [#mum]", -5, 5},
146 {
"musigma",
"#mu [#mum]", -2, 4},
147 {
"muplussigmaplus",
"#mu outward [#mum]", -5, 5},
148 {
"muminussigmaminus",
"#mu inward [#mum]", -5, 5},
149 {
"deltamusigmadeltamu",
"#Delta#mu [#mum]", -5, 10}};
151 if (
Variable.second.get_value<
string>() ==
"DrmsNR") {
152 DMRs = {{
"mu",
"RMS(x'_{pred}-x'_{hit} /#sigma)", -1.2, 1.2},
153 {
"sigma",
"#sigma_{RMS(x'_{pred}-x'_{hit} /#sigma)}", -6, 6},
154 {
"muplus",
"RMS(x'_{pred}-x'_{hit} /#sigma) outward", -1.2, 1.2},
155 {
"sigmaplus",
"#sigma_{#mu outward}", -6, 6},
156 {
"muminus",
"RMS(x'_{pred}-x'_{hit} /#sigma) inward", -1.2, 1.2},
157 {
"sigmaminus",
"#sigma_{RMS(x'_{pred}-x'_{hit} /#sigma) inward}", -6, 6},
158 {
"deltamu",
"#DeltaRMS(x'_{pred}-x'_{hit} /#sigma)", -0.15, 0.15},
159 {
"sigmadeltamu",
"#sigma_{#DeltaRMS(x'_{pred}-x'_{hit} /#sigma)}", -6, 6},
160 {
"musigma",
"RMS(x'_{pred}-x'_{hit} /#sigma)", -1.2, 1.2},
161 {
"muplussigmaplus",
"RMS(x'_{pred}-x'_{hit} /#sigma) outward", -1.2, 1.2},
162 {
"muminussigmaminus",
"RMS(x'_{pred}-x'_{hit} /#sigma) inward", -1.2, 1.2},
163 {
"deltamusigmadeltamu",
"#DeltaRMS(x'_{pred}-x'_{hit} /#sigma)", -0.15, 0.15}};
166 for (
const auto &structure : structures) {
167 TString structname = structure;
168 structname.ReplaceAll(
"_y",
"");
169 size_t layersnumber = nlayers.at(structname);
171 TString structtitle =
"";
172 if (structure.Contains(
"PIX") && !(structure.Contains(
"_y")))
173 structtitle = structure +
" (x)";
174 else if (structure.Contains(
"_y")) {
175 TString substring(structure(0, 4));
176 structtitle = substring +
" (y)";
178 structtitle = structure;
180 if (structure ==
"TID" || structure ==
"TEC" || structure ==
"FPIX" || structure ==
"FPIX_y")
181 structtitle +=
" disc ";
183 structtitle +=
" layer ";
184 structtitle +=
layer;
187 TString structandlayer = structure;
189 if (structure ==
"TID" || structure ==
"TEC")
190 structandlayer +=
"_disc";
192 structandlayer +=
"_layer";
193 structandlayer +=
layer;
196 for (
auto &
DMR : DMRs) {
199 if (
name.Contains(
"plus") ||
name.Contains(
"minus") ||
name.Contains(
"delta")) {
200 if (structname ==
"TEC" || structname ==
"TID")
207 Trend trend(Form(
"%s_%s_%s",
Variable.second.get_value<
string>().data(), structandlayer.Data(),
name.Data()),
215 lumiAxisType.data());
216 trend.
lgd.SetHeader(structtitle);
218 for (
auto const &
alignment : alignments) {
219 bool fullRange =
true;
220 if (
style.get_child(
"trends").count(
"earlyStops")) {
221 for (
auto const &earlyStop :
style.get_child(
"trends.earlyStops")) {
222 if (earlyStop.second.get_value<
string>() ==
alignment.first)
227 TString gtitle =
alignment.second.get<
string>(
"title");
228 TString gname = Form(
"%s_%s_%s_%s",
229 Variable.second.get_value<
string>().data(),
231 structandlayer.Data(),
233 gname.ReplaceAll(
" ",
"_");
234 auto g = Get<TGraphErrors>(gname);
237 g->SetMarkerSize(0.6);
238 int color =
alignment.second.get<
int>(
"color");
240 g->SetFillColorAlpha(color, 0.2);
241 g->SetMarkerColor(color);
243 g->SetLineColor(kWhite);
244 trend(
g,
"P2",
"pf", fullRange);
static const char * normal
void compileDMRTrends(std::vector< int > IOVlist, TString Variable, std::vector< std::string > inputFiles, std::vector< TString > structures, const std::map< TString, int > nlayers, bool FORCE=false)
std::string fullPath() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
static std::string to_string(const XMLCh *ch)
static std::string const input
year
get the greatest golden json
def DMR(config, validationDir)
static const float defaultConvertScale
static const int endRun2018
static const int startRun2016