#include <TMatrixD.h>
#include <TMatrixDSym.h>
-//#include "AliLog.h"
+#include "AliLog.h"
#include "AliTrackFitterKalman.h"
ClassImp(AliTrackFitterKalman)
AliTrackFitterKalman::
AliTrackFitterKalman(AliTrackPointArray *array, Bool_t owner):
AliTrackFitter(array,owner),
- fMaxChi2(fgkMaxChi2),
- fSeed(kFALSE)
+ fMaxChi2(fgkMaxChi2)
{
//
// Constructor
// Make a seed out of the track points with the indices "first" and "last".
// This is the "default" seed.
//
- if (fSeed) return kTRUE;
+ fPoints->Sort();
AliTrackPoint fp,lp;
fPoints->GetPoint(fp,first); fPoints->GetPoint(lp,last);
return MakeSeed(&fp,&lp);
//
Double_t x0=p0->GetX(), y0=p0->GetY(), z0=p0->GetZ();
Double_t dx=p1->GetX()-x0, dy=p1->GetY()-y0, dz=p1->GetZ()-z0;
+ if (dy==0.) {
+ AliError("Seeds perpendicular to Y axis are not allowed !");
+ return kFALSE;
+ }
Double_t vx=dx/dy;
Double_t vz=dz/dy;
Double_t par[5]={x0,y0,z0,vx,vz};
const Float_t *cv0=p0->GetCov();
const Float_t *cv1=p1->GetCov();
- Double_t rdx2=(cv0[0]+cv1[0])/dx/dx;
Double_t rdy2=(cv0[3]+cv1[3])/dy/dy;
- Double_t rdz2=(cv0[5]+cv1[5])/dz/dz;
- Double_t svx2=vx*vx*(rdx2+rdy2);
- Double_t svz2=vz*vz*(rdz2+rdy2);
+ Double_t svx2=(cv0[0]+cv1[0])/dy/dy + vx*vx*rdy2;
+ Double_t svz2=(cv0[5]+cv1[5])/dy/dy + vz*vz*rdy2;
Double_t cov[15]={
cv0[0],
cv0[1],cv0[3],
v(0,0)=cov[0]+c(0,0); v(0,1)=cov[1]+c(0,1); v(0,2)=cov[2]+c(0,2);
v(1,0)=cov[1]+c(1,0); v(1,1)=cov[3]+c(1,1); v(1,2)=cov[4]+c(1,2);
v(2,0)=cov[2]+c(2,0); v(2,1)=cov[4]+c(2,1); v(2,2)=cov[5]+c(2,2);
+ if (TMath::Abs(v.Determinant()) < 1.e-33) return kFALSE;
v.Invert();
TMatrixD ch(5,3);
TMatrixDSym tmW(tC);
tmW+=mC;
+ if (TMath::Abs(tmW.Determinant()) < 1.e-33) return kFALSE;
tmW.Invert();
TMatrixD mW(tC,TMatrixD::kMult,tmW);
cv(0,3)=cv(3,0); cv(1,3)=cv(3,1); cv(2,3)=cv(3,2);
cv(0,4)=cv(4,0); cv(1,4)=cv(4,1); cv(2,4)=cv(4,2); cv(3,4)=cv(4,3);
- fSeed=kTRUE;
}