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