]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrack.cxx
updated documentation
[u/mrichter/AliRoot.git] / TPC / AliTPCtrack.cxx
index fce664fdfbc6dc1d178d76a189972557b069a4af..10741b91b3dd88fb0d8735c468364b2889427d58 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliCluster.h"
 #include "AliTracker.h"
 #include "AliESDtrack.h"
+#include "AliESDVertex.h"
 
 ClassImp(AliTPCtrack)
 
@@ -77,8 +78,7 @@ AliTPCtrack::AliTPCtrack(Double_t x, Double_t alpha, const Double_t p[5],
   //-----------------------------------------------------------------
   // This is the main track constructor.
   //-----------------------------------------------------------------
-
-  Double_t cnv=1./(GetBz()*kB2C);
+  Double_t cnv=1./(AliTracker::GetBz()*kB2C);
 
   Double_t pp[5]={
     p[0],
@@ -101,6 +101,12 @@ AliTPCtrack::AliTPCtrack(Double_t x, Double_t alpha, const Double_t p[5],
     cov[10]*cnv, cov[11]*cnv, c42*cnv, cov[13]*cnv, cov[14]*cnv*cnv
   };
 
+  Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
+  Double_t p0=TMath::Sign(1/mostProbablePt,pp[4]);
+  Double_t w0=cc[14]/(cc[14] + p0*p0), w1=p0*p0/(cc[14] + p0*p0);
+  pp[4] = w0*p0 + w1*pp[4]; 
+  cc[10]*=w1; cc[11]*=w1; cc[12]*=w1; cc[13]*=w1; cc[14]*=w1;
+
   Set(x,alpha,pp,cc);
 
   SetNumberOfClusters(1);
@@ -175,14 +181,41 @@ 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 {
   //-----------------------------------------------------------------
   // This function compares tracks according to the their curvature
   //-----------------------------------------------------------------
   AliTPCtrack *t=(AliTPCtrack*)o;
-  //Double_t co=TMath::Abs(t->Get1Pt());
-  //Double_t c =TMath::Abs(Get1Pt());
+  //Double_t co=t->OneOverPt();
+  //Double_t c = OneOverPt();
   Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
   Double_t c =GetSigmaY2()*GetSigmaZ2();
   if (c>co) return 1;
@@ -246,6 +279,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);