X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCtrack.cxx;h=d6733b39e26e7f795ec30237d19028935e322937;hb=370e070acb95b852a98f56b0eb7df04943a64c9d;hp=7062f7a694957f1df0000c035636cce19426e28e;hpb=77e5846872ce6c4d2b89bc537bbaec65aec591af;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCtrack.cxx b/TPC/AliTPCtrack.cxx index 7062f7a6949..d6733b39e26 100644 --- a/TPC/AliTPCtrack.cxx +++ b/TPC/AliTPCtrack.cxx @@ -13,127 +13,238 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.15 2002/11/25 09:33:30 hristov -Tracking of secondaries (M.Ivanov) - -Revision 1.14 2002/10/23 13:45:00 hristov -Fatal if no magnetic field set for the reconstruction (Y.Belikov) - -Revision 1.13 2002/10/23 07:17:34 alibrary -Introducing Riostream.h - -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 "AliESDtrack.h" +#include "AliTPCReconstructor.h" ClassImp(AliTPCtrack) //_________________________________________________________________________ +AliTPCtrack::AliTPCtrack(): + AliKalmanTrack(), + fX(0), + fAlpha(0), + fdEdx(0), + fP0(0), + fP1(0), + fP2(0), + fP3(0), + fP4(0), + fC00(1e10), + fC10(0), + fC11(1e10), + fC20(0), + fC21(0), + fC22(1e10), + fC30(0), + fC31(0), + fC32(0), + fC33(1e10), + fC40(0), + fC41(0), + fC42(0), + fC43(0), + fC44(0), + fNumber(0), + fSdEdx(1e10), + fNFoundable(0), + fBConstrain(kFALSE), + fLastPoint(-1), + fFirstPoint(-1), + fRemoval(0), + fTrackType(0), + fLab2(-1), + fNShared(0), + fReference() +{ + //------------------------------------------------- + // default constructor + //------------------------------------------------- + for (Int_t i=0; i=TMath::Pi()) fAlpha -= 2*TMath::Pi(); - fdEdx=0.; - - fP0=xx[0]; fP1=xx[1]; fP2=xx[2]; fP3=xx[3]; fP4=xx[4]; - fC00=cc[0]; - fC10=cc[1]; fC11=cc[2]; - fC20=cc[3]; fC21=cc[4]; fC22=cc[5]; - fC30=cc[6]; fC31=cc[7]; fC32=cc[8]; fC33=cc[9]; - fC40=cc[10]; fC41=cc[11]; fC42=cc[12]; fC43=cc[13]; fC44=cc[14]; + SaveLocalConvConst(); - fIndex[0]=index; SetNumberOfClusters(1); - + + fIndex[0]=index; + for (Int_t i=1; i AliTPCtrack. + // Conversion AliESDtrack -> AliTPCtrack. //----------------------------------------------------------------- - SetChi2(0.); - SetNumberOfClusters(0); - - fdEdx = 0.; - fAlpha = alpha; + SetNumberOfClusters(t.GetTPCclusters(fIndex)); + SetLabel(t.GetLabel()); + SetMass(t.GetMass()); + for (Int_t i=0; i<4;i++) fPoints[i]=0.; + for (Int_t i=0; i<12;i++) fKinkPoint[i]=0.; + for (Int_t i=0; i<3;i++) fKinkIndexes[i]=0; + for (Int_t i=0; i<3;i++) fV0Indexes[i]=0; + + 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; + Double_t c[15]; t.GetExternalCovariance(c); + + fX=x; + fP0=p[0]; + fP1=p[1]; SaveLocalConvConst(); + fP3=p[3]; x=GetLocalConvConst(); + 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()); } //_____________________________________________________________________________ -AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : AliKalmanTrack(t) { +AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : + AliKalmanTrack(t), + fX(t.fX), + fAlpha(t.fAlpha), + fdEdx(t.fdEdx), + fP0(t.fP0), + fP1(t.fP1), + fP2(t.fP2), + fP3(t.fP3), + fP4(t.fP4), + fC00(t.fC00), + fC10(t.fC10), + fC11(t.fC11), + fC20(t.fC20), + fC21(t.fC21), + fC22(t.fC22), + 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), + fNumber(t.fNumber), + fSdEdx(t.fSdEdx), + fNFoundable(t.fNFoundable), + fBConstrain(t.fBConstrain), + fLastPoint(t.fLastPoint), + fFirstPoint(t.fFirstPoint), + fRemoval(t.fRemoval), + fTrackType(t.fTrackType), + fLab2(t.fLab2), + fNShared(t.fNShared), + fReference(t.fReference) + +{ //----------------------------------------------------------------- // This is a track copy constructor. //----------------------------------------------------------------- - fX=t.fX; - fAlpha=t.fAlpha; - fdEdx=t.fdEdx; - - fP0=t.fP0; fP1=t.fP1; fP2=t.fP2; fP3=t.fP3; fP4=t.fP4; - - fC00=t.fC00; - fC10=t.fC10; fC11=t.fC11; - fC20=t.fC20; fC21=t.fC21; fC22=t.fC22; - 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; iAliTPCReconstructor::GetMaxSnpTrack()) return 0.; //patch 01 jan 06 + Double_t c1=fP4*fX - fP2, r1=TMath::Sqrt(1.- c1*c1); + Double_t c2=fP4*xk - fP2; + if (c2*c2>AliTPCReconstructor::GetMaxSnpTrack()) { + // Int_t n=GetNumberOfClusters(); + // if (n>4) cerr<= 0.9) { + if (TMath::Abs(fP4*xk - fP2) >= AliTPCReconstructor::GetMaxSnpTrack()) { // Int_t n=GetNumberOfClusters(); //if (n>4) cerr<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.9) { + if (TMath::Abs(cur*fX-eta) >= AliTPCReconstructor::GetMaxSnpTrack()) { // Int_t n=GetNumberOfClusters(); //if (n>4) cerr<=AliTPCReconstructor::GetMaxSnpTrack()) return 0; //patch 01 jan 06 + fX = x1*ca + y1*sa; fP0=-x1*sa + y1*ca; fP2=fP2*ca + (fP4*y1 + sqrt(1.- r1*r1))*sa; Double_t r2=fP4*fX - fP2; - if (TMath::Abs(r2) >= 0.99999) { - Int_t n=GetNumberOfClusters(); - if (n>4) cerr<= AliTPCReconstructor::GetMaxSnpTrack()) { + //Int_t n=GetNumberOfClusters(); + // if (n>4) cerr<= 0.) { - Int_t n=GetNumberOfClusters(); - if (n>4) cerr<4) cerr<=2*TMath::Pi()) phi-=2*TMath::Pi(); @@ -429,3 +602,151 @@ Double_t AliTPCtrack::Phi() const { //////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// +// 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; +} + +// +// + +void AliTPCtrack::UpdatePoints() +{ + //-------------------------------------------------- + //calculates first ,amx dens and last points + //-------------------------------------------------- + Float_t density[160]; + for (Int_t i=0;i<160;i++) density[i]=-1.; + fPoints[0]= 160; + fPoints[1] = -1; + // + Int_t ngood=0; + Int_t undeff=0; + Int_t nall =0; + Int_t range=20; + for (Int_t i=0;i<160;i++){ + Int_t last = i-range; + if (nall=0){ + if (fIndex[last]>0&& (fIndex[last]&0x8000)==0) ngood--; + if (fIndex[last]==-1) undeff--; + } + if (fIndex[i]>0&& (fIndex[i]&0x8000)==0) ngood++; + if (fIndex[i]==-1) undeff++; + if (nall==range &&undeffmaxdens){ + maxdens=density[i]; + indexmax=i; + } + } + // + //max dens point + fPoints[3] = maxdens; + fPoints[1] = indexmax; + // + // last point + for (Int_t i=indexmax;i<160;i++){ + if (density[i]<0) continue; + if (density[i]0;i--){ + if (density[i]<0) continue; + if (density[i] kVeryBigConvConst) + return 1./kMostProbableMomentum/TMath::Sqrt(1.+ GetTgl()*GetTgl()); + return (TMath::Sign(1e-9,fP4) + fP4)*GetLocalConvConst(); +}