1 //----------------------------------------------------------------------------
2 // Implementation of the AliKFVertex class
4 // @author S.Gorbunov, I.Kisel
8 // Class to reconstruct and store primary and secondary vertices
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 "AliKFVertex.h"
20 #include "Riostream.h"
25 AliKFVertex::AliKFVertex( const AliVVertex &vertex ): fIsConstrained(0)
27 // Constructor from ALICE VVertex
30 vertex.GetCovarianceMatrix( fC );
31 fChi2 = vertex.GetChi2();
32 fNDF = 2*vertex.GetNContributors() - 3;
34 fAtProductionVertex = 0;
40 void AliKFVertex::Print(Option_t* ) const
42 cout<<"AliKFVertex position: "<<GetX()<<" "<<GetY()<<" "<<GetZ()<<endl;
43 cout<<"AliKFVertex cov. matrix: "<<GetCovariance(0)<<endl;
44 cout<<" "<<GetCovariance(1)<<" "<<GetCovariance(2)<<endl;
45 cout<<" "<<GetCovariance(3)<<" "<<GetCovariance(4)<<" "<<GetCovariance(5)<<endl;
49 void AliKFVertex::SetBeamConstraint( Double_t x, Double_t y, Double_t z,
50 Double_t errX, Double_t errY, Double_t errZ )
52 // Set beam constraint to the vertex
65 void AliKFVertex::SetBeamConstraintOff()
70 void AliKFVertex::ConstructPrimaryVertex( const AliKFParticle *vDaughters[],
71 int NDaughters, Bool_t vtxFlag[],
74 //* Primary vertex finder with simple rejection of outliers
75 if( NDaughters<2 ) return;
76 Construct( vDaughters, NDaughters, 0, -1, fIsConstrained );
77 for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 1;
79 Int_t nRest = NDaughters;
82 Double_t worstChi = 0.;
83 Int_t worstDaughter = 0;
84 for( Int_t it=0; it<NDaughters; it++ ){
85 if( !vtxFlag[it] ) continue;
86 const AliKFParticle &p = *(vDaughters[it]);
87 AliKFVertex tmp = *this - p;
88 Double_t chi = p.GetDeviationFromVertex( tmp );
94 if( worstChi < ChiCut ) break;
96 vtxFlag[worstDaughter] = 0;
97 *this -= *(vDaughters[worstDaughter]);
101 if( nRest<=2 && GetChi2()>ChiCut*ChiCut*GetNDF() ){
102 for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 0;