]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
from Alex Kalweit:
authormkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Nov 2013 12:46:14 +0000 (12:46 +0000)
committermkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Nov 2013 12:46:14 +0000 (12:46 +0000)
constrain a fit better to avoid crashes

TPC/Calib/AliTPCPreprocessorOffline.cxx

index 0d4f549462c3a5b1b11015f6d4fc633a89a59651..1b8912ef09342084ddbd39c73c69acfb8e8a00ce 100644 (file)
@@ -1152,8 +1152,11 @@ Bool_t AliTPCPreprocessorOffline::AnalyzeGainMultiplicity() {
   //
   TObjArray arrMax;
   TObjArray arrTot;
-  histMultMax->FitSlicesY(0,0,-1,0,"QNR",&arrMax);
-  histMultTot->FitSlicesY(0,0,-1,0,"QNR",&arrTot);
+  TF1 fitGaus("fitGaus","gaus(0)",histMultMax->GetYaxis()->GetXmin(),histMultMax->GetYaxis()->GetXmax());
+  fitGaus.SetParameters(histMultMax->GetEntries()/10., histMultMax->GetMean(2), TMath::Sqrt(TMath::Abs(histMultMax->GetMean(2))));
+  histMultMax->FitSlicesY(&fitGaus,0,-1,1,"QNRB",&arrMax);
+  fitGaus.SetParameters(histMultTot->GetEntries()/10., histMultTot->GetMean(2), TMath::Sqrt(TMath::Abs(histMultTot->GetMean(2))));
+  histMultTot->FitSlicesY(&fitGaus,0,-1,1,"QNRB",&arrTot);
   //
   TH1D * meanMax = (TH1D*)arrMax.At(1);
   TH1D * meanTot = (TH1D*)arrTot.At(1);