CbmRoot
CbmLitConverterFairTrackParam.h
Go to the documentation of this file.
1 #ifndef CBMLITCONVERTERFAIRTRACKPARAM_H_
2 #define CBMLITCONVERTERFAIRTRACKPARAM_H_
3 
4 #include "base/CbmLitEnums.h"
5 #include "base/CbmLitTypes.h"
6 
7 //#include "data/CbmLitHit.h"
8 //#include "data/CbmLitPixelHit.h"
9 //#include "data/CbmLitStripHit.h"
10 //#include "data/CbmLitTrack.h"
11 #include "data/CbmLitTrackParam.h"
12 //#include "data/CbmLitFitNode.h"
13 //#include "data/CbmLitTofTrack.h"
14 
15 //#include "CbmTrack.h"
16 //#include "CbmTofTrack.h"
17 //#include "CbmHit.h"
18 //#include "CbmPixelHit.h"
19 //#include "CbmStripHit.h"
20 #include "CbmTrackParam.h"
21 //#include "CbmStsTrack.h"
22 //#include "CbmTrdTrack.h"
23 //#include "CbmMuchGeoScheme.h"
24 //#include "CbmMvdHit.h"
25 //#include "CbmMuchTrack.h"
26 
27 //#include "CbmGlobalTrack.h"
28 //#include "CbmTrdAddress.h"
29 
30 #include "TClonesArray.h"
31 
32 #include <cassert>
33 #include <cmath>
34 #include <iostream>
35 #include <set>
36 
37 
39 public:
40  static void FairTrackParamToCbmLitTrackParam(const FairTrackParam* par,
41  CbmLitTrackParam* litPar) {
42  litPar->SetX((litfloat) par->GetX());
43  litPar->SetY((litfloat) par->GetY());
44  litPar->SetZ((litfloat) par->GetZ());
45  litPar->SetTx((litfloat) par->GetTx());
46  litPar->SetTy((litfloat) par->GetTy());
47  litPar->SetQp((litfloat) par->GetQp());
48  litPar->SetTime(0);
49  Double_t cov[15];
50  par->CovMatrix(cov);
51  std::vector<litfloat> covVec(21);
52  for (UInt_t i = 0; i < 5; ++i) {
53  covVec[i] = (litfloat) cov[i];
54  }
55  for (UInt_t i = 5; i < 9; ++i) {
56  covVec[i + 1] = (litfloat) cov[i];
57  }
58  for (UInt_t i = 9; i < 12; ++i) {
59  covVec[i + 2] = (litfloat) cov[i];
60  }
61  for (UInt_t i = 12; i < 14; ++i) {
62  covVec[i + 3] = (litfloat) cov[i];
63  }
64  covVec[18] = (litfloat) cov[14];
65  covVec[5] = 0;
66  covVec[10] = 0;
67  covVec[5] = 0;
68  covVec[14] = 0;
69  covVec[17] = 0;
70  covVec[19] = 0;
71  covVec[20] = 4 * 4;
72  litPar->SetCovMatrix(covVec);
73  }
74 
76  CbmLitTrackParam* litPar) {
77  litPar->SetX((litfloat) par->GetX());
78  litPar->SetY((litfloat) par->GetY());
79  litPar->SetZ((litfloat) par->GetZ());
80  litPar->SetTx((litfloat) par->GetTx());
81  litPar->SetTy((litfloat) par->GetTy());
82  litPar->SetQp((litfloat) par->GetQp());
83  litPar->SetTime((litfloat) par->GetTime());
84  Double_t cov[15];
85  par->CovMatrix(cov);
86  std::vector<litfloat> covVec(21);
87  for (UInt_t i = 0; i < 5; ++i) {
88  covVec[i] = (litfloat) cov[i];
89  }
90  for (UInt_t i = 5; i < 9; ++i) {
91  covVec[i + 1] = (litfloat) cov[i];
92  }
93  for (UInt_t i = 9; i < 12; ++i) {
94  covVec[i + 2] = (litfloat) cov[i];
95  }
96  for (UInt_t i = 12; i < 14; ++i) {
97  covVec[i + 3] = (litfloat) cov[i];
98  }
99  covVec[18] = (litfloat) cov[14];
100  covVec[5] = 0;
101  covVec[10] = 0;
102  covVec[5] = 0;
103  covVec[14] = 0;
104  covVec[17] = 0;
105  covVec[19] = 0;
106  covVec[20] = (litfloat)(par->GetDTime() * par->GetDTime());
107  litPar->SetCovMatrix(covVec);
108  }
109 
111  FairTrackParam* par) {
112  par->SetX(litPar->GetX());
113  par->SetY(litPar->GetY());
114  par->SetZ(litPar->GetZ());
115  par->SetTx(litPar->GetTx());
116  par->SetTy(litPar->GetTy());
117  par->SetQp(litPar->GetQp());
118  Double_t cov[15];
119  std::vector<litfloat> covVec(litPar->GetCovMatrix());
120  for (UInt_t i = 0; i < 5; ++i) {
121  cov[i] = (Double_t) covVec[i];
122  }
123  for (UInt_t i = 5; i < 9; ++i) {
124  cov[i] = (Double_t) covVec[i + 1];
125  }
126  for (UInt_t i = 9; i < 12; ++i) {
127  cov[i] = (Double_t) covVec[i + 2];
128  }
129  for (UInt_t i = 12; i < 14; ++i) {
130  cov[i] = (Double_t) covVec[i + 3];
131  }
132  cov[14] = (Double_t) covVec[18];
133  par->SetCovMatrix(cov);
134  }
135 };
136 
137 #endif /*CBMLITCONVERTERFAIRTRACKPARAM_H_*/
CbmLitTrackParam.h
Data class for track parameters.
CbmLitTrackParam::SetTy
void SetTy(litfloat ty)
Definition: CbmLitTrackParam.h:68
litfloat
double litfloat
Definition: CbmLitFloat.h:15
CbmLitConverterFairTrackParam
Definition: CbmLitConverterFairTrackParam.h:38
CbmLitTrackParam::GetX
litfloat GetX() const
Definition: CbmLitTrackParam.h:53
CbmLitTrackParam
Data class for track parameters.
Definition: CbmLitTrackParam.h:29
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmLitTrackParam::GetY
litfloat GetY() const
Definition: CbmLitTrackParam.h:54
CbmLitTrackParam::GetQp
litfloat GetQp() const
Definition: CbmLitTrackParam.h:58
CbmLitTrackParam::SetZ
void SetZ(litfloat z)
Definition: CbmLitTrackParam.h:66
CbmLitTrackParam::SetQp
void SetQp(litfloat qp)
Definition: CbmLitTrackParam.h:69
CbmLitConverterFairTrackParam::CbmLitTrackParamToFairTrackParam
static void CbmLitTrackParamToFairTrackParam(const CbmLitTrackParam *litPar, FairTrackParam *par)
Definition: CbmLitConverterFairTrackParam.h:110
CbmLitConverterFairTrackParam::FairTrackParamToCbmLitTrackParam
static void FairTrackParamToCbmLitTrackParam(const CbmTrackParam *par, CbmLitTrackParam *litPar)
Definition: CbmLitConverterFairTrackParam.h:75
CbmLitEnums.h
Define enumerations used in littrack.
CbmLitTrackParam::SetTime
void SetTime(litfloat t)
Definition: CbmLitTrackParam.h:70
CbmLitTrackParam::GetZ
litfloat GetZ() const
Definition: CbmLitTrackParam.h:55
CbmLitTrackParam::SetY
void SetY(litfloat y)
Definition: CbmLitTrackParam.h:65
CbmTrackParam::GetDTime
Double_t GetDTime() const
Definition: CbmTrackParam.h:46
CbmTrackParam::GetTime
Double_t GetTime() const
Definition: CbmTrackParam.h:45
CbmLitTrackParam::SetCovMatrix
void SetCovMatrix(const vector< litfloat > &C)
Definition: CbmLitTrackParam.h:71
CbmTrackParam
Definition: CbmTrackParam.h:22
CbmLitTypes.h
Typedefs for data structures used in littrack.
CbmLitTrackParam::GetCovMatrix
const vector< litfloat > & GetCovMatrix() const
Definition: CbmLitTrackParam.h:61
CbmLitTrackParam::GetTy
litfloat GetTy() const
Definition: CbmLitTrackParam.h:57
CbmLitTrackParam::SetX
void SetX(litfloat x)
Definition: CbmLitTrackParam.h:64
CbmLitTrackParam::GetTx
litfloat GetTx() const
Definition: CbmLitTrackParam.h:56
CbmLitTrackParam::SetTx
void SetTx(litfloat tx)
Definition: CbmLitTrackParam.h:67
CbmLitConverterFairTrackParam::FairTrackParamToCbmLitTrackParam
static void FairTrackParamToCbmLitTrackParam(const FairTrackParam *par, CbmLitTrackParam *litPar)
Definition: CbmLitConverterFairTrackParam.h:40
CbmTrackParam.h