FairRoot/PandaRoot
Public Member Functions | Protected Attributes | List of all members
AliKFVertex Class Reference

#include <AliKFVertex.h>

Inheritance diagram for AliKFVertex:

Public Member Functions

 AliKFVertex ()
 
 ~AliKFVertex ()
 
 AliKFVertex (const KFPVertex &vertex)
 
Int_t GetNContributors () const
 
void operator+= (const AliKFParticle &Daughter)
 
AliKFVertex operator- (const AliKFParticle &Daughter) const
 
void operator-= (const AliKFParticle &Daughter)
 
void SetBeamConstraint (float X, float Y, float Z, float ErrX, float ErrY, float ErrZ)
 
void SetBeamConstraintOff ()
 
void ConstructPrimaryVertex (const AliKFParticle *vDaughters[], int NDaughters, Bool_t vtxFlag[], float ChiCut=3.5)
 

Protected Attributes

Bool_t fIsConstrained
 

Detailed Description

Definition at line 24 of file AliKFVertex.h.

Constructor & Destructor Documentation

AliKFVertex::AliKFVertex ( )
inline

Definition at line 35 of file AliKFVertex.h.

35 :AliKFParticle(),fIsConstrained(0){ }
Bool_t fIsConstrained
Definition: AliKFVertex.h:86
AliKFVertex::~AliKFVertex ( )
inline

Definition at line 39 of file AliKFVertex.h.

39 {}
AliKFVertex::AliKFVertex ( const KFPVertex vertex)

Definition at line 22 of file AliKFVertex.cxx.

References KFPVertex::GetChi2(), KFPVertex::GetCovarianceMatrix(), KFPVertex::GetNContributors(), and KFPVertex::GetXYZ().

22  : fIsConstrained(0)
23 {
24  // Constructor from ALICE VVertex
25 
26  vertex.GetXYZ( fP );
27  vertex.GetCovarianceMatrix( fC );
28  fChi2 = vertex.GetChi2();
29  fNDF = 2*vertex.GetNContributors() - 3;
30  fQ = 0;
31  fAtProductionVertex = 0;
32  fIsLinearized = 0;
33  fSFromDecay = 0;
34 }
int GetNContributors() const
Definition: KFPVertex.h:33
float GetChi2() const
Definition: KFPVertex.h:31
void GetXYZ(float *position) const
Definition: KFPVertex.h:17
Bool_t fIsConstrained
Definition: AliKFVertex.h:86
void GetCovarianceMatrix(float *covmatrix) const
Definition: KFPVertex.h:19

Member Function Documentation

void AliKFVertex::ConstructPrimaryVertex ( const AliKFParticle *  vDaughters[],
int  NDaughters,
Bool_t  vtxFlag[],
float  ChiCut = 3.5 
)

Definition at line 67 of file AliKFVertex.cxx.

References fIsConstrained, i, and p.

70 {
71  //* Primary vertex finder with simple rejection of outliers
72 
73  if( NDaughters<2 ) return;
74  float constrP[3]={fP[0], fP[1], fP[2]};
75  float constrC[6]={fC[0], fC[1], fC[2], fC[3], fC[4], fC[5]};
76 
77  Construct( vDaughters, NDaughters, 0, -1, fIsConstrained );
78 
79  SetVtxGuess( fVtxGuess[0], fVtxGuess[1], fVtxGuess[2] );
80 
81  for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 1;
82 
83  Int_t nRest = NDaughters;
84  while( nRest>2 )
85  {
86  float worstChi = 0.;
87  Int_t worstDaughter = 0;
88  for( Int_t it=0; it<NDaughters; it++ ){
89  if( !vtxFlag[it] ) continue;
90  const AliKFParticle &p = *(vDaughters[it]);
91  AliKFVertex tmp = *this - p;
92  float chi = p.GetDeviationFromVertex( tmp );
93  if( worstChi < chi ){
94  worstChi = chi;
95  worstDaughter = it;
96  }
97  }
98  if( worstChi < ChiCut ) break;
99 
100  vtxFlag[worstDaughter] = 0;
101  *this -= *(vDaughters[worstDaughter]);
102  nRest--;
103  }
104 
105  if( nRest>=2 ) {// final refit
106  SetVtxGuess( fP[0], fP[1], fP[2] );
107  if( fIsConstrained ){
108  fP[0] = constrP[0];
109  fP[1] = constrP[1];
110  fP[2] = constrP[2];
111  for( int i=0; i<6; i++ ) fC[i] = constrC[i];
112  }
113  int nDaughtersNew=0;
114  const AliKFParticle **vDaughtersNew=new const AliKFParticle *[NDaughters];
115  for( int i=0; i<NDaughters; i++ ){
116  if( vtxFlag[i] ) vDaughtersNew[nDaughtersNew++] = vDaughters[i];
117  }
118  Construct( vDaughtersNew, nDaughtersNew, 0, -1, fIsConstrained );
119  delete[] vDaughtersNew;
120  }
121 
122  if( nRest<=2 && GetChi2() > ChiCut*ChiCut*GetNDF() ) {
123  for( int i=0; i<NDaughters; i++ ) vtxFlag[i] = 0;
124  fNDF = -3;
125  fChi2 = 0;
126  }
127 }
Int_t i
Definition: run_full.C:25
Double_t p
Definition: anasim.C:58
Bool_t fIsConstrained
Definition: AliKFVertex.h:86
Int_t AliKFVertex::GetNContributors ( ) const
inline

Definition at line 52 of file AliKFVertex.h.

References fIsConstrained.

52 { return fIsConstrained ?fNDF/2:(fNDF+3)/2; }
Bool_t fIsConstrained
Definition: AliKFVertex.h:86
void AliKFVertex::operator+= ( const AliKFParticle &  Daughter)
inline

Definition at line 98 of file AliKFVertex.h.

References operator+=().

99 {
100  AliKFParticle::operator+=( Daughter );
101 }
friend void operator+=(F32vec1 &a, const F32vec1 &b)
AliKFVertex AliKFVertex::operator- ( const AliKFParticle &  Daughter) const
inline

Definition at line 109 of file AliKFVertex.h.

110 {
111  AliKFVertex tmp = *this;
112  Daughter.SubtractFromVertex( tmp );
113  return tmp;
114 }
void AliKFVertex::operator-= ( const AliKFParticle &  Daughter)
inline

Definition at line 104 of file AliKFVertex.h.

105 {
106  Daughter.SubtractFromVertex( *this );
107 }
void AliKFVertex::SetBeamConstraint ( float  X,
float  Y,
float  Z,
float  ErrX,
float  ErrY,
float  ErrZ 
)

Definition at line 46 of file AliKFVertex.cxx.

References fIsConstrained, x, y, and z.

48 {
49  // Set beam constraint to the vertex
50  fP[0] = x;
51  fP[1] = y;
52  fP[2] = z;
53  fC[0] = errX*errX;
54  fC[1] = 0;
55  fC[2] = errY*errY;
56  fC[3] = 0;
57  fC[4] = 0;
58  fC[5] = errZ*errZ;
59  fIsConstrained = 1;
60 }
Double_t z
Bool_t fIsConstrained
Definition: AliKFVertex.h:86
Double_t x
Double_t y
void AliKFVertex::SetBeamConstraintOff ( )

Definition at line 62 of file AliKFVertex.cxx.

References fIsConstrained.

63 {
64  fIsConstrained = 0;
65 }
Bool_t fIsConstrained
Definition: AliKFVertex.h:86

Member Data Documentation

Bool_t AliKFVertex::fIsConstrained
protected

The documentation for this class was generated from the following files: