1 //----------------------------------------------------------------------------
2 // Implementation of the AliKFParticle class
4 // @author S.Gorbunov, I.Kisel
8 // Class to reconstruct and store the decayed particle parameters.
9 // The method is described in CBM-SOFT note 2007-003,
10 // ``Reconstruction of decayed particles based on the Kalman filter'',
11 // http://www.gsi.de/documents/DOC-2007-May-14-1.pdf
13 // This class is ALICE interface to general mathematics in AliKFParticleCore
15 // -= Copyright © ALICE HLT Group =-
16 //____________________________________________________________________________
19 #include "AliKFParticle.h"
20 #include "TDatabasePDG.h"
21 #include "TParticlePDG.h"
22 #include "AliExternalTrackParam.h"
25 ClassImp(AliKFParticle)
27 Double_t AliKFParticle::fgBz = -5.; //* Bz compoment of the magnetic field
29 AliKFParticle::AliKFParticle( const AliExternalTrackParam &track, Int_t PID )
31 // Constructor from ALICE track, PID hypothesis should be provided
33 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(PID);
34 Double_t mass = (particlePDG) ? particlePDG->Mass() :0.13957;
37 track.GetPxPyPz(fP+3);
38 Double_t energy = TMath::Sqrt( mass*mass + fP[3]*fP[3] + fP[4]*fP[4] + fP[5]*fP[5]);
41 fQ = (track.GetSigned1Pt() >0 ) ?1 :-1; // fQ = track->GetSign() would do the same thing
44 fAtProductionVertex = 0;
48 Double_t energyInv = 1./energy;
54 track.GetCovarianceXYZPxPyPz( fC );
56 fC[21] = h0*fC[ 6] + h1*fC[10] + h2*fC[15];
57 fC[22] = h0*fC[ 7] + h1*fC[11] + h2*fC[16];
58 fC[23] = h0*fC[ 8] + h1*fC[12] + h2*fC[17];
59 fC[24] = h0*fC[ 9] + h1*fC[13] + h2*fC[18];
60 fC[25] = h0*fC[13] + h1*fC[14] + h2*fC[19];
61 fC[26] = h0*fC[18] + h1*fC[19] + h2*fC[20];
62 fC[27] = h0*h0*fC[ 9] + h1*h1*fC[14] + h2*h2*fC[20]
63 + 2*(h0*h1*fC[13] + h0*h2*fC[18] + h1*h2*fC[19] );
64 for( int i=28; i<36; i++ ) fC[i] = 0;
68 AliKFParticle::AliKFParticle( const AliESDVertex &vertex )
70 // Constructor from ALICE vertex
73 vertex.GetCovMatrix( fC );
74 fChi2 = vertex.GetChi2();
75 fNDF = 2*vertex.GetNContributors() - 3;
77 fAtProductionVertex = 0;
83 void AliKFParticle::GetExternalTrackParam( const AliKFParticleBase &p, Double_t &X, Double_t &Alpha, Double_t P[5] )
85 Double_t cosA = p.GetPx(), sinA = p.GetPy();
86 Double_t pt = TMath::Sqrt(cosA*cosA + sinA*sinA);
96 Alpha = TMath::ATan2(sinA,cosA);
97 X = p.GetX()*cosA + p.GetY()*sinA;
98 P[0]= p.GetY()*cosA - p.GetX()*sinA;
106 void AliKFParticle::GetDStoParticleALICE( const AliKFParticleBase &p,
107 Double_t &DS, Double_t &DS1 )
111 Double_t x1, a1, x2, a2;
112 Double_t par1[5], par2[5], cov[15];
113 for(int i=0; i<15; i++) cov[i] = 0;
114 cov[0] = cov[2] = cov[5] = cov[9] = cov[14] = .001;
116 GetExternalTrackParam( *this, x1, a1, par1 );
117 GetExternalTrackParam( p, x2, a2, par2 );
119 AliExternalTrackParam t1(x1,a1, par1, cov);
120 AliExternalTrackParam t2(x2,a2, par2, cov);
122 Double_t xe1=0, xe2=0;
123 t1.GetDCA( &t2, -GetFieldAlice(), xe1, xe2 );
124 t1.PropagateTo( xe1, -GetFieldAlice() );
125 t2.PropagateTo( xe2, -GetFieldAlice() );
127 Double_t xyz1[3], xyz2[3];
131 DS = GetDStoPoint( xyz1 );
132 DS1 = p.GetDStoPoint( xyz2 );