]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMathBase.cxx
make jet event background tnamed, add reset
[u/mrichter/AliRoot.git] / STEER / AliMathBase.cxx
index 1d0a93338decb040a744a6181f096beac428b517..21bee1a46d9548c1e36a771841154a1927ca7501 100644 (file)
@@ -29,6 +29,8 @@
 #include "TF1.h"
 #include "TLinearFitter.h"
 
+#include "AliExternalTrackParam.h"
+
 //
 // includes neccessary for test functions
 //
@@ -728,3 +730,45 @@ TGraph * AliMathBase::MakeStat1D(TH3 * his, Int_t delta1, Int_t type){
   }
   return graph;
 }
+
+Double_t AliMathBase::TruncatedGaus(Double_t mean, Double_t sigma, Double_t cutat)
+{
+  // return number generated according to a gaussian distribution N(mean,sigma) truncated at cutat
+  //
+  Double_t value;
+  do{
+    value=gRandom->Gaus(mean,sigma);
+  }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);
+}