]>
Commit | Line | Data |
---|---|---|
f826d409 | 1 | //---------------------------------------------------------------------------- |
2 | // Implementation of the AliKFVertex class | |
3 | // . | |
4 | // @author S.Gorbunov, I.Kisel | |
5 | // @version 1.0 | |
6 | // @since 13.05.07 | |
7 | // | |
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 | |
12 | // | |
13 | // This class is ALICE interface to general mathematics in AliKFParticleCore | |
14 | // | |
15 | // -= Copyright © ALICE HLT Group =- | |
16 | //____________________________________________________________________________ | |
17 | ||
18 | ||
19 | #include "AliKFVertex.h" | |
706952f5 | 20 | #include "Riostream.h" |
f826d409 | 21 | |
effa6338 | 22 | ClassImp(AliKFVertex) |
f826d409 | 23 | |
24 | ||
706952f5 | 25 | AliKFVertex::AliKFVertex( const AliVVertex &vertex ): fIsConstrained(0) |
f826d409 | 26 | { |
706952f5 | 27 | // Constructor from ALICE VVertex |
f826d409 | 28 | |
29 | vertex.GetXYZ( fP ); | |
706952f5 | 30 | vertex.GetCovarianceMatrix( fC ); |
31 | fChi2 = vertex.GetChi2(); | |
f826d409 | 32 | fNDF = 2*vertex.GetNContributors() - 3; |
33 | fQ = 0; | |
34 | fAtProductionVertex = 0; | |
35 | fIsLinearized = 0; | |
36 | fSFromDecay = 0; | |
37 | } | |
38 | ||
706952f5 | 39 | /* |
40 | void AliKFVertex::Print(Option_t* ) const | |
41 | { | |
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; | |
46 | } | |
47 | */ | |
48 | ||
5fc72f28 | 49 | void AliKFVertex::SetBeamConstraint( Double_t x, Double_t y, Double_t z, |
50 | Double_t errX, Double_t errY, Double_t errZ ) | |
706952f5 | 51 | { |
52 | // Set beam constraint to the vertex | |
5fc72f28 | 53 | fP[0] = x; |
54 | fP[1] = y; | |
55 | fP[2] = z; | |
56 | fC[0] = errX*errX; | |
706952f5 | 57 | fC[1] = 0; |
5fc72f28 | 58 | fC[2] = errY*errY; |
706952f5 | 59 | fC[3] = 0; |
60 | fC[4] = 0; | |
5fc72f28 | 61 | fC[5] = errZ*errZ; |
706952f5 | 62 | fIsConstrained = 1; |
63 | } | |
64 | ||
65 | void AliKFVertex::SetBeamConstraintOff() | |
66 | { | |
67 | fIsConstrained = 0; | |
68 | } | |
4bbc290d | 69 | |
f826d409 | 70 | void AliKFVertex::ConstructPrimaryVertex( const AliKFParticle *vDaughters[], |
4bbc290d | 71 | int NDaughters, Bool_t vtxFlag[], |
72 | Double_t ChiCut ) | |
f826d409 | 73 | { |
74 | //* Primary vertex finder with simple rejection of outliers | |
f826d409 | 75 | if( NDaughters<2 ) return; |
706952f5 | 76 | Construct( vDaughters, NDaughters, 0, -1, fIsConstrained ); |
4bbc290d | 77 | for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 1; |
78 | ||
79 | Int_t nRest = NDaughters; | |
80 | while( nRest>2 ) | |
81 | { | |
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 ); | |
89 | if( worstChi < chi ){ | |
90 | worstChi = chi; | |
91 | worstDaughter = it; | |
92 | } | |
93 | } | |
94 | if( worstChi < ChiCut ) break; | |
95 | ||
96 | vtxFlag[worstDaughter] = 0; | |
97 | *this -= *(vDaughters[worstDaughter]); | |
98 | nRest--; | |
99 | } | |
100 | ||
101 | if( nRest<=2 && GetChi2()>ChiCut*ChiCut*GetNDF() ){ | |
102 | for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 0; | |
103 | fNDF = -3; | |
104 | fChi2 = 0; | |
105 | } | |
f826d409 | 106 | } |