PandaRoot
KFPVertex.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef KFPVertex_H
14 #define KFPVertex_H
15 
16 class KFPVertex {
17  public:
18  KFPVertex() {}
20 
21  /* KFPVertex(const KFPVertex& vVert);
22  KFPVertex& operator=(const KFPVertex& vVert);*/
23 
24  float GetX() const { return fP[0]; }
25  float GetY() const { return fP[1]; }
26  float GetZ() const { return fP[2]; }
27 
28  void GetXYZ(float *position) const
29  {
30  position[0] = fP[0];
31  position[1] = fP[1];
32  position[2] = fP[2];
33  }
34  void GetXYZ(double *position) const
35  {
36  position[0] = fP[0];
37  position[1] = fP[1];
38  position[2] = fP[2];
39  }
40  void GetCovarianceMatrix(float *covmatrix) const
41  {
42  for (int i = 0; i < 6; i++)
43  covmatrix[i] = fC[i];
44  }
45  void GetCovarianceMatrix(double *covmatrix) const
46  {
47  for (int i = 0; i < 6; i++)
48  covmatrix[i] = fC[i];
49  }
50 
51  float GetChi2perNDF() const { return fChi2 / fNDF; }
52  float GetChi2() const { return fChi2; }
53  int GetNDF() const { return fNDF; }
54  int GetNContributors() const { return fNContributors; }
55 
56  float GetParameter(int i) const { return fP[i]; }
57  float GetCovariance(int i) const { return fC[i]; }
58 
59  void SetXYZ(float *position)
60  {
61  fP[0] = position[0];
62  fP[1] = position[1];
63  fP[2] = position[2];
64  }
65  void SetXYZ(float x, float y, float z)
66  {
67  fP[0] = x;
68  fP[1] = y;
69  fP[2] = z;
70  }
71  void SetX(float x) { fP[0] = x; }
72  void SetY(float y) { fP[1] = y; }
73  void SetZ(float z) { fP[2] = z; }
74  void SetChi2(float chi) { fChi2 = chi; }
75  void SetNDF(int ndf) { fNDF = ndf; }
76  void SetNContributors(int nc) { fNContributors = nc; }
77 
78  void SetCovarianceMatrix(float *C)
79  {
80  for (int i = 0; i < 6; i++)
81  fC[i] = C[i];
82  }
83 
84  void SetCovarianceMatrix(float C00, float C10, float C11, float C20, float C21, float C22)
85  {
86  fC[0] = C00;
87  fC[1] = C10;
88  fC[2] = C11;
89  fC[3] = C20;
90  fC[4] = C21;
91  fC[5] = C22;
92  }
93 
94  private:
95  float fP[3]; // coordinates of the vertex
96  float fC[6]; // Covariance matrix of the vertex parameters
97  float fChi2; // chi-square of the vertex fitting
98  int fNContributors; // number of tracks, from which the vertex was builded
99  int fNDF; // degree of freedom number
100 };
101 
102 #endif
~KFPVertex()
Definition: KFPVertex.h:19
float GetCovariance(int i) const
Definition: KFPVertex.h:57
void GetCovarianceMatrix(double *covmatrix) const
Definition: KFPVertex.h:45
float GetY() const
Definition: KFPVertex.h:25
void GetXYZ(float *position) const
Definition: KFPVertex.h:28
void SetNDF(int ndf)
Definition: KFPVertex.h:75
float GetParameter(int i) const
Definition: KFPVertex.h:56
void SetChi2(float chi)
Definition: KFPVertex.h:74
void SetY(float y)
Definition: KFPVertex.h:72
void SetNContributors(int nc)
Definition: KFPVertex.h:76
unsigned int i
Definition: P4_F32vec4.h:33
KFPVertex()
Definition: KFPVertex.h:18
void SetCovarianceMatrix(float C00, float C10, float C11, float C20, float C21, float C22)
Definition: KFPVertex.h:84
void SetZ(float z)
Definition: KFPVertex.h:73
void GetXYZ(double *position) const
Definition: KFPVertex.h:34
void SetX(float x)
Definition: KFPVertex.h:71
void GetCovarianceMatrix(float *covmatrix) const
Definition: KFPVertex.h:40
void SetXYZ(float *position)
Definition: KFPVertex.h:59
void SetXYZ(float x, float y, float z)
Definition: KFPVertex.h:65
float GetChi2() const
Definition: KFPVertex.h:52
int GetNContributors() const
Definition: KFPVertex.h:54
int GetNDF() const
Definition: KFPVertex.h:53
float GetX() const
Definition: KFPVertex.h:24
void SetCovarianceMatrix(float *C)
Definition: KFPVertex.h:78
float GetChi2perNDF() const
Definition: KFPVertex.h:51
float GetZ() const
Definition: KFPVertex.h:26