#include "TF1.h"
#include "TLinearFitter.h"
+#include "AliExternalTrackParam.h"
+
//
// includes neccessary for test functions
//
}
+Double_t AliMathBase::ErfcFast(Double_t x){
+ // Fast implementation of the complementary error function
+ // The error of the approximation is |eps(x)| < 5E-4
+ // See Abramowitz and Stegun, p.299, 7.1.27
+
+ Double_t z = TMath::Abs(x);
+ Double_t ans = 1+z*(0.278393+z*(0.230389+z*(0.000972+z*0.078108)));
+ ans = 1.0/ans;
+ ans *= ans;
+ ans *= ans;
+
+ return (x>=0.0 ? ans : 2.0 - ans);
+}
///////////////////////////////////////////////////////////////
////////////// TEST functions /////////////////////////
}while(TMath::Abs(value-mean)>cutat);
return value;
}
+
+Double_t AliMathBase::TruncatedGaus(Double_t mean, Double_t sigma, Double_t leftCut, Double_t rightCut)
+{
+ // return number generated according to a gaussian distribution N(mean,sigma)
+ // truncated at leftCut and rightCut
+ //
+ Double_t value;
+ do{
+ value=gRandom->Gaus(mean,sigma);
+ }while((value-mean)<-leftCut || (value-mean)>rightCut);
+ return value;
+}
+
+Double_t AliMathBase::BetheBlochAleph(Double_t bg,
+ Double_t kp1,
+ Double_t kp2,
+ Double_t kp3,
+ Double_t kp4,
+ Double_t kp5) {
+ //
+ // This is the empirical ALEPH parameterization of the Bethe-Bloch formula.
+ // It is normalized to 1 at the minimum.
+ //
+ // bg - beta*gamma
+ //
+ // The default values for the kp* parameters are for ALICE TPC.
+ // The returned value is in MIP units
+ //
+
+ return AliExternalTrackParam::BetheBlochAleph(bg,kp1,kp2,kp3,kp4,kp5);
+}