]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrack.cxx
Updated flags for low flux case (A. Dainese)
[u/mrichter/AliRoot.git] / TPC / AliTPCtrack.cxx
index 872afa2b643ea9c0e8fe364036c353c3bbd7eb8a..9a3501642a59f57d6dd9b2e30741253cd41f4924 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliCluster.h"
 #include "AliTracker.h"
 #include "AliESDtrack.h"
+#include "AliESDVertex.h"
 
 ClassImp(AliTPCtrack)
 
@@ -180,6 +181,33 @@ AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) :
   for (Int_t i=0; i<3;i++) fV0Indexes[i]=t.fV0Indexes[i];
 }
 
+AliTPCtrack& AliTPCtrack::operator=(const AliTPCtrack& o){
+  if(this!=&o){
+    AliKalmanTrack::operator=(o);
+    fdEdx = o.fdEdx;
+    for(Int_t i = 0;i<kMaxRow;++i)fIndex[i] = o.fIndex[i];
+    for(Int_t i = 0;i<4;++i)fPoints[i] = o.fPoints[i];
+    fSdEdx = o.fSdEdx;
+    fNFoundable = o.fNFoundable;
+    fBConstrain = o.fBConstrain;
+    fLastPoint  = o.fLastPoint;
+    fFirstPoint = o.fFirstPoint;
+    fTrackType  = o.fTrackType;
+    fLab2       = o.fLab2;
+    fNShared    = o.fNShared;
+    fReference  = o.fReference;
+    for(Int_t i = 0;i<12;++i) fKinkPoint[i] = o.fKinkPoint[i];
+
+    for(Int_t i = 0;i<3;++i){
+      fKinkIndexes[i] = o.fKinkIndexes[i];
+      fV0Indexes[i] = o.fV0Indexes[i];
+    }
+  }
+  return *this;
+
+}
+
+
 //_____________________________________________________________________________
 Int_t AliTPCtrack::Compare(const TObject *o) const {
   //-----------------------------------------------------------------
@@ -222,23 +250,35 @@ Bool_t AliTPCtrack::PropagateTo(Double_t xk,Double_t rho,Double_t x0) {
   if (IsStartedTimeIntegral() && GetX()>oldX) AddTimeStep(d);
 
   if (oldX < xk) d = -d;
-  if (!AliExternalTrackParam::CorrectForMaterial(d*rho/x0,x0,GetMass())) 
-     return kFALSE;
+  if (!AliExternalTrackParam::CorrectForMeanMaterial(d*rho/x0,d*rho,GetMass(),
+      kFALSE,AliExternalTrackParam::BetheBlochGas)) return kFALSE;
 
   return kTRUE;
 }
 
 //_____________________________________________________________________________
 Bool_t 
-AliTPCtrack::PropagateToVertex(const AliESDVertex *v,Double_t d,Double_t x0) 
+AliTPCtrack::PropagateToVertex(const AliESDVertex *v,Double_t rho,Double_t x0) 
 {
   //-----------------------------------------------------------------
-  // This function propagates tracks to the vertex.
+  // This function propagates tracks to the vertex
+  // rho - density of the crossed matrial (g/cm3)
+  // x0  - radiation length of the crossed material (g/cm2) 
   //-----------------------------------------------------------------
+  Double_t oldX=GetX(), oldY=GetY(), oldZ=GetZ();
+
   Double_t bz=GetBz();
-  if (PropagateToDCA(v,bz,kVeryBig))
-   if (AliExternalTrackParam::CorrectForMaterial(d,x0,GetMass())) return kTRUE;
-  return kFALSE;
+  if (!PropagateToDCA(v,bz,kVeryBig)) return kFALSE;
+
+  Double_t d = TMath::Sqrt((GetX()-oldX)*(GetX()-oldX) + 
+                           (GetY()-oldY)*(GetY()-oldY) + 
+                           (GetZ()-oldZ)*(GetZ()-oldZ));
+
+  if (oldX < GetX()) d = -d;
+  if (!AliExternalTrackParam::CorrectForMeanMaterial(d*rho/x0,d*rho,GetMass(),
+      kFALSE,AliExternalTrackParam::BetheBlochGas)) return kFALSE;
+
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
@@ -251,6 +291,8 @@ Bool_t AliTPCtrack::Update(const AliCluster *c, Double_t chisq, Int_t index) {
 
   if (!AliExternalTrackParam::Update(p,cov)) return kFALSE;
 
+  AliTracker::FillResiduals(this,p,cov,c->GetVolumeId());
+
   Int_t n=GetNumberOfClusters();
   fIndex[n]=index;
   SetNumberOfClusters(n+1);