From 0e1b7412e1c1ec939857ec2acf34319289f5c785 Mon Sep 17 00:00:00 2001 From: zampolli Date: Mon, 1 Sep 2014 15:13:53 +0200 Subject: [PATCH] Fix on vertex uncertainties evaluation in case SPD vertex used for MeanVertex calibration (D. Caffarri) --- .../ITS/AliMeanVertexPreprocessorOffline.cxx | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx index 285a097db37..e3bf8ec5814 100644 --- a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx +++ b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx @@ -211,10 +211,10 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD if ((useTRKvtx==kFALSE) && (useITSSAvtx==kFALSE)){ AliError(Form("Also SPD vertex histograms have too few entries for fitting, return")); fStatus=kLowStatistics; - return; + return; } } - + if((nEntriesX == 0.)&&(nEntriesY==0.) && (nEntriesZ>0.)){ vertexerSPD3Doff = kTRUE; AliWarning("Vertexer SPD 3D off"); @@ -305,6 +305,7 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD histSPDvtxX ->Fit("gaus", "M"); fitVtxX = histSPDvtxX -> GetFunction("gaus"); xMeanVtx = fitVtxX -> GetParameter(1); + xSigmaVtx = fitVtxX -> GetParameter(2); if (TMath::Abs(xMeanVtx) > 2.) { xMeanVtx = 0.; writeMeanVertexSPD=kTRUE; @@ -313,6 +314,7 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD histSPDvtxY ->Fit("gaus", "M"); fitVtxY = histSPDvtxY -> GetFunction("gaus"); yMeanVtx = fitVtxY -> GetParameter(1); + ySigmaVtx = fitVtxY -> GetParameter(2); if (TMath::Abs(yMeanVtx) > 2.) { yMeanVtx = 0.; writeMeanVertexSPD=kTRUE; @@ -611,28 +613,28 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD if (highMultEnvironment==kTRUE || highMultppEnvironment==kTRUE){ - projXvsMult -> Fit("gaus", "M", "", -0.4, 0.4); - sigmaFitX = projXvsMult -> GetFunction("gaus"); - xSigmaMult = sigmaFitX->GetParameter(2); - - if ((xSigmaMult <0) || (xSigmaMult>0.03)){ - AliWarning(Form("Problems with luminosiy region determination, update of the postion only")); - xSigmaMult = 0.; - xSigmaVtx = 0.0120; - fStatus=kLumiRegCovMatrixProblem; + projXvsMult -> Fit("gaus", "M", "", -0.4, 0.4); + sigmaFitX = projXvsMult -> GetFunction("gaus"); + xSigmaMult = sigmaFitX->GetParameter(2); + + if ((xSigmaMult <0) || (xSigmaMult>0.03)){ + AliWarning(Form("Problems with luminosiy region determination, update of the postion only")); + xSigmaMult = 0.; + xSigmaVtx = 0.0120; + fStatus=kLumiRegCovMatrixProblem; + } + else{ + xSigmaVtx = xSigmaMult; + xSigmaVtx = xSigmaVtx*1.1; } - else{ - xSigmaVtx = xSigmaMult; - xSigmaVtx = xSigmaVtx*1.1; - } - - projYvsMult -> Fit("gaus", "M", "", -0.2, 0.5); - TCanvas *c = new TCanvas("nwC", "nwC"); - c->cd(); - projYvsMult->Draw(); + + projYvsMult -> Fit("gaus", "M", "", -0.2, 0.5); + TCanvas *c = new TCanvas("nwC", "nwC"); + c->cd(); + projYvsMult->Draw(); sigmaFitY = projYvsMult -> GetFunction("gaus"); ySigmaMult = sigmaFitY->GetParameter(2); - + if ((ySigmaMult <0) || (ySigmaMult>0.03)){ AliWarning(Form("Problems with luminosiy region determination, update of the postion only")); ySigmaMult = 0.; @@ -643,12 +645,12 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD ySigmaVtx = ySigmaMult; ySigmaVtx = ySigmaVtx*1.1; } - + TProfile *htrkXZ = histTRKVertexXZ ->ProfileY(); htrkXZ -> Fit("pol1", "M", "", -10., 10.); corrFit = htrkXZ->GetFunction("pol1"); corrXZ = corrFit->GetParameter(1); - + if (TMath::Abs(corrXZ) > 0.01) { AliWarning(Form("Problems in the correlation fitting, not update the covariance matrix")); corrXZ =0.; @@ -658,12 +660,12 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD covarXZ = corrXZ * zSigmaVtx*zSigmaVtx; } - + TProfile *htrkYZ = histTRKVertexYZ ->ProfileY(); htrkYZ -> Fit("pol1", "M", "", -10., 10.); corrFit = htrkYZ->GetFunction("pol1"); corrYZ = corrFit->GetParameter(1); - + if (TMath::Abs(corrYZ) > 0.01) { AliWarning(Form("Problems in the correlation fitting, not update the covariance matrix")); corrYZ =0.; @@ -672,9 +674,9 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCD else{ covarYZ = corrYZ*zSigmaVtx*zSigmaVtx; } - + } - + Double_t position[3], covMatrix[6]; Double_t chi2=1.; Int_t nContr=1; -- 2.43.0