1 #ifndef ALIFLATESDVERTEX_H
2 #define ALIFLATESDVERTEX_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice *
6 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli */
9 * >> Flat structure representing a ESD vertex <<
13 #include "AliVVvertex.h"
14 #include "AliESDVertex.h"
16 class AliFlatESDVertex: public AliVVvertex
17 //class AliFlatESDVertex
20 Double32_t fPosition[3]; // vertex position
21 Double32_t fCov[6]; // vertex covariance matrix
22 Int_t fNContributors; // # of tracklets/tracks used for the estimate
23 Double32_t fChi2; // chi2 of vertex fit
25 Double32_t fSigma; // track dispersion around found vertex
26 Char_t fID; // ID of this vertex within an ESD event
27 Char_t fBCID; // BC ID assigned to vertex
30 AliFlatESDVertex(Bool_t){}
32 AliFlatESDVertex() :fNContributors(0), fChi2(0){
33 for( int i=0; i<3; i++) fPosition[i] = -9999;
34 for( int i=0; i<6; i++) fCov[i] = -9999;
37 void Set(const AliESDVertex &v );
39 Double32_t GetX() const { return fPosition[0]; }
40 Double32_t GetY() const { return fPosition[1]; }
41 Double32_t GetZ() const { return fPosition[2]; }
43 void GetXYZ(Double_t pos[3]) const { for(Int_t j=0; j<3; j++) pos[j]=fPosition[j]; }
44 void SetXYZ(Double_t pos[3]) { for(Int_t j=0; j<3; j++) fPosition[j]=pos[j]; }
46 void SetX(Double_t xVert) {fPosition[0]=xVert; }
47 void SetY(Double_t yVert) {fPosition[1]=yVert; }
48 void SetZ(Double_t zVert) {fPosition[2]=zVert; }
49 void SetNContributors(Int_t nContr) {fNContributors=nContr; }
52 Int_t GetNContributors() const { return fNContributors; }
55 void GetCovarianceMatrix(Double_t covmatrix[6]) const;
56 void SetCovarianceMatrix(const Double_t *) {}
58 Double_t GetChi2perNDF() const {return -999.;}
59 Double_t GetChi2() const {return -999.;}
60 void SetChi2(Double_t ) {}
61 Int_t GetNDF() const {return -999;}
63 void GetSigmaXYZ(Double_t sigma[3]) const;
64 void GetCovMatrix(Double_t covmatrix[6]) const;
65 void GetCovarianceMatrix(Double_t covmatrix[6]) const
66 {GetCovMatrix(covmatrix);}
67 void GetSNR(Double_t snr[3]) const;
68 void SetCovarianceMatrix(const Double_t *cov);
70 Double_t GetXRes() const {return TMath::Sqrt(fCovXX);}
71 Double_t GetYRes() const {return TMath::Sqrt(fCovYY);}
72 Double_t GetZRes() const {return TMath::Sqrt(fCovZZ);}
73 Double_t GetXSNR() const { return fSNR[0]; }
74 Double_t GetYSNR() const { return fSNR[1]; }
75 Double_t GetZSNR() const { return fSNR[2]; }
76 void SetSNR(double snr, int i) {if (i<3 && i>=0) fSNR[i] = snr;}
78 Double_t GetChi2() const { return fChi2; }
79 void SetChi2(Double_t chi) { fChi2 = chi; }
80 Double_t GetChi2toNDF() const
81 { return fChi2/(2.*(Double_t)fNContributors-3.); }
82 Double_t GetChi2perNDF() const { return GetChi2toNDF();}
83 Int_t GetNDF() const {return (2*fNContributors-3);}
85 void Print(Option_t* option = "") const;
86 void PrintStatus() const {Print();}
88 void Reset() { SetToZero(); SetName("Vertex"); }
90 void SetID(Char_t id) {fID=id;}
91 Char_t GetID() const {return fID;}
93 Double_t GetWDist(const AliESDVertex* v) const;