]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCClusterParam.cxx
Fixes for report #63583: High CPU time spent in TMath::Erf
[u/mrichter/AliRoot.git] / TPC / AliTPCClusterParam.cxx
index 61bd5911bb447460f54717d91a3f1f3c2709a100..08dd92591b224b1d3980154e64776a6c93f4d530 100644 (file)
@@ -98,6 +98,8 @@ AliTPCClusterParam::SetInstance(param);
 #include "AliTPCcalibDB.h"
 #include "AliTPCParam.h"
 
+#include "AliMathBase.h"
+
 ClassImp(AliTPCClusterParam)
 
 
@@ -1605,8 +1607,8 @@ Double_t  AliTPCClusterParam::GaussConvolution(Double_t x0, Double_t x1, Double_
   Double_t exp0 = TMath::Exp(-(k1*x0-k0*x1)*(k1*x0-k0*x1)/(2*sigma2));
   //
   Double_t sigmaErf =  2*s0*s1*TMath::Sqrt(2*sigma2);                       
-  Double_t erf0 = TMath::Erf( (k0*s1*s1*(k0-2*x0)+k1*s0*s0*(k1-2*x1))/sigmaErf);
-  Double_t erf1 = TMath::Erf( (k0*s1*s1*(k0+2*x0)+k1*s0*s0*(k1+2*x1))/sigmaErf);
+  Double_t erf0 = AliMathBase::ErfFast( (k0*s1*s1*(k0-2*x0)+k1*s0*s0*(k1-2*x1))/sigmaErf);
+  Double_t erf1 = AliMathBase::ErfFast( (k0*s1*s1*(k0+2*x0)+k1*s0*s0*(k1+2*x1))/sigmaErf);
   Double_t norm = 1./TMath::Sqrt(sigma2);
   norm/=2.*TMath::Sqrt(2.*TMath::Pi());
   Double_t val  = norm*exp0*(erf0+erf1);