/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Log$ Revision 1.16 2003/02/06 11:11:36 kowal2 Added a few get methods by Jiri Chudoba 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 */ //----------------------------------------------------------------- // Implementation of the TPC track class // // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //----------------------------------------------------------------- #include #include "AliTPCtrack.h" #include "AliTPCcluster.h" #include "AliTPCClustersRow.h" #include "AliTPCClustersArray.h" ClassImp(AliTPCtrack) //_________________________________________________________________________ AliTPCtrack::AliTPCtrack(): AliKalmanTrack() { fX = fP0 = fP1 = fP2 = fP3 = fP3 = fP4 = 0.0; fAlpha = fdEdx = 0.0; } //_________________________________________________________________________ AliTPCtrack::AliTPCtrack(UInt_t index, const Double_t xx[5], const Double_t cc[15], Double_t xref, Double_t alpha) : AliKalmanTrack() { //----------------------------------------------------------------- // This is the main track constructor. //----------------------------------------------------------------- fX=xref; fAlpha=alpha; if (fAlpha<-TMath::Pi()) fAlpha += 2*TMath::Pi(); if (fAlpha>=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]; fIndex[0]=index; SetNumberOfClusters(1); } //_____________________________________________________________________________ AliTPCtrack::AliTPCtrack(const AliKalmanTrack& t,Double_t alpha) : AliKalmanTrack(t) { //----------------------------------------------------------------- // Conversion AliKalmanTrack -> AliTPCtrack. //----------------------------------------------------------------- SetChi2(0.); SetNumberOfClusters(0); fdEdx = 0.; fAlpha = alpha; 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]; } //_____________________________________________________________________________ AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : AliKalmanTrack(t) { //----------------------------------------------------------------- // 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; iGet1Pt()); //Double_t c =TMath::Abs(Get1Pt()); Double_t co=t->GetSigmaY2()*t->GetSigmaZ2(); Double_t c =GetSigmaY2()*GetSigmaZ2(); if (c>co) return 1; else if (cGetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); r00+=fC00; r01+=fC10; r11+=fC11; Double_t det=r00*r11 - r01*r01; if (TMath::Abs(det) < 1.e-10) { Int_t n=GetNumberOfClusters(); if (n>4) cerr<GetY() - fP0, dz=c->GetZ() - fP1; return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det; } //_____________________________________________________________________________ Int_t AliTPCtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho) { //----------------------------------------------------------------- // This function propagates a track to a reference plane x=xk. //----------------------------------------------------------------- if (TMath::Abs(fP4*xk - fP2) >= 0.9) { // Int_t n=GetNumberOfClusters(); //if (n>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); r00+=fC00; r01+=fC10; r11+=fC11; Double_t det=r00*r11 - r01*r01; Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; Double_t k00=fC00*r00+fC10*r01, k01=fC00*r01+fC10*r11; Double_t k10=fC10*r00+fC11*r01, k11=fC10*r01+fC11*r11; Double_t k20=fC20*r00+fC21*r01, k21=fC20*r01+fC21*r11; Double_t k30=fC30*r00+fC31*r01, k31=fC30*r01+fC31*r11; Double_t k40=fC40*r00+fC41*r01, k41=fC40*r01+fC41*r11; 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.9) { // Int_t n=GetNumberOfClusters(); //if (n>4) cerr<=TMath::Pi()) fAlpha -= 2*TMath::Pi(); Double_t x1=fX, y1=fP0; Double_t ca=cos(alpha), sa=sin(alpha); Double_t r1=fP4*fX - fP2; 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<= 0.) { Int_t n=GetNumberOfClusters(); if (n>4) cerr<=2*TMath::Pi()) phi-=2*TMath::Pi(); return phi; } ////////////////////////////////////////////////////////////////////////