* provided "as is" without express or implied warranty. *
**************************************************************************/
-//-------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////
// Implementation of the ITS track class
//
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
// dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
-//-------------------------------------------------------------------------
-
-#include <TMatrixD.h>
-
+///////////////////////////////////////////////////////////////////////////
#include <TMath.h>
#include "AliCluster.h"
#include "AliESDtrack.h"
#include "AliITStrackV2.h"
+#include "AliStrLine.h"
ClassImp(AliITStrackV2)
fC44(0),
fESDtrack(0)
{
- for(Int_t i=0; i<kMaxLayer; i++) fIndex[i]=0;
+ for(Int_t i=0; i<2*kMaxLayer; i++) fIndex[i]=-1;
for(Int_t i=0; i<4; i++) fdEdxSample[i]=0;
}
//Conversion of the track parameters
Double_t x,p[5];
- if (c) t.GetConstrainedExternalParameters(x,p);
+ if (c) t.GetConstrainedExternalParameters(fAlpha,x,p);
else t.GetExternalParameters(x,p);
- fX=x; x=GetConvConst();
+ fX=x;
fP0=p[0];
- fP1=p[1];
+ fP1=p[1]; SaveLocalConvConst();
fP2=p[2];
- fP3=p[3];
+ fP3=p[3]; x=GetLocalConvConst();
fP4=p[4]/x;
//Conversion of the covariance matrix
}
fESDtrack=&t;
- if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
+ // if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
+ for(Int_t i=0; i<4; i++) fdEdxSample[i]=0;
}
void AliITStrackV2::UpdateESDtrack(ULong_t flags) const {
fESDtrack->UpdateTrackParams(this,flags);
}
-void AliITStrackV2::SetConstrainedESDtrack(Double_t chi2) const {
- fESDtrack->SetConstrainedTrackParams(this,chi2);
-}
//____________________________________________________________________________
AliITStrackV2::AliITStrackV2(const AliITStrackV2& 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; i<n; i++) {
- fIndex[i]=t.fIndex[i];
- if (i<4) fdEdxSample[i]=t.fdEdxSample[i];
- }
+ Int_t i;
+ for (i=0; i<2*kMaxLayer; i++) fIndex[i]=t.fIndex[i];
+ for (i=0; i<4; i++) fdEdxSample[i]=t.fdEdxSample[i];
+
fESDtrack=t.fESDtrack;
}
// 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();
cc[0 ]=fC00;
cc[1 ]=fC10; cc[2 ]=fC11;
return 1;
}
+//_____________________________________________________________________________
+void AliITStrackV2::ApproximateHelixWithLine(Double_t xk, AliStrLine *line)
+{
+ //------------------------------------------------------------
+ // Approximate the track (helix) with a straight line tangent to the
+ // helix in the point defined by r (F. Prino, prino@to.infn.it)
+ //------------------------------------------------------------
+ Double_t mom[3];
+ Double_t azim = TMath::ASin(fP2)+fAlpha;
+ Double_t theta = TMath::Pi()/2. - TMath::ATan(fP3);
+ mom[0] = TMath::Sin(theta)*TMath::Cos(azim);
+ mom[1] = TMath::Sin(theta)*TMath::Sin(azim);
+ mom[2] = TMath::Cos(theta);
+ Double_t pos[3];
+ GetGlobalXYZat(xk,pos[0],pos[1],pos[2]);
+ line->SetP0(pos);
+ line->SetCd(mom);
+}
//_____________________________________________________________________________
Double_t AliITStrackV2::GetPredictedChi2(const AliCluster *c) const
{
//------------------------------------------------------------------
Double_t x1=fX, x2=xk, dx=x2-x1;
Double_t f1=fP2, f2=f1 + fP4*dx;
- if (TMath::Abs(f2) >= 0.9999) {
- Int_t n=GetNumberOfClusters();
- if (n>kWARN)
- Warning("PropagateTo","Propagation failed !\n",n);
+ if (TMath::Abs(f2) >= 0.98) {
+ // MI change - don't propagate highly inclined tracks
+ // covariance matrix distorted
+ //Int_t n=GetNumberOfClusters();
+ //if (n>kWARN)
+ // Warning("PropagateTo","Propagation failed !\n",n);
return 0;
}
+ Double_t lcc=GetLocalConvConst();
// old position [SR, GSI, 17.02.2003]
Double_t oldX = fX, oldY = fP0, oldZ = fP1;
fX=x2;
+ //Change of the magnetic field *************
+ SaveLocalConvConst();
+ fP4*=lcc/GetLocalConvConst();
+
if (!CorrectForMaterial(d,x0)) return 0;
// Integrated Time [SR, GSI, 17.02.2003]
Double_t ca=TMath::Cos(alp-fAlpha), sa=TMath::Sin(alp-fAlpha);
Double_t sf=fP2, cf=TMath::Sqrt(1.- fP2*fP2);
- TMatrixD *T=0;
// **** rotation **********************
{
fAlpha = alp;
fP0= -x*sa + p0*ca;
fP2= sf*ca - cf*sa;
- static TMatrixD C(5,5);
- C(0,0)=c00;
- C(1,0)=c10; C(1,1)=c11;
- C(2,0)=c20; C(2,1)=c21; C(2,2)=c22;
- C(3,0)=c30; C(3,1)=c31; C(3,2)=c32; C(3,3)=c33;
- C(4,0)=c40; C(4,1)=c41; C(4,2)=c42; C(4,3)=c43; C(4,4)=c44;
- C(0,1)=C(1,0);
- C(0,2)=C(2,0); C(1,2)=C(2,1);
- C(0,3)=C(3,0); C(1,3)=C(3,1); C(2,3)=C(3,2);
- C(0,4)=C(4,0); C(1,4)=C(4,1); C(2,4)=C(4,2); C(3,4)=C(4,3);
-
-
- static TMatrixD F(6,5);
- F(0,0)=sa;
- F(1,0)=ca;
- F(2,1)=F(4,3)=F(5,4)=1;
- F(3,2)=ca + sf/cf*sa;
-
- //TMatrixD tmp(C,TMatrixD::kMult,TMatrixD(TMatrixD::kTransposed, F));
-
- static TMatrixD Ft(5,6);
- Ft(0,0)=sa;
- Ft(0,1)=ca;
- Ft(1,2)=Ft(3,4)=Ft(4,5)=1;
- Ft(2,3)=ca + sf/cf*sa;
-
- TMatrixD tmp(C,TMatrixD::kMult,Ft);
- T=new TMatrixD(F,TMatrixD::kMult,tmp);
+ Double_t rr=(ca+sf/cf*sa);
+
+ fC00 *= (ca*ca);
+ fC10 *= ca;
+ fC20 *= ca*rr;
+ fC30 *= ca;
+ fC40 *= ca;
+ //fC11 = fC11;
+ fC21 *= rr;
+ //fC31 = fC31;
+ //fC41 = fC41;
+ fC22 *= rr*rr;
+ fC32 *= rr;
+ fC42 *= rr;
+ //fC33=fC33;
+ //fC43=fC43;
+ //fC44=fC44;
+
}
// **** translation ******************
{
Double_t dx=xk-fX;
Double_t f1=fP2, f2=f1 + fP4*dx;
- if (TMath::Abs(f2) >= 0.9999) {
- Int_t n=GetNumberOfClusters();
- if (n>kWARN)
- Warning("Propagate","Propagation failed (%d) !\n",n);
+ if (TMath::Abs(f2) >= 0.98) {
+ // don't propagate highly inclined tracks MI
return 0;
}
+ // Int_t n=GetNumberOfClusters();
+ // if (n>kWARN)
+ // Warning("Propagate","Propagation failed (%d) !\n",n);
+ // return 0;
+ //}
+ Double_t lcc=GetLocalConvConst();
+
Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
-
+
fX=xk;
fP0 += dx*(f1+f2)/(r1+r2);
fP1 += dx*(f1+f2)/(f1*r2 + f2*r1)*fP3;
fP2 += dx*fP4;
- static TMatrixD F(5,6);
- F(0,1)=F(1,2)=F(2,3)=F(3,4)=F(4,5)=1;
- F(0,3)=dx/(r1+r2)*(2+(f1+f2)*(f2/r2+f1/r1)/(r1+r2));
- F(0,5)=dx*dx/(r1+r2)*(1+(f1+f2)*f2/(r1+r2));
- F(1,3)=dx*fP3/(f1*r2 + f2*r1)*(2-(f1+f2)*(r2-f1*f2/r2+r1-f2*f1/r1)/(f1*r2 + f2*r1));
- F(1,4)=dx*(f1+f2)/(f1*r2 + f2*r1);
- F(1,5)=dx*dx*fP3/(f1*r2 + f2*r1)*(1-(f1+f2)*(-f1*f2/r2+r1)/(f1*r2 + f2*r1));
- F(2,5)=dx;
- F(0,0)=-1/(r1+r2)*((f1+f2)+dx*fP4*(1+(f1+f2)/(r1+r2)*f2/r2));
- F(1,0)=-fP3/(f1*r2 + f2*r1)*((f1+f2)+dx*fP4*(1+(f1+f2)/(f1*r2 + f2*r1)*(f1*f2/r2-r1)));
- F(2,0)=-fP4;
-
- TMatrixD tmp(*T,TMatrixD::kMult,TMatrixD(TMatrixD::kTransposed, F));
- delete T;
- TMatrixD C(F,TMatrixD::kMult,tmp);
-
- fC00=C(0,0);
- fC10=C(1,0); fC11=C(1,1);
- fC20=C(2,0); fC21=C(2,1); fC22=C(2,2);
- fC30=C(3,0); fC31=C(3,1); fC32=C(3,2); fC33=C(3,3);
- fC40=C(4,0); fC41=C(4,1); fC42=C(4,2); fC43=C(4,3); fC44=C(4,4);
+ //Change of the magnetic field *************
+ SaveLocalConvConst();
+ fP4*=lcc/GetLocalConvConst();
+
+ //f = F - 1
+
+ Double_t f02= dx/(r1*r1*r1);
+ Double_t f04=0.5*dx*dx/(r1*r1*r1);
+ Double_t f12= dx*fP3*f1/(r1*r1*r1);
+ Double_t f14=0.5*dx*dx*fP3*f1/(r1*r1*r1);
+ Double_t f13= dx/r1;
+ Double_t f24= dx;
+
+ //b = C*ft
+ Double_t b00=f02*fC20 + f04*fC40, b01=f12*fC20 + f14*fC40 + f13*fC30;
+ Double_t b02=f24*fC40;
+ Double_t b10=f02*fC21 + f04*fC41, b11=f12*fC21 + f14*fC41 + f13*fC31;
+ Double_t b12=f24*fC41;
+ Double_t b20=f02*fC22 + f04*fC42, b21=f12*fC22 + f14*fC42 + f13*fC32;
+ Double_t b22=f24*fC42;
+ Double_t b40=f02*fC42 + f04*fC44, b41=f12*fC42 + f14*fC44 + f13*fC43;
+ Double_t b42=f24*fC44;
+ Double_t b30=f02*fC32 + f04*fC43, b31=f12*fC32 + f14*fC43 + f13*fC33;
+ Double_t b32=f24*fC43;
+
+ //a = f*b = f*C*ft
+ Double_t a00=f02*b20+f04*b40,a01=f02*b21+f04*b41,a02=f02*b22+f04*b42;
+ Double_t a11=f12*b21+f14*b41+f13*b31,a12=f12*b22+f14*b42+f13*b32;
+ Double_t a22=f24*b42;
+
+ //F*C*Ft = C + (b + bt + a)
+ fC00 += b00 + b00 + a00;
+ fC10 += b10 + b01 + a01;
+ fC20 += b20 + b02 + a02;
+ fC30 += b30;
+ fC40 += b40;
+ fC11 += b11 + b11 + a11;
+ fC21 += b21 + b12 + a12;
+ fC31 += b31;
+ fC41 += b41;
+ fC22 += b22 + b22 + a22;
+ fC32 += b32;
+ fC42 += b42;
if (!Invariant()) {
fAlpha=alpha;
return 1;
}
+
Double_t AliITStrackV2::GetD(Double_t x, Double_t y) const {
//------------------------------------------------------------------
// This function calculates the transverse impact parameter
Double_t theta2=14.1*14.1/(beta2*p2*1e6)*x0;
//Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*x0*9.36*2.33;
{
- Double_t parp=0.5*(fP4*fX + dy*TMath::Sqrt(4/r2-fP4*fP4));
+ Double_t dummy=4/r2-fP4*fP4;
+ if (dummy < 0) return 0;
+ Double_t parp=0.5*(fP4*fX + dy*TMath::Sqrt(dummy));
Double_t sigma2p = theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl());
sigma2p += fC00/r2*(1.- dy*dy/r2)*(1.- dy*dy/r2);
sigma2p += ers[1]*ers[1]/r2;
SetdEdx(dedx);
}
+
+Double_t AliITStrackV2::
+PropagateToDCA(AliKalmanTrack *p, Double_t d, Double_t x0) {
+ //--------------------------------------------------------------
+ // Propagates this track and the argument track to the position of the
+ // distance of closest approach.
+ // Returns the (weighed !) distance of closest approach.
+ //--------------------------------------------------------------
+ Double_t xthis, xp, dca;
+ {
+ //Temporary solution
+ Double_t b=1./GetLocalConvConst()/kB2C;
+ AliExternalTrackParam dummy1(*this), dummy2(*p);
+ dca=dummy1.GetDCA(&dummy2,b,xthis,xp);
+ }
+ if (!PropagateTo(xthis,d,x0)) {
+ //AliWarning(" propagation failed !");
+ return 1e+33;
+ }
+
+ if (!p->PropagateTo(xp,d,x0)) {
+ //AliWarning(" propagation failed !";
+ return 1e+33;
+ }
+
+ return dca;
+}
+
+Double_t AliITStrackV2::Get1Pt() const {
+ //--------------------------------------------------------------
+ // Returns the inverse Pt (1/GeV/c)
+ // (or 1/"most probable pt", if the field is too weak)
+ //--------------------------------------------------------------
+ if (TMath::Abs(GetLocalConvConst()) > kVeryBigConvConst)
+ return 1./kMostProbableMomentum/TMath::Sqrt(1.+ GetTgl()*GetTgl());
+ return (TMath::Sign(1e-9,fP4) + fP4)*GetLocalConvConst();
+}