]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrack.cxx
Small bug fixed for some class of tracks (Sacha)
[u/mrichter/AliRoot.git] / TPC / AliTPCtrack.cxx
index 0f04422f6f1a222459578cab8169afb34267b2df..ebf21fdcc4a9876cddecf59f75a7643f84582dcd 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "AliTPCtrack.h"
 #include "AliCluster.h"
-#include "AliBarrelTrack.h"
 #include "AliESDtrack.h"
 
 ClassImp(AliTPCtrack)
@@ -38,7 +37,7 @@ AliTPCtrack::AliTPCtrack(): AliKalmanTrack()
   //-------------------------------------------------
   fX = fP0 = fP1 = fP2 = fP3 = fP3 = fP4 = 0.0;
   fAlpha = fdEdx = 0.0;
-  fNWrong = fNRotation = fNumber = 0;  // [SR, 01.04.2003]
+  fNumber = 0;  // [SR, 01.04.2003]
   for (Int_t i=0; i<3;i++) fKinkIndexes[i]=0;
 }
 
@@ -59,6 +58,8 @@ const Double_t cc[15], Double_t xref, Double_t alpha) : AliKalmanTrack() {
 
   fP0=xx[0]; fP1=xx[1]; fP2=xx[2]; fP3=xx[3]; fP4=xx[4];
 
+  SaveLocalConvConst();
+
   fC00=cc[0];
   fC10=cc[1];  fC11=cc[2];
   fC20=cc[3];  fC21=cc[4];  fC22=cc[5];
@@ -78,6 +79,7 @@ const Double_t cc[15], Double_t xref, Double_t alpha) : AliKalmanTrack() {
   fTrackType  = 0;
   fLab2       = 0;
   for (Int_t i=0; i<3;i++) fKinkIndexes[i]=0;
+  for (Int_t i=0; i<3;i++) fV0Indexes[i]=0;
 }
 
 //_____________________________________________________________________________
