]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCPointCorrection.cxx
Avoiding crash in crash in GetELossRandomKFastR
[u/mrichter/AliRoot.git] / TPC / AliTPCPointCorrection.cxx
index fb46aaa92dad65bd291e310c935f74b5e8c89dd2..28afd3c17fd0302e38231e31769a753e4bc25737 100644 (file)
@@ -28,7 +28,7 @@
     
 */
 
-
+#include "AliTPCcalibDB.h"
 #include "TLinearFitter.h"
 #include "Riostream.h"
 #include "TList.h"
@@ -229,7 +229,11 @@ Double_t AliTPCPointCorrection::RPhiCOGCorrection(Int_t sector, Int_t padrow, Fl
   //  qMax  - cluster max charge - cl-.GetMax()
   //  threshold - clusterer threshold
   //
-  AliTPCClusterParam * clparam = AliTPCClusterParam::Instance(); 
+  AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
+  if (!clparam) {
+    AliFatal("TPC OCDB not initialized"); 
+    return 0;
+  }
   Int_t padtype=0;
   if (sector>=36) padtype = (padrow>64)?2:1;
   Double_t padwidth=(padtype==0)? 0.4:0.6;
@@ -332,9 +336,9 @@ Double_t  AliTPCPointCorrection::GetEdgeQ0(Int_t sector, Int_t padrow, Float_t y
   Double_t xrow  = AliTPCROC::Instance()->GetPadRowRadii(sector,padrow);
   Double_t ymax  = TMath::Tan(TMath::Pi()/18.)*xrow;
   Double_t dedge = ymax-TMath::Abs(y);
-  if (dedge-params[2]<0)             return 0;
+  if (dedge-params[1]<0)             return 0;
   if (dedge>10.*params[1]) return 1;
-  result = 1.-TMath::Exp(-params[0]*(dedge-params[2]));
+  result = 1.-TMath::Exp(-params[0]*(dedge-params[1]));
   return result;
 }