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