12 #include "KFPTrackVector.h"
13 #include "KFParticle.h"
14 #include "KFParticleSIMD.h"
17 #include "TClonesArray.h"
19 #include "TStopwatch.h"
32 vector<CbmStsTrack> vRTracks(1);
36 vector<float> vChiToPrimVtx;
39 vector<L1FieldRegion> vField;
40 fitter.
GetChiToVertex(vRTracks, vField, vChiToPrimVtx, kfVertex, -3);
45 for (Int_t iTr = 0; iTr < 1; iTr++) {
46 const FairTrackParam* parameters;
49 parameters = vRTracks[iTr].GetParamFirst();
51 parameters = vRTracks[iTr].GetParamLast();
55 Double_t V[15] = {0.f};
57 for (Int_t
i = 0, iCov = 0;
i < 5;
i++)
58 for (Int_t j = 0; j <=
i; j++, iCov++)
59 V[iCov] = parameters->GetCovariance(
i, j);
61 float a = parameters->GetTx(), b = parameters->GetTy(),
62 qp = parameters->GetQp();
67 if (TMath::Abs(pdg) == 1000020030 || TMath::Abs(pdg) == 1000020040) q *= 2;
69 float c2 = 1.f / (1.f + a * a + b * b);
70 float pq = 1.f / qp * TMath::Abs(q);
72 float pz =
sqrt(p2 * c2);
76 float H[3] = {-px * c2, -py * c2, -pz * pq};
78 par[0] = parameters->GetX();
79 par[1] = parameters->GetY();
80 par[2] = parameters->GetZ();
85 float cxpz = H[0] * V[3] + H[1] * V[6] + H[2] * V[10];
86 float cypz = H[0] * V[4] + H[1] * V[7] + H[2] * V[11];
87 float capz = H[0] * V[5] + H[1] * V[8] + H[2] * V[12];
88 float cbpz = H[0] * V[8] + H[1] * V[9] + H[2] * V[13];
90 H[0] * H[0] * V[5] + H[1] * H[1] * V[9] + H[2] * H[2] * V[14]
91 + 2 * (H[0] * H[1] * V[8] + H[0] * H[2] * V[12] + H[1] * H[2] * V[13]);
100 cov[6] = V[3] * pz + a * cxpz;
101 cov[7] = V[4] * pz + a * cypz;
103 cov[9] = V[5] * pz * pz + 2.f * a * pz * capz + a * a * cpzpz;
104 cov[10] = V[6] * pz + b * cxpz;
105 cov[11] = V[7] * pz + b * cypz;
107 cov[13] = V[8] * pz * pz + a * pz * cbpz + b * pz * capz + a * b * cpzpz;
108 cov[14] = V[9] * pz * pz + 2.f * b * pz * cbpz + b * b * cpzpz;
112 cov[18] = capz * pz + a * cpzpz;
113 cov[19] = cbpz * pz + b * cpzpz;
119 field[0] = vField[entrVec].cx0[entrSIMD];
120 field[1] = vField[entrVec].cx1[entrSIMD];
121 field[2] = vField[entrVec].cx2[entrSIMD];
122 field[3] = vField[entrVec].cy0[entrSIMD];
123 field[4] = vField[entrVec].cy1[entrSIMD];
124 field[5] = vField[entrVec].cy2[entrSIMD];
125 field[6] = vField[entrVec].cz0[entrSIMD];
126 field[7] = vField[entrVec].cz1[entrSIMD];
127 field[8] = vField[entrVec].cz2[entrSIMD];
128 field[9] = vField[entrVec].z0[entrSIMD];
130 for (Int_t iP = 0; iP < 6; iP++)
131 tracks.SetParameter(par[iP], iP, iTr);
132 for (Int_t iC = 0; iC < 21; iC++)
133 tracks.SetCovariance(cov[iC], iC, iTr);
134 for (Int_t iF = 0; iF < 10; iF++)
135 tracks.SetFieldCoefficient(field[iF], iF, iTr);
139 tracks.SetPVIndex(-1, iTr);
143 unsigned int index = 0;
144 uint_v indexSIMD(index);
146 KFParticleSIMD particleSIMD(
tracks, indexSIMD, pdgSIMD);
147 particleSIMD.GetKFParticle(*particle, 0);
149 particle->NDF() = track->
GetNDF();
150 particle->Chi2() = track->
GetChiSq();
155 FairTrackParam* paramAtPV,
157 vector<CbmStsTrack> vRTracks(1);
158 vRTracks[0] = *track;
161 vector<float> vChiToPrimVtx;
165 vector<L1FieldRegion> vField;
166 fitter.
GetChiToVertex(vRTracks, vField, vChiToPrimVtx, kfVertex, 1000000.
f);
168 chiPrim = vChiToPrimVtx[0];
169 *paramAtPV = *(vRTracks[0].GetParamFirst());