]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCv2.cxx
QA ref defaut storage setter in sim and rec
[u/mrichter/AliRoot.git] / TPC / AliTPCv2.cxx
index fa3d4c07758067e263b1e3652e7fc8aed502418b..4d85e1c3b1e0bcd486003d295fae4f9c6e5261da 100644 (file)
@@ -35,6 +35,7 @@
 #include <TPDGCode.h>
 #include <TString.h>
 #include "AliLog.h"
+#include "AliMathBase.h"
 #include "AliTrackReference.h"
 #include "AliTPCParam.h"
 #include "AliTPCTrackHitsV2.h"
@@ -1239,7 +1240,7 @@ void AliTPCv2::StepManager()
   const Float_t kprim = 14.35; // number of primary collisions per 1 cm
   const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
   const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation 
+  const Int_t   kMaxDistRef =15;     // maximal difference between 2 stored references 
  
   const Float_t kbig = 1.e10;
 
@@ -1295,6 +1296,13 @@ void AliTPCv2::StepManager()
   //
 
   vol[0]=sector;
+
+  static Double_t lastReferenceR=0;
+  if (TMath::Abs(lastReferenceR-r)>kMaxDistRef){
+    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTPC);
+    lastReferenceR = r;
+  }
+
   // check if change of sector
   if(sector != fSecOld){
     fSecOld=sector;
@@ -1396,7 +1404,7 @@ void AliTPCv2::StepManager()
       {
 
         betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
-        pp=kprim*BetheBloch(betaGamma); 
+        pp=kprim*AliMathBase::BetheBlochAleph(betaGamma); 
    
     }
   
@@ -1407,28 +1415,4 @@ void AliTPCv2::StepManager()
   
 }
 
-//_____________________________________________________________________________
-Float_t AliTPCv2::BetheBloch(Float_t bg)
-{
-  //
-  // Bethe-Bloch energy loss formula
-  //
-  const Double_t kp1=0.76176e-1;
-  const Double_t kp2=10.632;
-  const Double_t kp3=0.13279e-4;
-  const Double_t kp4=1.8631;
-  const Double_t kp5=1.9479;
-
-  Double_t dbg = (Double_t) bg;
-
-  Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
-
-  Double_t aa = TMath::Power(beta,kp4);
-  Double_t bb = TMath::Power(1./dbg,kp5);
-
-  bb=TMath::Log(kp3+bb);
-  
-  return ((Float_t)((kp2-aa-bb)*kp1/aa));
-}
-