]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatESDVertex.h
add common abstract interface classes for flat and fat ESDs
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDVertex.h
1 #ifndef ALIFLATESDVERTEX_H
2 #define ALIFLATESDVERTEX_H
3
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     */
7
8 /**
9  * >> Flat structure representing a ESD vertex <<
10  */
11
12 #include "Rtypes.h"
13 #include "AliVVvertex.h"
14 #include "AliESDVertex.h"
15
16 class AliFlatESDVertex: public AliVVvertex
17 {
18   public:
19   Double32_t fPosition[3];    // vertex position
20   Double32_t fCov[6];  // vertex covariance matrix
21   Int_t    fNContributors;  // # of tracklets/tracks used for the estimate   
22   Double32_t fChi2;  // chi2 of vertex fit
23   /*
24     Double32_t fSigma;          // track dispersion around found vertex
25     Char_t fID;       // ID of this vertex within an ESD event
26     Char_t fBCID;     // BC ID assigned to vertex
27   */
28
29   AliFlatESDVertex() :fNContributors(0), fChi2(0){
30     for( int i=0; i<3; i++) fPosition[i] = -9999;
31     for( int i=0; i<6; i++) fCov[i] = -9999;
32   }
33
34   void Set(const AliESDVertex &v );
35
36   Double32_t GetX() const { return fPosition[0]; }
37   Double32_t GetY() const { return fPosition[1]; }
38   Double32_t GetZ() const { return fPosition[2]; }
39   
40   void GetXYZ(Double_t pos[3]) const { for(Int_t j=0; j<3; j++) pos[j]=fPosition[j]; }
41   void SetXYZ(Double_t pos[3]) { for(Int_t j=0; j<3; j++) fPosition[j]=pos[j]; }
42
43   void   SetX(Double_t xVert) {fPosition[0]=xVert; }
44   void   SetY(Double_t yVert) {fPosition[1]=yVert; }
45   void   SetZ(Double_t zVert) {fPosition[2]=zVert; } 
46   void   SetNContributors(Int_t nContr) {fNContributors=nContr; }
47
48
49   Int_t    GetNContributors() const { return fNContributors; }
50
51   /*
52   void     GetCovarianceMatrix(Double_t covmatrix[6]) const;
53   void     SetCovarianceMatrix(const Double_t *) {}
54   
55   Double_t GetChi2perNDF() const {return -999.;}
56   Double_t GetChi2() const {return -999.;}
57   void     SetChi2(Double_t ) {}
58   Int_t    GetNDF() const {return -999;}
59
60   void     GetSigmaXYZ(Double_t sigma[3]) const;
61   void     GetCovMatrix(Double_t covmatrix[6]) const;
62   void     GetCovarianceMatrix(Double_t covmatrix[6]) const 
63                     {GetCovMatrix(covmatrix);}
64   void     GetSNR(Double_t snr[3]) const;
65   void     SetCovarianceMatrix(const Double_t *cov);
66
67   Double_t GetXRes() const {return TMath::Sqrt(fCovXX);}
68   Double_t GetYRes() const {return TMath::Sqrt(fCovYY);}
69   Double_t GetZRes() const {return TMath::Sqrt(fCovZZ);}
70   Double_t GetXSNR() const { return fSNR[0]; }
71   Double_t GetYSNR() const { return fSNR[1]; }
72   Double_t GetZSNR() const { return fSNR[2]; }
73   void     SetSNR(double snr, int i) {if (i<3 && i>=0) fSNR[i] = snr;}
74
75   Double_t GetChi2() const { return fChi2; }
76   void     SetChi2(Double_t chi) { fChi2 = chi; }
77   Double_t GetChi2toNDF() const 
78     { return fChi2/(2.*(Double_t)fNContributors-3.); }
79   Double_t GetChi2perNDF() const { return GetChi2toNDF();}
80   Int_t    GetNDF() const {return (2*fNContributors-3);}
81
82   void     Print(Option_t* option = "") const;
83   void     PrintStatus() const {Print();}
84
85   void     Reset() { SetToZero(); SetName("Vertex"); }
86
87   void     SetID(Char_t id) {fID=id;}
88   Char_t   GetID() const {return fID;}
89   //
90   Double_t GetWDist(const AliESDVertex* v) const;
91   */
92
93
94  
95 };
96
97 #endif