]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix to prevent segmentation violation in case of no fit result
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Jan 2013 13:57:54 +0000 (13:57 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Jan 2013 13:57:54 +0000 (13:57 +0000)
returned from fitter.  This should never happen (famous last words)
but apparently does.  Please port to the release ASAP.

FMD/AliFMDQAChecker.cxx

index 32af8147b926d6dad0f39f052f48a7149d92026d..7c8f3b5ba05d6179bb60378feb8ee83bb7539a90 100644 (file)
@@ -464,6 +464,9 @@ AliFMDQAChecker::CheckFit(TH1* hist, const TFitResultPtr& res,
 {
   color = kGreen+4;
 
+  // Check if there's indeed a result - if not, flag as OK
+  if (!res.Get()) return 0;
+
   UShort_t   ret   = 0;
   Int_t      nPar  = res->NPar();
   Double_t   dy    = .06;
@@ -670,10 +673,9 @@ AliFMDQAChecker::CheckRaw(AliRecoParam::EventSpecie_t specie,
 
     // Set our fit function 
     TString fitOpt("QS");
-    TFitResultPtr res  = hist->Fit(func, fitOpt, "", low, high);
-
-    Int_t    color = func->GetLineColor();
-    UShort_t qual  = CheckFit(hist, res, low, high, color);
+    TFitResultPtr res   = hist->Fit(func, fitOpt, "", low, high);
+    Int_t         color = func->GetLineColor();
+    UShort_t      qual  = CheckFit(hist, res, low, high, color);
 
     // Make sure we save the function in the full range of the histogram
     func = hist->GetFunction("landauGaus");