StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MTrack.h
1 #ifndef VTrack_H
2 #define VTrack_H
3 
4 class MTrack
5 {
6 
7 public:
8  MTrack() { }
9  ~MTrack() { }
10 /*MTrack(const MTrack& vTrack);
11  MTrack& operator=(const MTrack& vTrack);*/
12 
13  int GetID() const { return ID; }
14 
15  bool GetXYZ(double *p) const
16  {
17  for(int i=0; i<6; i++)
18  p[i] = fP[i];
19  return 1;
20  }
21  bool GetCovarianceXYZPxPyPz(double cv[21]) const
22  {
23  for (int i=0; i<21; i++)
24  cv[i] = fC[i];
25  return 1;
26  }
27 
28 // void GetXYZ(double *position) {position[0] = fP[0]; position[1] = fP[1]; position[1] = fP[1];}
29  void XvYvZv(double *position) const {position[0] = fP[0]; position[1] = fP[1]; position[2] = fP[2];}
30  void PxPyPz(double *position) const {position[0] = fP[3]; position[1] = fP[4]; position[2] = fP[5];}
31 
32  double GetX() const { return fP[0]; }
33  double GetY() const { return fP[1]; }
34  double GetZ() const { return fP[2]; }
35  double GetPx() const { return fP[3]; }
36  double GetPy() const { return fP[4]; }
37  double GetPz() const { return fP[5]; }
38  void GetCovarianceMatrix(double *covmatrix)
39  {
40  for (int i=0; i<21; i++)
41  covmatrix[i] = fC[i];
42  }
43  double GetParameter(int i) const { return fP[i]; }
44  double GetCovariance(int i) const { return fC[i]; }
45 
46  int Charge() const { return fQ; }
47  double GetChi2perNDF() const { return fChi2/fNDF; }
48  double GetChi2() const { return fChi2; }
49  int GetNDF() const { return fNDF; }
50 
51  void SetParameters(double *position)
52  {
53  for(int i=0; i<6; i++)
54  fP[i] = position[i];
55  }
56  void SetParameters(double x, double y, double z, double px, double py, double pz)
57  {
58  fP[0] = x; fP[1] = y; fP[2] = z;
59  fP[3] = px; fP[4] = py; fP[5] = pz;
60  }
61  void SetXYZ(double x, double y, double z)
62  {
63  fP[0] = x; fP[1] = y; fP[2] = z;
64  }
65  void SetPxPyPz(double px, double py, double pz)
66  {
67  fP[3] = px; fP[4] = py; fP[5] = pz;
68  }
69  void SetID(int id) {ID = id;}
70 
71  void SetX(double x) { fP[0] = x; }
72  void SetY(double y) { fP[1] = y; }
73  void SetZ(double z) { fP[2] = z; }
74  void SetCharge(int q) { fQ = q; }
75  void SetChi2(double chi) { fChi2 = chi; }
76  void SetNDF(int ndf) { fNDF = ndf; }
77 
78  void SetCovarianceMatrix(double *C)
79  {
80  for (int i=0; i<21; i++)
81  fC[i] = C[i];
82  }
83 
84  private:
85 
86  int ID;
87  double fP[6]; //coordinates of the vertex
88  double fC[21]; //Covariance matrix of the vertex parameters
89  double fChi2; //chi-square of the vertex fitting
90  int fQ; //charge
91  int fNDF; //degree of freedom number
92 };
93 
94 #endif
Definition: MTrack.h:4