4 namespace pt = boost::property_tree;
14 for (
const auto &childTree :
json) {
15 DirList.push_back(childTree.first.c_str());
24 gROOT->ProcessLine(
"gErrorIgnoreLevel = kError;");
26 ROOT::EnableThreadSafety();
27 TH1::AddDirectory(kFALSE);
29 std::ofstream
outfile(
"log.txt");
31 const Int_t nDirs_ =
DirList.size();
32 TString LegLabels[10];
36 std::vector<double>
runs;
37 std::vector<double> x_ticks;
38 std::vector<double> ex_ticks = {0.};
40 for (Int_t
j = 0;
j < nDirs_;
j++) {
46 std::vector<int> tempSwap;
48 std::sort(currentList.begin(), currentList.end());
64 std::ifstream lumifile(lumiInputFile.Data());
67 while (std::getline(lumifile,
line)) {
68 std::istringstream iss(
line);
70 if (!(iss >>
a >>
b)) {
73 int run = std::stoi(
a);
77 logWarning <<
" Run: " <<
run <<
" is not found in the intersection" << std::endl;
116 std::map<TString, std::vector<unrolledHisto> > dxyVect;
117 std::map<TString, std::vector<unrolledHisto> > dzVect;
119 logInfo <<
" pre do-stuff: " <<
runs.size() << std::endl;
132 auto extracts = procPool.Map(f_processData,
range);
136 return a.m_index <
b.m_index;
140 for (
auto extractedTrend : extracts) {
141 runs.insert(std::end(
runs), std::begin(extractedTrend.m_runs), std::end(extractedTrend.m_runs));
143 for (
const auto &
label : LegLabels) {
145 dxyPhiMeans_[
label].insert(std::end(dxyPhiMeans_[
label]),
146 std::begin(extractedTrend.m_dxyPhiMeans[
label]),
147 std::end(extractedTrend.m_dxyPhiMeans[
label]));
148 dxyPhiChi2_[
label].insert(std::end(dxyPhiChi2_[
label]),
149 std::begin(extractedTrend.m_dxyPhiChi2[
label]),
150 std::end(extractedTrend.m_dxyPhiChi2[
label]));
151 dxyPhiKS_[
label].insert(std::end(dxyPhiKS_[
label]),
152 std::begin(extractedTrend.m_dxyPhiKS[
label]),
153 std::end(extractedTrend.m_dxyPhiKS[
label]));
155 dxyPhiHi_[
label].insert(std::end(dxyPhiHi_[
label]),
156 std::begin(extractedTrend.m_dxyPhiHi[
label]),
157 std::end(extractedTrend.m_dxyPhiHi[
label]));
158 dxyPhiLo_[
label].insert(std::end(dxyPhiLo_[
label]),
159 std::begin(extractedTrend.m_dxyPhiLo[
label]),
160 std::end(extractedTrend.m_dxyPhiLo[
label]));
163 dzPhiMeans_[
label].insert(std::end(dzPhiMeans_[
label]),
164 std::begin(extractedTrend.m_dzPhiMeans[
label]),
165 std::end(extractedTrend.m_dzPhiMeans[
label]));
166 dzPhiChi2_[
label].insert(std::end(dzPhiChi2_[
label]),
167 std::begin(extractedTrend.m_dzPhiChi2[
label]),
168 std::end(extractedTrend.m_dzPhiChi2[
label]));
169 dzPhiKS_[
label].insert(std::end(dzPhiKS_[
label]),
170 std::begin(extractedTrend.m_dzPhiKS[
label]),
171 std::end(extractedTrend.m_dzPhiKS[
label]));
173 dzPhiHi_[
label].insert(std::end(dzPhiHi_[
label]),
174 std::begin(extractedTrend.m_dzPhiHi[
label]),
175 std::end(extractedTrend.m_dzPhiHi[
label]));
176 dzPhiLo_[
label].insert(std::end(dzPhiLo_[
label]),
177 std::begin(extractedTrend.m_dzPhiLo[
label]),
178 std::end(extractedTrend.m_dzPhiLo[
label]));
181 dxyEtaMeans_[
label].insert(std::end(dxyEtaMeans_[
label]),
182 std::begin(extractedTrend.m_dxyEtaMeans[
label]),
183 std::end(extractedTrend.m_dxyEtaMeans[
label]));
184 dxyEtaChi2_[
label].insert(std::end(dxyEtaChi2_[
label]),
185 std::begin(extractedTrend.m_dxyEtaChi2[
label]),
186 std::end(extractedTrend.m_dxyEtaChi2[
label]));
187 dxyEtaKS_[
label].insert(std::end(dxyEtaKS_[
label]),
188 std::begin(extractedTrend.m_dxyEtaKS[
label]),
189 std::end(extractedTrend.m_dxyEtaKS[
label]));
191 dxyEtaHi_[
label].insert(std::end(dxyEtaHi_[
label]),
192 std::begin(extractedTrend.m_dxyEtaHi[
label]),
193 std::end(extractedTrend.m_dxyEtaHi[
label]));
194 dxyEtaLo_[
label].insert(std::end(dxyEtaLo_[
label]),
195 std::begin(extractedTrend.m_dxyEtaLo[
label]),
196 std::end(extractedTrend.m_dxyEtaLo[
label]));
199 dzEtaMeans_[
label].insert(std::end(dzEtaMeans_[
label]),
200 std::begin(extractedTrend.m_dzEtaMeans[
label]),
201 std::end(extractedTrend.m_dzEtaMeans[
label]));
202 dzEtaChi2_[
label].insert(std::end(dzEtaChi2_[
label]),
203 std::begin(extractedTrend.m_dzEtaChi2[
label]),
204 std::end(extractedTrend.m_dzEtaChi2[
label]));
205 dzEtaKS_[
label].insert(std::end(dzEtaKS_[
label]),
206 std::begin(extractedTrend.m_dzEtaKS[
label]),
207 std::end(extractedTrend.m_dzEtaKS[
label]));
209 dzEtaHi_[
label].insert(std::end(dzEtaHi_[
label]),
210 std::begin(extractedTrend.m_dzEtaHi[
label]),
211 std::end(extractedTrend.m_dzEtaHi[
label]));
212 dzEtaLo_[
label].insert(std::end(dzEtaLo_[
label]),
213 std::begin(extractedTrend.m_dzEtaLo[
label]),
214 std::end(extractedTrend.m_dzEtaLo[
label]));
217 dxyVect[
label].insert(std::end(dxyVect[
label]),
218 std::begin(extractedTrend.m_dxyVect[
label]),
219 std::end(extractedTrend.m_dxyVect[
label]));
221 std::begin(extractedTrend.m_dzVect[
label]),
222 std::end(extractedTrend.m_dzVect[
label]));
227 for (
const auto &
label : LegLabels) {
228 for (
unsigned int it = 0;
it < dxyPhiMeans_[
label].size();
it++) {
236 <<
" loErr: " << dxyEtaLoErr_[
label][
it] << std::endl;
247 TGraph *g_dxy_phi_vs_run[nDirs_];
248 TGraphAsymmErrors *gerr_dxy_phi_vs_run[nDirs_];
249 TGraph *g_chi2_dxy_phi_vs_run[nDirs_];
250 TGraph *g_KS_dxy_phi_vs_run[nDirs_];
252 TGraph *g_dxy_phi_hi_vs_run[nDirs_];
253 TGraph *g_dxy_phi_lo_vs_run[nDirs_];
255 TGraph *g_dxy_eta_vs_run[nDirs_];
256 TGraphAsymmErrors *gerr_dxy_eta_vs_run[nDirs_];
257 TGraph *g_chi2_dxy_eta_vs_run[nDirs_];
258 TGraph *g_KS_dxy_eta_vs_run[nDirs_];
260 TGraph *g_dxy_eta_hi_vs_run[nDirs_];
261 TGraph *g_dxy_eta_lo_vs_run[nDirs_];
263 TGraph *g_dz_phi_vs_run[nDirs_];
264 TGraphAsymmErrors *gerr_dz_phi_vs_run[nDirs_];
265 TGraph *g_chi2_dz_phi_vs_run[nDirs_];
266 TGraph *g_KS_dz_phi_vs_run[nDirs_];
268 TGraph *g_dz_phi_hi_vs_run[nDirs_];
269 TGraph *g_dz_phi_lo_vs_run[nDirs_];
271 TGraph *g_dz_eta_vs_run[nDirs_];
272 TGraphAsymmErrors *gerr_dz_eta_vs_run[nDirs_];
273 TGraph *g_chi2_dz_eta_vs_run[nDirs_];
274 TGraph *g_KS_dz_eta_vs_run[nDirs_];
276 TGraph *g_dz_eta_hi_vs_run[nDirs_];
277 TGraph *g_dz_eta_lo_vs_run[nDirs_];
281 TH1F *h_RMS_dxy_phi_vs_run[nDirs_];
282 TH1F *h_RMS_dxy_eta_vs_run[nDirs_];
283 TH1F *h_RMS_dz_phi_vs_run[nDirs_];
284 TH1F *h_RMS_dz_eta_vs_run[nDirs_];
288 TH2F *h2_scatter_dxy_vs_run[nDirs_];
289 TH2F *h2_scatter_dz_vs_run[nDirs_];
292 TString theType =
"run number";
293 TString theTypeLabel =
"run number";
301 for (Int_t
j = 0;
j < nDirs_;
j++) {
303 logInfo <<
"x_ticks.size()= " << x_ticks.size() <<
" dxyPhiMeans_[LegLabels[" <<
j 304 <<
"]].size()=" << dxyPhiMeans_[LegLabels[
j]].size() << std::endl;
307 assert(x_ticks.size() == dxyPhiMeans_[LegLabels[
j]].size());
314 pv::wrappedTrends(dxyPhiMeans_, dxyPhiLo_, dxyPhiHi_, dxyPhiLoErr_, dxyPhiHiErr_, dxyPhiChi2_, dxyPhiKS_);
320 g_chi2_dxy_phi_vs_run[
j],
321 g_KS_dxy_phi_vs_run[
j],
322 g_dxy_phi_lo_vs_run[
j],
323 g_dxy_phi_hi_vs_run[
j],
324 gerr_dxy_phi_vs_run[
j],
325 h_RMS_dxy_phi_vs_run,
336 pv::wrappedTrends(dxyEtaMeans_, dxyEtaLo_, dxyEtaHi_, dxyEtaLoErr_, dxyEtaHiErr_, dxyEtaChi2_, dxyEtaKS_);
342 g_chi2_dxy_eta_vs_run[
j],
343 g_KS_dxy_eta_vs_run[
j],
344 g_dxy_eta_lo_vs_run[
j],
345 g_dxy_eta_hi_vs_run[
j],
346 gerr_dxy_eta_vs_run[
j],
347 h_RMS_dxy_eta_vs_run,
358 pv::wrappedTrends(dzPhiMeans_, dzPhiLo_, dzPhiHi_, dzPhiLoErr_, dzPhiHiErr_, dzPhiChi2_, dzPhiKS_);
364 g_chi2_dz_phi_vs_run[
j],
365 g_KS_dz_phi_vs_run[
j],
366 g_dz_phi_lo_vs_run[
j],
367 g_dz_phi_hi_vs_run[
j],
368 gerr_dz_phi_vs_run[
j],
380 pv::wrappedTrends(dzEtaMeans_, dzEtaLo_, dzEtaHi_, dzEtaLoErr_, dzEtaHiErr_, dzEtaChi2_, dzEtaKS_);
386 g_chi2_dz_eta_vs_run[
j],
387 g_KS_dz_eta_vs_run[
j],
388 g_dz_eta_lo_vs_run[
j],
389 g_dz_eta_hi_vs_run[
j],
390 gerr_dz_eta_vs_run[
j],
401 h2_scatter_dxy_vs_run[
j] =
402 new TH2F(Form(
"h2_scatter_dxy_%s", LegLabels[
j].Data()),
403 Form(
"scatter of d_{xy} vs %s;%s;d_{xy} [cm]", theType.Data(), theTypeLabel.Data()),
406 dxyVect[LegLabels[
j]][0].get_n_bins(),
407 dxyVect[LegLabels[
j]][0].get_y_min(),
408 dxyVect[LegLabels[
j]][0].get_y_max());
409 h2_scatter_dxy_vs_run[
j]->SetStats(kFALSE);
410 h2_scatter_dxy_vs_run[
j]->SetTitle(LegLabels[
j]);
413 for (
unsigned int binindex = 0; binindex < dxyVect[LegLabels[
j]][
runindex].get_n_bins(); binindex++) {
414 h2_scatter_dxy_vs_run[
j]->SetBinContent(
runindex + 1,
416 dxyVect[LegLabels[
j]][
runindex].get_bin_contents().at(binindex) /
417 dxyVect[LegLabels[
j]][
runindex].get_integral());
425 h2_scatter_dz_vs_run[
j] =
426 new TH2F(Form(
"h2_scatter_dz_%s", LegLabels[
j].Data()),
427 Form(
"scatter of d_{z} vs %s;%s;d_{z} [cm]", theType.Data(), theTypeLabel.Data()),
430 dzVect[LegLabels[
j]][0].get_n_bins(),
431 dzVect[LegLabels[
j]][0].get_y_min(),
432 dzVect[LegLabels[
j]][0].get_y_max());
433 h2_scatter_dz_vs_run[
j]->SetStats(kFALSE);
434 h2_scatter_dz_vs_run[
j]->SetTitle(LegLabels[
j]);
437 for (
unsigned int binindex = 0; binindex < dzVect[LegLabels[
j]][
runindex].get_n_bins(); binindex++) {
438 h2_scatter_dz_vs_run[
j]->SetBinContent(
runindex + 1,
440 dzVect[LegLabels[
j]][
runindex].get_bin_contents().at(binindex) /
441 dzVect[LegLabels[
j]][
runindex].get_integral());
445 TString modified_label = (LegLabels[
j].ReplaceAll(
" ",
"_"));
446 g_dxy_phi_vs_run[
j]->Write(
"mean_" + modified_label +
"_dxy_phi_vs_run");
447 g_chi2_dxy_phi_vs_run[
j]->Write(
"chi2_" + modified_label +
"_dxy_phi_vs_run");
448 g_KS_dxy_phi_vs_run[
j]->Write(
"KS_" + modified_label +
"_dxy_phi_vs_run");
449 g_dxy_phi_hi_vs_run[
j]->Write(
"hi_" + modified_label +
"_dxy_phi_hi_vs_run");
450 g_dxy_phi_lo_vs_run[
j]->Write(
"lo_" + modified_label +
"_dxy_phi_lo_vs_run");
452 g_dxy_eta_vs_run[
j]->Write(
"mean_" + modified_label +
"_dxy_eta_vs_run");
453 g_chi2_dxy_eta_vs_run[
j]->Write(
"chi2_" + modified_label +
"_dxy_eta_vs_run");
454 g_KS_dxy_eta_vs_run[
j]->Write(
"KS_" + modified_label +
"_dxy_eta_vs_run");
455 g_dxy_eta_hi_vs_run[
j]->Write(
"hi_" + modified_label +
"_dxy_eta_hi_vs_run");
456 g_dxy_eta_lo_vs_run[
j]->Write(
"lo_" + modified_label +
"_dxy_eta_lo_vs_run");
458 g_dz_phi_vs_run[
j]->Write(
"mean_" + modified_label +
"_dz_phi_vs_run");
459 g_chi2_dz_phi_vs_run[
j]->Write(
"chi2_" + modified_label +
"_dz_phi_vs_run");
460 g_KS_dz_phi_vs_run[
j]->Write(
"KS_" + modified_label +
"_dz_phi_vs_run");
461 g_dz_phi_hi_vs_run[
j]->Write(
"hi_" + modified_label +
"_dz_phi_hi_vs_run");
462 g_dz_phi_lo_vs_run[
j]->Write(
"lo_" + modified_label +
"_dz_phi_lo_vs_run");
464 g_dz_eta_vs_run[
j]->Write(
"mean_" + modified_label +
"_dz_eta_vs_run");
465 g_chi2_dz_eta_vs_run[
j]->Write(
"chi2_" + modified_label +
"_dz_eta_vs_run");
466 g_KS_dz_eta_vs_run[
j]->Write(
"KS_" + modified_label +
"_dz_eta_vs_run");
467 g_dz_eta_hi_vs_run[
j]->Write(
"hi_" + modified_label +
"_dz_eta_hi_vs_run");
468 g_dz_eta_lo_vs_run[
j]->Write(
"lo_" + modified_label +
"_dz_eta_lo_vs_run");
470 h_RMS_dxy_phi_vs_run[
j]->Write(
"RMS_" + modified_label +
"_dxy_phi_vs_run");
471 h_RMS_dxy_eta_vs_run[
j]->Write(
"RMS_" + modified_label +
"_dxy_eta_vs_run");
472 h_RMS_dz_phi_vs_run[
j]->Write(
"RMS_" + modified_label +
"_dz_phi_vs_run");
473 h_RMS_dz_eta_vs_run[
j]->Write(
"RMS_" + modified_label +
"_dz_eta_vs_run");
477 h2_scatter_dxy_vs_run[
j]->Write(
"Scatter_" + modified_label +
"_dxy_vs_run");
478 h2_scatter_dz_vs_run[
j]->Write(
"Scatter_" + modified_label +
"_dz_vs_run");
482 for (
int iDir = 0; iDir < nDirs_; iDir++) {
483 delete g_dxy_phi_vs_run[iDir];
484 delete g_chi2_dxy_phi_vs_run[iDir];
485 delete g_KS_dxy_phi_vs_run[iDir];
486 delete g_dxy_phi_hi_vs_run[iDir];
487 delete g_dxy_phi_lo_vs_run[iDir];
489 delete g_dxy_eta_vs_run[iDir];
490 delete g_chi2_dxy_eta_vs_run[iDir];
491 delete g_KS_dxy_eta_vs_run[iDir];
492 delete g_dxy_eta_hi_vs_run[iDir];
493 delete g_dxy_eta_lo_vs_run[iDir];
495 delete g_dz_phi_vs_run[iDir];
496 delete g_chi2_dz_phi_vs_run[iDir];
497 delete g_KS_dz_phi_vs_run[iDir];
498 delete g_dz_phi_hi_vs_run[iDir];
499 delete g_dz_phi_lo_vs_run[iDir];
501 delete g_dz_eta_vs_run[iDir];
502 delete g_chi2_dz_eta_vs_run[iDir];
503 delete g_KS_dz_eta_vs_run[iDir];
504 delete g_dz_eta_hi_vs_run[iDir];
505 delete g_dz_eta_lo_vs_run[iDir];
507 delete h_RMS_dxy_phi_vs_run[iDir];
508 delete h_RMS_dxy_eta_vs_run[iDir];
509 delete h_RMS_dz_phi_vs_run[iDir];
510 delete h_RMS_dz_eta_vs_run[iDir];
512 delete h2_scatter_dxy_vs_run[iDir];
513 delete h2_scatter_dz_vs_run[iDir];
528 const std::vector<double> &ticks,
529 const std::vector<double> &ex_ticks,
535 TGraphAsymmErrors *&g_asym,
540 const TString &
label)
543 g_mean =
new TGraph(ticks.size(), &(ticks[0]), &((allInputs.
getMean()[
label])[0]));
544 g_chi2 =
new TGraph(ticks.size(), &(ticks[0]), &((allInputs.
getChi2()[
label])[0]));
545 g_KS =
new TGraph(ticks.size(), &(ticks[0]), &((allInputs.
getKS()[
label])[0]));
546 g_high =
new TGraph(ticks.size(), &(ticks[0]), &((allInputs.
getHigh()[
label])[0]));
547 g_low =
new TGraph(ticks.size(), &(ticks[0]), &((allInputs.
getLow()[
label])[0]));
549 g_asym =
new TGraphAsymmErrors(ticks.size(),
557 g_mean->SetTitle(
label);
558 g_asym->SetTitle(
label);
561 std::vector<double> newTicks = ticks;
562 newTicks.insert(newTicks.end(), ticks.back() + 1.);
563 h_RMS[
index] =
new TH1F(Form(
"h_RMS_dz_eta_%s",
label.Data()),
label, newTicks.size() - 1, &(newTicks[0]));
564 h_RMS[
index]->SetStats(kFALSE);
566 for (
size_t bincounter = 1; bincounter < ticks.size() + 1; bincounter++) {
567 h_RMS[
index]->SetBinContent(
569 h_RMS[
index]->SetBinError(bincounter, 0.01);
581 std::vector<int> theRunNumbers;
584 TList *
files =
dir.GetListOfFiles();
589 while ((
file = (TSystemFile *)
next())) {
591 if (!
file->IsDirectory() &&
fname.EndsWith(
ext) &&
fname.BeginsWith(
"PVValidation")) {
594 TString theRun =
bits->At(2)->GetName();
596 TString formatRun = (theRun.ReplaceAll(
".root",
"")).ReplaceAll(
"_",
"");
598 theRunNumbers.push_back(formatRun.Atoi());
602 return theRunNumbers;
617 TH1F *hzero =
new TH1F(Form(
"hconst_%s_%i",
hist->GetName(), iter),
618 Form(
"hconst_%s_%i",
hist->GetName(), iter),
622 for (Int_t
i = 0;
i <= hzero->GetNbinsX();
i++) {
623 hzero->SetBinContent(
i, theConst);
624 hzero->SetBinError(
i,
hist->GetBinError(
i));
626 hzero->SetLineWidth(2);
627 hzero->SetLineStyle(9);
628 hzero->SetLineColor(kMagenta);
646 Double_t y_min = -0.1;
647 Double_t y_max = 0.1;
650 for (
int j = 0;
j <
hist->GetNbinsX();
j++) {
671 logError <<
"No bins in the input histogram";
676 double *
y =
new double[
nbins];
682 y[
j] =
hist->GetBinContent(
j + 1);
683 if (
hist->GetBinError(
j + 1) != 0.) {
684 err[
j] = 1. / (
hist->GetBinError(
j + 1) *
hist->GetBinError(
j + 1));
696 Double_t
max =
hist->GetMaximum();
697 Double_t
min =
hist->GetMinimum();
700 hist->Fit(
"pol0",
"Q0+");
701 TF1 *
f = (TF1 *)
hist->FindObject(
"pol0");
704 Double_t
chi2 =
f->GetChisquare();
705 Int_t ndf =
f->GetNDF();
710 Double_t ksScore =
std::max(-20., TMath::Log10(
displaced->KolmogorovTest(theZero)));
736 const char *
dirs[10],
737 TString LegLabels[10],
739 const size_t nWorkers,
747 unsigned int pitch = std::floor(
intersection.size() / effSize);
748 unsigned int first = iter * pitch;
749 unsigned int last = (iter == (effSize - 1)) ?
intersection.size() : ((iter + 1) * pitch);
751 logInfo <<
"iter:" << iter <<
"| pitch: " << pitch <<
" [" <<
first <<
"-" <<
last <<
")" << std::endl;
768 TH1F *dxyPhiMeanTrend[nDirs_];
769 TH1F *dxyPhiWidthTrend[nDirs_];
770 TH1F *dzPhiMeanTrend[nDirs_];
771 TH1F *dzPhiWidthTrend[nDirs_];
783 TH1F *dxyEtaMeanTrend[nDirs_];
784 TH1F *dxyEtaWidthTrend[nDirs_];
785 TH1F *dzEtaMeanTrend[nDirs_];
786 TH1F *dzEtaWidthTrend[nDirs_];
788 TH1F *dxyNormPhiWidthTrend[nDirs_];
789 TH1F *dxyNormEtaWidthTrend[nDirs_];
790 TH1F *dzNormPhiWidthTrend[nDirs_];
791 TH1F *dzNormEtaWidthTrend[nDirs_];
793 TH1F *dxyNormPtWidthTrend[nDirs_];
794 TH1F *dzNormPtWidthTrend[nDirs_];
795 TH1F *dxyPtWidthTrend[nDirs_];
796 TH1F *dzPtWidthTrend[nDirs_];
798 TH1F *dxyIntegralTrend[nDirs_];
799 TH1F *dzIntegralTrend[nDirs_];
801 bool areAllFilesOK =
true;
805 for (Int_t
j = 0;
j < nDirs_;
j++) {
810 fins[
j] =
new TFile(Form(
"%s/PVValidation_%s_%i.root",
dirs[
j], stem.c_str(),
intersection[
n]));
811 if (fins[
j]->IsZombie()) {
813 <<
" is a Zombie! cannot combine" << std::endl;
814 areAllFilesOK =
false;
821 <<
" has size: " << fins[
j]->GetSize() <<
" b ";
825 TH1F *h_tracks = (TH1F *)fins[
j]->
Get(
"PVValidation/EventFeatures/h_nTracks");
826 Double_t
numEvents = h_tracks->GetEntries();
831 areAllFilesOK =
false;
838 areAllFilesOK =
false;
844 dxyPhiMeanTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/MeanTrends/means_dxy_phi");
845 dxyPhiWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dxy_phi");
846 dzPhiMeanTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/MeanTrends/means_dz_phi");
847 dzPhiWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dz_phi");
854 dxyEtaMeanTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/MeanTrends/means_dxy_eta");
855 dxyEtaWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dxy_eta");
856 dzEtaMeanTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/MeanTrends/means_dz_eta");
857 dzEtaWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dz_eta");
864 dxyNormPhiWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dxy_phi");
865 dxyNormEtaWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dxy_eta");
866 dzNormPhiWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dz_phi");
867 dzNormEtaWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dz_eta");
869 dxyNormPtWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dxy_pTCentral");
870 dzNormPtWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/norm_widths_dz_pTCentral");
871 dxyPtWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dxy_pTCentral");
872 dzPtWidthTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/WidthTrends/widths_dz_pTCentral");
874 dxyIntegralTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/ProbeTrackFeatures/h_probedxyRefitV");
875 dzIntegralTrend[
j] = (TH1F *)fins[
j]->
Get(
"PVValidation/ProbeTrackFeatures/h_probedzRefitV");
879 auto dxyPhiBiases =
getBiases(dxyPhiMeanTrend[
j]);
886 ret.m_dxyPhiMeans[LegLabels[
j]].push_back(dxyPhiBiases.getWeightedMean());
887 ret.m_dxyPhiChi2[LegLabels[
j]].push_back(TMath::Log10(dxyPhiBiases.getNormChi2()));
888 ret.m_dxyPhiKS[LegLabels[
j]].push_back(dxyPhiBiases.getKSScore());
893 ?
ret.m_dxyPhiLo[LegLabels[
j]].push_back(dxyPhiBiases.getWeightedMean() - 2 * dxyPhiBiases.getWeightedRMS())
894 :
ret.m_dxyPhiLo[LegLabels[
j]].push_back(dxyPhiBiases.getMin());
896 ?
ret.m_dxyPhiHi[LegLabels[
j]].push_back(dxyPhiBiases.getWeightedMean() + 2 * dxyPhiBiases.getWeightedRMS())
897 :
ret.m_dxyPhiHi[LegLabels[
j]].push_back(dxyPhiBiases.getMax());
899 auto dxyEtaBiases =
getBiases(dxyEtaMeanTrend[
j]);
900 ret.m_dxyEtaMeans[LegLabels[
j]].push_back(dxyEtaBiases.getWeightedMean());
901 ret.m_dxyEtaChi2[LegLabels[
j]].push_back(TMath::Log10(dxyEtaBiases.getNormChi2()));
902 ret.m_dxyEtaKS[LegLabels[
j]].push_back(dxyEtaBiases.getKSScore());
904 ?
ret.m_dxyEtaLo[LegLabels[
j]].push_back(dxyEtaBiases.getWeightedMean() - 2 * dxyEtaBiases.getWeightedRMS())
905 :
ret.m_dxyEtaLo[LegLabels[
j]].push_back(dxyEtaBiases.getMin());
907 ?
ret.m_dxyEtaHi[LegLabels[
j]].push_back(dxyEtaBiases.getWeightedMean() + 2 * dxyEtaBiases.getWeightedRMS())
908 :
ret.m_dxyEtaHi[LegLabels[
j]].push_back(dxyEtaBiases.getMax());
910 auto dzPhiBiases =
getBiases(dzPhiMeanTrend[
j]);
911 ret.m_dzPhiMeans[LegLabels[
j]].push_back(dzPhiBiases.getWeightedMean());
912 ret.m_dzPhiChi2[LegLabels[
j]].push_back(TMath::Log10(dzPhiBiases.getNormChi2()));
913 ret.m_dzPhiKS[LegLabels[
j]].push_back(dzPhiBiases.getKSScore());
914 useRMS ?
ret.m_dzPhiLo[LegLabels[
j]].push_back(dzPhiBiases.getWeightedMean() - 2 * dzPhiBiases.getWeightedRMS())
915 :
ret.m_dzPhiLo[LegLabels[
j]].push_back(dzPhiBiases.getMin());
916 useRMS ?
ret.m_dzPhiHi[LegLabels[
j]].push_back(dzPhiBiases.getWeightedMean() + 2 * dzPhiBiases.getWeightedRMS())
917 :
ret.m_dzPhiHi[LegLabels[
j]].push_back(dzPhiBiases.getMax());
919 auto dzEtaBiases =
getBiases(dzEtaMeanTrend[
j]);
920 ret.m_dzEtaMeans[LegLabels[
j]].push_back(dzEtaBiases.getWeightedMean());
921 ret.m_dzEtaChi2[LegLabels[
j]].push_back(TMath::Log10(dzEtaBiases.getNormChi2()));
922 ret.m_dzEtaKS[LegLabels[
j]].push_back(dzEtaBiases.getKSScore());
923 useRMS ?
ret.m_dzEtaLo[LegLabels[
j]].push_back(dzEtaBiases.getWeightedMean() - 2 * dzEtaBiases.getWeightedRMS())
924 :
ret.m_dzEtaLo[LegLabels[
j]].push_back(dzEtaBiases.getMin());
925 useRMS ?
ret.m_dzEtaHi[LegLabels[
j]].push_back(dzEtaBiases.getWeightedMean() + 2 * dzEtaBiases.getWeightedRMS())
926 :
ret.m_dzEtaHi[LegLabels[
j]].push_back(dzEtaBiases.getMax());
933 if (!areAllFilesOK) {
935 logWarning <<
"====> not all files are OK" << std::endl;
937 for (
int i = 0;
i < lastOpen;
i++) {
946 logInfo <<
"I am still here - runs.size(): " <<
ret.m_runs.size() << std::endl;
951 for (
int i = 0;
i < nDirs_;
i++) {
952 delete dxyPhiMeanTrend[
i];
953 delete dzPhiMeanTrend[
i];
954 delete dxyEtaMeanTrend[
i];
955 delete dzEtaMeanTrend[
i];
957 delete dxyPhiWidthTrend[
i];
958 delete dzPhiWidthTrend[
i];
959 delete dxyEtaWidthTrend[
i];
960 delete dzEtaWidthTrend[
i];
962 delete dxyNormPhiWidthTrend[
i];
963 delete dxyNormEtaWidthTrend[
i];
964 delete dzNormPhiWidthTrend[
i];
965 delete dzNormEtaWidthTrend[
i];
967 delete dxyNormPtWidthTrend[
i];
968 delete dzNormPtWidthTrend[
i];
969 delete dxyPtWidthTrend[
i];
970 delete dzPtWidthTrend[
i];
Structure biases Contains characterization of a single run PV bias plot.
Structure outPVtrends Contains the ensemble of all the alignmentTrends built by the functor...
alignmentTrend getHighErr() const
std::vector< std::string > LabelList
ret
prodAgent to be discontinued
void multiRunPVValidation(bool useRMS=true, TString lumiInputFile="", bool doUnitTest=false)
alignmentTrend getMean() const
alignmentTrend getLowErr() const
static outPVtrends processData(size_t iter, std::vector< int > intersection, const Int_t nDirs_, const char *dirs[10], TString LegLabels[10], bool useRMS, const size_t nWorkers, bool doUnitTest)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > list_files(const char *dirname=".", const char *ext=".root")
Structure wrappedTrends Contains the ensemble vs run number of the alignmentTrend characterization...
Structure bundle Contains the ensemble of all the information to build the graphs alignmentTrends...
double intersection(double r12)
alignmentTrend getHigh() const
void setDirsAndLabels(boost::property_tree::ptree &json)
Abs< T >::type abs(const T &t)
const char * outputFileName_
void outputGraphs(const pv::wrappedTrends &allInputs, const std::vector< double > &ticks, const std::vector< double > &ex_ticks, TGraph *&g_mean, TGraph *&g_chi2, TGraph *&g_KS, TGraph *&g_low, TGraph *&g_high, TGraphAsymmErrors *&g_asym, TH1F *h_RMS[], const pv::bundle &mybundle, const pv::view &theView, const int index, const TString &label)
static TH1F * drawConstantWithErr(TH1F *hist, Int_t iter, Double_t theConst)
static unrolledHisto getUnrolledHisto(TH1F *hist)
alignmentTrend getKS() const
std::map< TString, std::vector< double > > alignmentTrend
std::vector< std::string > DirList
static int position[264][3]
alignmentTrend getChi2() const
alignmentTrend getLow() const
static pv::biases getBiases(TH1F *hist)
PreparePVTrends(const char *outputFileName, int nWorkers, boost::property_tree::ptree &json)