Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0.X] fix alignment validation plotting macro #28527

Merged
merged 2 commits into from
Dec 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Alignment/OfflineValidation/macros/FitPVResiduals.C
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void FitPVResiduals(TString namesandlabels, bool stdres, bool do2DMaps, TString

// residuals vs pT

for (Int_t l = 0; l < thePTBINS[i]; l++) {
for (Int_t l = 0; l < thePTBINS[i] - 1; l++) {
dxyPtResiduals[i][l] = (TH1F *)fins[i]->Get(Form("PVValidation/Abs_Transv_pT_Residuals/histo_dxy_pT_plot%i", l));
dzPtResiduals[i][l] = (TH1F *)fins[i]->Get(Form("PVValidation/Abs_Long_pT_Residuals/histo_dz_pT_plot%i", l));

Expand Down Expand Up @@ -797,6 +797,12 @@ void FitPVResiduals(TString namesandlabels, bool stdres, bool do2DMaps, TString
return;
} else {
nBins_ = theNBINS[0];

// adjust also the limit for the fit
_boundSx = (nBins_ / 4.) - 0.5;
_boundDx = 3 * (nBins_ / 4.) - 0.5;
_boundMax = nBins_ - 0.5;

std::cout << "======================================================" << std::endl;
std::cout << "FitPVResiduals::FitPVResiduals(): the number of bins is: " << nBins_ << std::endl;
std::cout << "======================================================" << std::endl;
Expand Down Expand Up @@ -1601,7 +1607,6 @@ void FitPVResiduals(TString namesandlabels, bool stdres, bool do2DMaps, TString

dxyLadderTrend->SaveAs("dxyLadderTrend_" + theStrDate + theStrAlignment + ".pdf");
dxyLadderTrend->SaveAs("dxyLadderTrend_" + theStrDate + theStrAlignment + ".png");
dxyLadderTrend->SaveAs("dxyLadderTrend_" + theStrDate + theStrAlignment + ".root");

delete dxyLadderTrend;
}
Expand Down Expand Up @@ -2023,7 +2028,8 @@ void arrangeBiasCanvas(TCanvas *canv,
if (theTitle.Contains("Norm"))
safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? 1. : safeDelta;
else
safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? 50. : safeDelta;
safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? safeDelta * 10.
: safeDelta;

dBiasTrend[k][i]->GetYaxis()->SetRangeUser(0., theExtreme + (safeDelta / 2.));
} else {
Expand All @@ -2034,6 +2040,9 @@ void arrangeBiasCanvas(TCanvas *canv,
TGaxis::SetMaxDigits(4);
dBiasTrend[k][i]->GetYaxis()->SetRangeUser(0., theExtreme + (safeDelta * 2.));
} else {
safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? safeDelta * 10.
: safeDelta;

dBiasTrend[k][i]->GetYaxis()->SetRangeUser(-theExtreme - (safeDelta / 2.), theExtreme + (safeDelta / 2.));
}
}
Expand Down