X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCtrack.cxx;h=42c78d0732137ed7b12fd3a968d404edc8ad0f9c;hb=c55ca9e5ff7ba48642d44e3cc714cd5d35693441;hp=c754a8c47997ba36f2663c3852a956f35c850409;hpb=1936493934365ed89c915ea283ff553376bffc14;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCtrack.cxx b/TPC/AliTPCtrack.cxx index c754a8c4799..42c78d07321 100644 --- a/TPC/AliTPCtrack.cxx +++ b/TPC/AliTPCtrack.cxx @@ -13,35 +13,31 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.12 2002/10/14 14:57:43 hristov -Merging the VirtualMC branch to the main development branch (HEAD) - -Revision 1.9.6.1 2002/10/11 08:34:48 hristov -Updating VirtualMC to v3-09-02 - -Revision 1.11 2002/07/19 07:34:42 kowal2 -Logs added - -*/ - +/* $Id$ */ //----------------------------------------------------------------- // Implementation of the TPC track class -// -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +// This class is used by the AliTPCtracker class +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //----------------------------------------------------------------- #include #include "AliTPCtrack.h" -#include "AliTPCcluster.h" -#include "AliTPCClustersRow.h" -#include "AliTPCClustersArray.h" +#include "AliCluster.h" +#include "AliBarrelTrack.h" +#include "AliESDtrack.h" ClassImp(AliTPCtrack) +//_________________________________________________________________________ +AliTPCtrack::AliTPCtrack(): AliKalmanTrack() +{ + fX = fP0 = fP1 = fP2 = fP3 = fP3 = fP4 = 0.0; + fAlpha = fdEdx = 0.0; + fNWrong = fNRotation = fNumber = 0; // [SR, 01.04.2003] +} + //_________________________________________________________________________ AliTPCtrack::AliTPCtrack(UInt_t index, const Double_t xx[5], const Double_t cc[15], Double_t xref, Double_t alpha) : AliKalmanTrack() { @@ -64,19 +60,26 @@ const Double_t cc[15], Double_t xref, Double_t alpha) : AliKalmanTrack() { fIndex[0]=index; SetNumberOfClusters(1); - + // + //MI + fSdEdx = 0; + fNFoundable = 0; + fBConstrain = 0; + fLastPoint = 0; + fFirstPoint = 0; + fRemoval = 0; + fTrackType = 0; + fLab2 = 0; } //_____________________________________________________________________________ -AliTPCtrack::AliTPCtrack(const AliKalmanTrack& t,Double_t alpha) { +AliTPCtrack::AliTPCtrack(const AliKalmanTrack& t,Double_t alpha) : +AliKalmanTrack(t) { //----------------------------------------------------------------- // Conversion AliKalmanTrack -> AliTPCtrack. //----------------------------------------------------------------- - SetLabel(t.GetLabel()); SetChi2(0.); - SetMass(t.GetMass()); SetNumberOfClusters(0); - //SetConvConst(t.GetConvConst()); fdEdx = 0.; fAlpha = alpha; @@ -105,7 +108,69 @@ AliTPCtrack::AliTPCtrack(const AliKalmanTrack& t,Double_t alpha) { fC20=c20; fC21=c21; fC22=c22; fC30=c[6 ]; fC31=c[7 ]; fC32=c32; fC33=c[9 ]; fC40=c[10]; fC41=c[11]; fC42=c42; fC43=c[13]; fC44=c[14]; + // + //MI + fSdEdx = 0; + fNFoundable = 0; + fBConstrain = 0; + fLastPoint = 0; + fFirstPoint = 0; + fRemoval = 0; + fTrackType = 0; + fLab2 = 0; +} +//_____________________________________________________________________________ +AliTPCtrack::AliTPCtrack(const AliESDtrack& t) : AliKalmanTrack() { + //----------------------------------------------------------------- + // Conversion AliESDtrack -> AliTPCtrack. + //----------------------------------------------------------------- + SetNumberOfClusters(t.GetTPCclusters(fIndex)); + SetLabel(t.GetLabel()); + SetMass(t.GetMass()); + + fdEdx = t.GetTPCsignal(); + fAlpha = t.GetAlpha(); + if (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi(); + else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi(); + + //Conversion of the track parameters + Double_t x,p[5]; t.GetExternalParameters(x,p); + fX=x; x=GetConvConst(); + fP0=p[0]; + fP1=p[1]; + fP3=p[3]; + fP4=p[4]/x; + fP2=fP4*fX - p[2]; + + //Conversion of the covariance matrix + Double_t c[15]; t.GetExternalCovariance(c); + c[10]/=x; c[11]/=x; c[12]/=x; c[13]/=x; c[14]/=x*x; + + Double_t c22=fX*fX*c[14] - 2*fX*c[12] + c[5]; + Double_t c32=fX*c[13] - c[8]; + Double_t c20=fX*c[10] - c[3], c21=fX*c[11] - c[4], c42=fX*c[14] - c[12]; + + fC00=c[0 ]; + fC10=c[1 ]; fC11=c[2 ]; + fC20=c20; fC21=c21; fC22=c22; + fC30=c[6 ]; fC31=c[7 ]; fC32=c32; fC33=c[9 ]; + fC40=c[10]; fC41=c[11]; fC42=c42; fC43=c[13]; fC44=c[14]; + + if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return; + StartTimeIntegral(); + Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times); + SetIntegratedLength(t.GetIntegratedLength()); + // + //MI + fSdEdx = 0; + fNFoundable = 0; + fBConstrain = 0; + fLastPoint = 0; + fFirstPoint = 0; + fRemoval = 0; + fTrackType = 0; + fLab2 = 0; } //_____________________________________________________________________________ @@ -125,10 +190,53 @@ AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : AliKalmanTrack(t) { fC30=t.fC30; fC31=t.fC31; fC32=t.fC32; fC33=t.fC33; fC40=t.fC40; fC41=t.fC41; fC42=t.fC42; fC43=t.fC43; fC44=t.fC44; - Int_t n=GetNumberOfClusters(); - for (Int_t i=0; iSetLabel(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 { //----------------------------------------------------------------- @@ -186,16 +294,37 @@ Double_t AliTPCtrack::GetPredictedChi2(const AliCluster *c) const return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det; } +Double_t AliTPCtrack::GetYat(Double_t xk) const { +//----------------------------------------------------------------- +// This function calculates the Y-coordinate of a track at the plane x=xk. +//----------------------------------------------------------------- + Double_t c1=fP4*fX - fP2, r1=TMath::Sqrt(1.- c1*c1); + Double_t c2=fP4*xk - fP2; + if (c2*c2>0.99999) { + Int_t n=GetNumberOfClusters(); + if (n>4) cerr<= 0.99999) { - Int_t n=GetNumberOfClusters(); - if (n>4) cerr<= 0.9) { + // Int_t n=GetNumberOfClusters(); + //if (n>4) cerr<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; @@ -294,9 +459,9 @@ Int_t AliTPCtrack::Update(const AliCluster *c, Double_t chisq, UInt_t index) { Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1; Double_t cur=fP4 + k40*dy + k41*dz, eta=fP2 + k20*dy + k21*dz; - if (TMath::Abs(cur*fX-eta) >= 0.99999) { - Int_t n=GetNumberOfClusters(); - if (n>4) cerr<= 0.9) { + // Int_t n=GetNumberOfClusters(); + //if (n>4) cerr<=TMath::Pi()) fAlpha -= 2*TMath::Pi(); @@ -410,3 +578,93 @@ void AliTPCtrack::ResetCovariance() { fC40=0.; fC41=0.; fC42=0.; fC43=0.; fC44*=10.; } + +//////////////////////////////////////////////////////////////////////// +Double_t AliTPCtrack::Phi() const { +// +// +// + Double_t phi = TMath::ASin(GetSnp()) + fAlpha; + if (phi<0) phi+=2*TMath::Pi(); + if (phi>=2*TMath::Pi()) phi-=2*TMath::Pi(); + return phi; +} +//////////////////////////////////////////////////////////////////////// + + + +//////////////////////////////////////////////////////////////////////// +// MI ADDITION + +Float_t AliTPCtrack::Density(Int_t row0, Int_t row1) +{ + // + // calculate cluster density + Int_t good = 0; + Int_t found = 0; + //if (row0fLastPoint) row1 = fLastPoint; + + + for (Int_t i=row0;i<=row1;i++){ + // Int_t index = fClusterIndex[i]; + Int_t index = fIndex[i]; + if (index!=-1) good++; + if (index>0) found++; + } + Float_t density=0; + if (good>0) density = Float_t(found)/Float_t(good); + return density; +} + + +Float_t AliTPCtrack::Density2(Int_t row0, Int_t row1) +{ + // + // calculate cluster density + Int_t good = 0; + Int_t found = 0; + // + for (Int_t i=row0;i<=row1;i++){ + Int_t index = fIndex[i]; + if (index!=-1) good++; + if (index>0) found++; + } + Float_t density=0; + if (good>0) density = Float_t(found)/Float_t(good); + return density; +} + + +Double_t AliTPCtrack::GetZat0() const +{ + // + // return virtual z - supposing that x = 0 + if (TMath::Abs(fP2)>1) return 0; + if (TMath::Abs(fX*fP4-fP2)>1) return 0; + Double_t vz = fP1+fP3/fP4*(asin(-fP2)-asin(fX*fP4-fP2)); + return vz; +} + + +Double_t AliTPCtrack::GetD(Double_t x, Double_t y) const { + //------------------------------------------------------------------ + // This function calculates the transverse impact parameter + // with respect to a point with global coordinates (x,y) + //------------------------------------------------------------------ + //Double_t xt=fX, yt=fP0; + + Double_t sn=TMath::Sin(fAlpha), cs=TMath::Cos(fAlpha); + Double_t a = x*cs + y*sn; + y = -x*sn + y*cs; x=a; + // + Double_t r = TMath::Abs(1/fP4); + Double_t x0 = TMath::Abs(fP2*r); + Double_t y0 = fP0; + y0= fP0+TMath::Sqrt(1-(fP4*fX-fP2)*(fP4*fX-fP2))/fP4; + + Double_t delta = TMath::Sqrt((x-x0)*(x-x0)+(y-y0)*(y-y0)); + // Double_t delta = TMath::Sqrt(TMath::Abs(x*x-2*x0*x+x0*x0+ y*y-2*y*y0+y0*y0)); + delta -= TMath::Abs(r); + return delta; +}