@@ -89,6 +91,7 @@ AliTPCtrack::AliTPCtrack(const AliESDtrack& t) : AliKalmanTrack() {
   SetLabel(t.GetLabel());
   SetMass(t.GetMass());
   for (Int_t i=0; i<3;i++) fKinkIndexes[i]=t.GetKinkIndex(i);
+  for (Int_t i=0; i<3;i++) fV0Indexes[i]=t.GetV0Index(i);
 
   fdEdx  = t.GetTPCsignal();
   fAlpha = t.GetAlpha();
@@ -99,10 +102,10 @@ AliTPCtrack::AliTPCtrack(const AliESDtrack& t) : AliKalmanTrack() {
   Double_t x,p[5]; t.GetExternalParameters(x,p);
   Double_t c[15]; t.GetExternalCovariance(c);
 
-  fX=x;    x=GetConvConst();
+  fX=x;    
   fP0=p[0];
-  fP1=p[1];
-  fP3=p[3];
+  fP1=p[1];    SaveLocalConvConst();
+  fP3=p[3];    x=GetLocalConvConst();
   fP4=p[4]/x;
   fP2=fP4*fX - p[2];
 
@@ -166,40 +169,9 @@ AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : AliKalmanTrack(t) {
   fTrackType  = t.fTrackType;
   fLab2       = t.fLab2;
   for (Int_t i=0; i<3;i++) fKinkIndexes[i]=t.fKinkIndexes[i];
+  for (Int_t i=0; i<3;i++) fV0Indexes[i]=t.fV0Indexes[i];
 }
-//_____________________________________________________________________________
-
-void  AliTPCtrack::GetBarrelTrack(AliBarrelTrack *track) const{
-  //
-  // Create a Barrel Track out of this track
-  // Current track is propagated to the reference plane
-  // by the tracker
-  //
-  // [SR, 01.04.2003]
-  
-  if (!track) return;
-  Double_t xr, vec[5], cov[15];
 
-  track->SetLabel(GetLabel());
-  track->SetX(fX, fAlpha);
-  track->SetNClusters(GetNumberOfClusters(), GetChi2());
-  Double_t times[10];
-  GetIntegratedTimes(times);
-  track->SetTime(times, GetIntegratedLength());
-
-  track->SetMass(GetMass());
-  track->SetdEdX(GetdEdx());
-
-  track->SetNWrongClusters(fNWrong);
-  track->SetNRotate(fNRotation);
-
-  GetExternalParameters(xr, vec);
-  track->SetStateVector(vec);
-  
-  GetExternalCovariance(cov);
-  track->SetCovarianceMatrix(cov);
-
-}
 //_____________________________________________________________________________
 Int_t AliTPCtrack::Compare(const TObject *o) const {
   //-----------------------------------------------------------------
@@ -217,11 +189,11 @@ Int_t AliTPCtrack::Compare(const TObject *o) const {
 
 //_____________________________________________________________________________
 void AliTPCtrack::GetExternalCovariance(Double_t cc[15]) const {
 //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
   // This function returns an external representation of the covriance matrix.
   //   (See comments in AliTPCtrack.h about external track representation)
   //-------------------------------------------------------------------------
-  Double_t a=GetConvConst();
+  Double_t a=GetLocalConvConst();
 
   Double_t c22=fX*fX*fC44-2*fX*fC42+fC22;
   Double_t c32=fX*fC43-fC32;
@@ -282,7 +254,8 @@ Int_t AliTPCtrack::PropagateTo(Double_t xk,Double_t /*x0*/,Double_t rho) {
     //if (n>4) cerr<<n<<" AliTPCtrack warning: Propagation failed !\n";
     return 0;
   }
-  
+  Double_t lcc=GetLocalConvConst();  
+
   // old position for time [SR, GSI 17.02.2003]
   Double_t oldX = fX;
   Double_t oldY = fP0;
@@ -328,7 +301,13 @@ Int_t AliTPCtrack::PropagateTo(Double_t xk,Double_t /*x0*/,Double_t rho) {
 
   fX=x2;
 
-  //Multiple scattering******************
+  //Change of the magnetic field *************
+  SaveLocalConvConst();
+  cc=fP4;
+  fP4*=lcc/GetLocalConvConst();
+  fP2+=fX*(fP4-cc);
+
+  //Multiple scattering ******************
   Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-fP0)*(y1-fP0)+(z1-fP1)*(z1-fP1));
   Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
   Double_t beta2=p2/(p2 + GetMass()*GetMass());
@@ -361,7 +340,7 @@ Int_t AliTPCtrack::PropagateTo(Double_t xk,Double_t /*x0*/,Double_t rho) {
   fC43 += dc43;
   fC44 += dc44;
   */
-  //Energy losses************************
+  //Energy losses ************************
   Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2)*d*rho;
   if (x1 < x2) dE=-dE;
   cc=fP4;
@@ -402,14 +381,6 @@ Int_t AliTPCtrack::Update(const AliCluster *c, Double_t chisq, UInt_t index) {
   //-----------------------------------------------------------------
   // This function associates a cluster with this track.
   //-----------------------------------------------------------------
-
-  // update the number of wrong SR[20.03.2003]
-  Int_t absLabel = TMath::Abs(GetLabel());
-  if ( (c->GetLabel(0) != absLabel) && 
-       (c->GetLabel(0) != absLabel) &&
-       (c->GetLabel(0) != absLabel)) fNWrong++;
-  //
-
   Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2();
   r00+=fC00; r01+=fC10; r11+=fC11;
   Double_t det=r00*r11 - r01*r01;
@@ -468,9 +439,6 @@ Int_t AliTPCtrack::Rotate(Double_t alpha)
   //-----------------------------------------------------------------
   // This function rotates this track.
   //-----------------------------------------------------------------
-
-  if (alpha != 0) fNRotation++;  // [SR, 01.04.2003]
-
   fAlpha += alpha;
   if (fAlpha<-TMath::Pi()) fAlpha += 2*TMath::Pi();
   if (fAlpha>=TMath::Pi()) fAlpha -= 2*TMath::Pi();