From ac89f5fd95000d782db0635ba6de4424a8e799e6 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 29 Nov 2019 14:24:57 +0100 Subject: [PATCH 1/2] fix PV Validation plotting macro to work in 11.0.X --- .../OfflineValidation/macros/FitPVResiduals.C | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Alignment/OfflineValidation/macros/FitPVResiduals.C b/Alignment/OfflineValidation/macros/FitPVResiduals.C index 152653b96365c..831616f2e9858 100644 --- a/Alignment/OfflineValidation/macros/FitPVResiduals.C +++ b/Alignment/OfflineValidation/macros/FitPVResiduals.C @@ -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)); @@ -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; @@ -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; } @@ -2023,7 +2028,7 @@ 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 { @@ -2034,6 +2039,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.)); } } From 5473bf3ccb5e7f4c8ce6fe83b810cd3520fe9b98 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 29 Nov 2019 17:57:52 +0100 Subject: [PATCH 2/2] code-format --- Alignment/OfflineValidation/macros/FitPVResiduals.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Alignment/OfflineValidation/macros/FitPVResiduals.C b/Alignment/OfflineValidation/macros/FitPVResiduals.C index 831616f2e9858..35491600f99b2 100644 --- a/Alignment/OfflineValidation/macros/FitPVResiduals.C +++ b/Alignment/OfflineValidation/macros/FitPVResiduals.C @@ -723,7 +723,7 @@ void FitPVResiduals(TString namesandlabels, bool stdres, bool do2DMaps, TString // residuals vs pT - for (Int_t l = 0; l < thePTBINS[i]-1; 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)); @@ -2028,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) ? safeDelta*10. : safeDelta; + safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? safeDelta * 10. + : safeDelta; dBiasTrend[k][i]->GetYaxis()->SetRangeUser(0., theExtreme + (safeDelta / 2.)); } else { @@ -2039,8 +2040,8 @@ 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; + safeDelta = (theTitle.Contains("ladder") == true || theTitle.Contains("modZ") == true) ? safeDelta * 10. + : safeDelta; dBiasTrend[k][i]->GetYaxis()->SetRangeUser(-theExtreme - (safeDelta / 2.), theExtreme + (safeDelta / 2.)); }