CbmRoot
CbmTrackParam2.h
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 
7 #ifndef CBM_TRACK_PARAM2
8 #define CBM_TRACK_PARAM2
9 
10 #include "FairTrackParam.h"
11 //#include "TMatrixD.h"
12 #include <algorithm>
13 #include <iostream>
14 #include <iterator>
15 #include <type_traits>
16 
17 /*static inline std::ostream& operator<< (std::ostream& os, const TMatrixD& matrix)
18 {
19  for (int i = 0; i < matrix.GetNrows(); ++i)
20  {
21  for (int j = 0; j < matrix.GetNcols(); ++j)
22  os << matrix(i, j) << " ";
23 
24  os << std::endl;
25  }
26 
27  return os;
28 }*/
29 
30 /*class CbmTrackParam2
31 {
32 public:
33  CbmTrackParam2() : fZ(0), fVector(5, 1), fCovMatrix(5, 5) {}
34 
35  Double_t GetX() const { return fVector(0, 0); }
36  void SetX(Double_t v) { fVector(0, 0) = v; }
37  Double_t GetY() const { return fVector(1, 0); }
38  void SetY(Double_t v) { fVector(1, 0) = v; }
39  Double_t GetZ() const { return fZ; }
40  void SetZ(Double_t v) { fZ = v; }
41  Double_t GetTx() const { return fVector(2, 0); }
42  void SetTx(Double_t v) { fVector(2, 0) = v; }
43  Double_t GetTy() const { return fVector(3, 0); }
44  void SetTy(Double_t v) { fVector(3, 0) = v; }
45  Double_t GetTime() const { return fVector(4, 0); }
46  void SetTime(Double_t time) { fVector(4, 0) = time; }
47 
48  TMatrixD& GetVector() { return fVector; }
49  const TMatrixD& GetVector() const { return fVector; }
50 
51 
52  //void CovMatrix(Double_t cov[]) const { std::copy(std::begin(fCovMatrix), std::end(fCovMatrix), cov); }
53  //void SetCovMatrix(Double_t cov[]) { std::copy(cov, cov + 21, std::begin(fCovMatrix)); }
54  //Double_t GetCovariance(Int_t i, Int_t j) const { return fCovMatrix[i * (13 - i) / 2 + j - i]; }
55  //void SetCovariance(Int_t i, Int_t j, Double_t val) { fCovMatrix[i * (13 - i) / 2 + j - i] = val; }
56  Double_t GetCov(int i, int j) const { return fCovMatrix(i, j); }
57  void SetCov(int i, int j, Double_t v) { fCovMatrix(i, j) = v; fCovMatrix(j, i) = v; }
58 
59  TMatrixD& GetCovMatrix() { return fCovMatrix; }
60  const TMatrixD& GetCovMatrix() const { return fCovMatrix; }
61 
62 private:
63  Double_t fZ;
64  TMatrixD fVector;
65  TMatrixD fCovMatrix;
66 };*/
67 
68 class CbmTrackParam2 : public FairTrackParam {
69 public:
70  Double_t GetTime() const { return GetQp(); }
71  void SetTime(Double_t time) { SetQp(time); }
72 
73  Double_t GetCovXX() const { return GetCovariance(0, 0); }
74  void SetCovXX(Double_t v) { SetCovariance(0, 0, v); }
75  Double_t GetCovYY() const { return GetCovariance(1, 1); }
76  void SetCovYY(Double_t v) { SetCovariance(1, 1, v); }
77  Double_t GetCovXY() const { return GetCovariance(0, 1); }
78  void SetCovXY(Double_t v) { SetCovariance(0, 1, v); }
79  Double_t GetCovTxTx() const { return GetCovariance(2, 2); }
80  void SetCovTxTx(Double_t v) { SetCovariance(2, 2, v); }
81  Double_t GetCovTyTy() const { return GetCovariance(3, 3); }
82  void SetCovTyTy(Double_t v) { SetCovariance(3, 3, v); }
83  Double_t GetCovTT() const { return GetCovariance(4, 4); }
84  void SetCovTT(Double_t v) { SetCovariance(4, 4, v); }
85 
86 private:
87  Double_t GetCovariance(Int_t i, Int_t j) const {
88  return FairTrackParam::GetCovariance(i, j);
89  }
90  void SetCovariance(Int_t i, Int_t j, Double_t val) {
91  FairTrackParam::SetCovariance(i, j, val);
92  }
93 
94 private:
96 };
97 
98 #endif //CBM_TRACK_PARAM2
CbmTrackParam2::GetTime
Double_t GetTime() const
Definition: CbmTrackParam2.h:70
CbmTrackParam2::GetCovYY
Double_t GetCovYY() const
Definition: CbmTrackParam2.h:75
CbmTrackParam2::GetCovTT
Double_t GetCovTT() const
Definition: CbmTrackParam2.h:83
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTrackParam2::GetCovXY
Double_t GetCovXY() const
Definition: CbmTrackParam2.h:77
CbmTrackParam2::SetCovTxTx
void SetCovTxTx(Double_t v)
Definition: CbmTrackParam2.h:80
CbmTrackParam2::SetCovXY
void SetCovXY(Double_t v)
Definition: CbmTrackParam2.h:78
CbmTrackParam2::SetCovariance
void SetCovariance(Int_t i, Int_t j, Double_t val)
Definition: CbmTrackParam2.h:90
CbmTrackParam2::GetCovTyTy
Double_t GetCovTyTy() const
Definition: CbmTrackParam2.h:81
CbmTrackParam2::SetTime
void SetTime(Double_t time)
Definition: CbmTrackParam2.h:71
CbmTrackParam2::SetCovXX
void SetCovXX(Double_t v)
Definition: CbmTrackParam2.h:74
CbmTrackParam2::GetCovXX
Double_t GetCovXX() const
Definition: CbmTrackParam2.h:73
CbmTrackParam2::SetCovTT
void SetCovTT(Double_t v)
Definition: CbmTrackParam2.h:84
CbmTrackParam2
Definition: CbmTrackParam2.h:68
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
CbmTrackParam2::ClassDef
ClassDef(CbmTrackParam2, 1)
CbmTrackParam2::GetCovariance
Double_t GetCovariance(Int_t i, Int_t j) const
Definition: CbmTrackParam2.h:87
CbmTrackParam2::GetCovTxTx
Double_t GetCovTxTx() const
Definition: CbmTrackParam2.h:79
CbmTrackParam2::SetCovYY
void SetCovYY(Double_t v)
Definition: CbmTrackParam2.h:76
CbmTrackParam2::SetCovTyTy
void SetCovTyTy(Double_t v)
Definition: CbmTrackParam2.h:82