64 prop.SetPolynomialField(&processors.param.polynomialField);
66 prop.SetToyMCEventsFlag(0);
67 prop.SetFitInProjections(1);
71 int32_t roadCounters[4]{0, 0, 0, 0};
72 int32_t fitCounters[4]{0, 0, 0, 0};
73 int32_t backpropagatedCounters[4]{0, 0, 0, 0};
74 int32_t refitCounters[4]{0, 0, 0, 0};
77 Road<5>& road = Fitter.roads()[iRoad];
82 for (int32_t iCell{0}; iCell < Fitter.NumberOfLayers() - 2; ++iCell) {
83 const int32_t cellIndex = road[iCell];
87 clusters[iCell] = Fitter.cells()[iCell][cellIndex].getFirstClusterIndex();
88 clusters[iCell + 1] = Fitter.cells()[iCell][cellIndex].getSecondClusterIndex();
89 clusters[iCell + 2] = Fitter.cells()[iCell][cellIndex].getThirdClusterIndex();
90 lastCellLevel = iCell;
102 for (int32_t iC{0}; iC < 7; iC++) {
108 const auto& cluster1 = Fitter.trackingFrame()[lastCellLevel + 2][
clusters[lastCellLevel + 2]];
109 const auto& cluster2 = Fitter.trackingFrame()[lastCellLevel + 1][
clusters[lastCellLevel + 1]];
110 const auto& cluster3 = Fitter.trackingFrame()[lastCellLevel][
clusters[lastCellLevel]];
114 const float ca = CAMath::Cos(cluster3.alphaTrackingFrame), sa = CAMath::Sin(cluster3.alphaTrackingFrame);
115 const float x1 = cluster1.xCoordinate * ca + cluster1.yCoordinate * sa;
116 const float y1 = -cluster1.xCoordinate * sa + cluster1.yCoordinate * ca;
117 const float z1 = cluster1.zCoordinate;
118 const float x2 = cluster2.xCoordinate * ca + cluster2.yCoordinate * sa;
119 const float y2 = -cluster2.xCoordinate * sa + cluster2.yCoordinate * ca;
120 const float z2 = cluster2.zCoordinate;
121 const float x3 = cluster3.xTrackingFrame;
122 const float y3 = cluster3.positionTrackingFrame[0];
123 const float z3 = cluster3.positionTrackingFrame[1];
125 const float crv = o2::its::math_utils::computeCurvature(
x1,
y1, x2, y2, x3, y3);
126 const float x0 = o2::its::math_utils::computeCurvatureCentreX(
x1,
y1, x2, y2, x3, y3);
127 const float tgl12 = o2::its::math_utils::computeTanDipAngle(
x1,
y1, x2, y2, z1, z2);
128 const float tgl23 = o2::its::math_utils::computeTanDipAngle(x2, y2, x3, y3, z2, z3);
130 const float r2 = CAMath::Sqrt(cluster2.xCoordinate * cluster2.xCoordinate + cluster2.yCoordinate * cluster2.yCoordinate);
131 const float r3 = CAMath::Sqrt(cluster3.xCoordinate * cluster3.xCoordinate + cluster3.yCoordinate * cluster3.yCoordinate);
132 const float fy = 1.f / (r2 - r3);
133 const float& tz = fy;
137 temporaryTrack.X() = cluster3.xTrackingFrame;
138 temporaryTrack.
Y() = y3;
139 temporaryTrack.
Z() = z3;
140 temporaryTrack.SinPhi() = crv * (x3 -
x0);
141 temporaryTrack.DzDs() = 0.5f * (tgl12 + tgl23);
143 temporaryTrack.TZOffset() = 0;
144 temporaryTrack.Cov()[0] = s2;
145 temporaryTrack.Cov()[1] = 0.f;
146 temporaryTrack.Cov()[2] = s2;
147 temporaryTrack.Cov()[3] = s2 * fy;
148 temporaryTrack.Cov()[4] = 0.f;
149 temporaryTrack.Cov()[5] = s2 * fy * fy;
150 temporaryTrack.Cov()[6] = 0.f;
151 temporaryTrack.Cov()[7] = s2 * tz;
152 temporaryTrack.Cov()[8] = 0.f;
153 temporaryTrack.Cov()[9] = s2 * tz * tz;
154 temporaryTrack.Cov()[10] = s2 * cy;
155 temporaryTrack.Cov()[11] = 0.f;
156 temporaryTrack.Cov()[12] = s2 * fy * cy;
157 temporaryTrack.Cov()[13] = 0.f;
158 temporaryTrack.Cov()[14] = s2 * cy * cy;
159 temporaryTrack.SetChi2(0);
160 temporaryTrack.SetNDF(-5);
162 prop.SetTrack(&temporaryTrack, cluster3.alphaTrackingFrame);
165 for (
size_t iC = 0; iC < 7; ++iC) {
168 bool fitSuccess = fitTrack(Fitter, prop, temporaryTrack, Fitter.NumberOfLayers() - 4, -1, -1);
173 temporaryTrack.ResetCovariance();
174 fitSuccess = fitTrack(Fitter, prop, temporaryTrack, 0, Fitter.NumberOfLayers(), 1);
179 for (int32_t k = 0; k < 5; k++) {
180 temporaryTrack.
mOuterParam.
P[k] = temporaryTrack.Par()[k];
182 for (int32_t k = 0; k < 15; k++) {
183 temporaryTrack.
mOuterParam.
C[k] = temporaryTrack.Cov()[k];
187 temporaryTrack.ResetCovariance();
188 fitSuccess = fitTrack(Fitter, prop, temporaryTrack, Fitter.NumberOfLayers() - 1, -1, -1);
193 int32_t trackId = CAMath::AtomicAdd(&Fitter.NumberOfTracks(), 1u);
194 Fitter.tracks()[trackId] = temporaryTrack;
197 GPUInfo(
"Roads: %i %i %i %i", roadCounters[0], roadCounters[1], roadCounters[2], roadCounters[3]);
198 GPUInfo(
"Fitted tracks: %i %i %i %i", fitCounters[0], fitCounters[1], fitCounters[2], fitCounters[3]);
199 GPUInfo(
"Backpropagated tracks: %i %i %i %i", backpropagatedCounters[0], backpropagatedCounters[1], backpropagatedCounters[2], backpropagatedCounters[3]);
200 GPUInfo(
"Refitted tracks: %i %i %i %i", refitCounters[0], refitCounters[1], refitCounters[2], refitCounters[3]);