@@ -217,26 +217,31 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
217217 }
218218
219219 const float maxSinForUpdate = CAMath::Sin (70 .f * CAMath::Deg2Rad ());
220- if (mNDF > 0 && CAMath::Abs (prop.GetSinPhi0 ()) >= maxSinForUpdate) {
221- MarkClusters (clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
222- nMissed2++;
223- CADEBUG (printf (" --- break-sinphi\n " ));
224- NTolerated++;
220+ if (mNDF > 0 && CAMath::Abs (prop.GetSinPhi0 ()) >= maxSinForUpdate) { // TODO: If NDF is large enough, and mP[2] is not yet out of range, reinit linearization
225221 const bool inward = clusters[0 ].row > clusters[maxN - 1 ].row ;
226222 const bool markHighIncl = (mP [2 ] > 0 ) ^ (mP [4 ] < 0 ) ^ inward ^ (iWay & 1 );
227- if (param.rec .tpc .rebuildTrackInFit && markHighIncl) {
228- if (inward ^ (iWay & 1 )) {
229- if (merger.TrackRebuildHelper ()[iTrk].highInclRowLow == 255 ) {
230- merger.TrackRebuildHelper ()[iTrk].highInclRowLow = cluster.row ;
231- }
232- } else {
233- if (merger.TrackRebuildHelper ()[iTrk].highInclRowHigh == 255 ) {
234- merger.TrackRebuildHelper ()[iTrk].highInclRowHigh = cluster.row ;
223+ if (mNDF > 10 && CAMath::Abs (mP [2 ]) < maxSinForUpdate && markHighIncl) {
224+ CADEBUG (printf (" Reinit linearization\n " ));
225+ prop.SetTrack (this , prop.GetAlpha ());
226+ } else {
227+ MarkClusters (clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
228+ nMissed2++;
229+ CADEBUG (printf (" --- break-sinphi\n " ));
230+ NTolerated++;
231+ if (param.rec .tpc .rebuildTrackInFit && markHighIncl) {
232+ if (inward ^ (iWay & 1 )) {
233+ if (merger.TrackRebuildHelper ()[iTrk].highInclRowLow == 255 ) {
234+ merger.TrackRebuildHelper ()[iTrk].highInclRowLow = cluster.row ;
235+ }
236+ } else {
237+ if (merger.TrackRebuildHelper ()[iTrk].highInclRowHigh == 255 ) {
238+ merger.TrackRebuildHelper ()[iTrk].highInclRowHigh = cluster.row ;
239+ }
235240 }
241+ // TODO: We can perhaps break here, if we pick up remaining rows
236242 }
237- // TODO: We can perhaps break here, if we pick up remaining rows
243+ continue ;
238244 }
239- continue ;
240245 }
241246
242247 int32_t retValHit = FitHit (merger, iTrk, track, xx, yy, zz, clusterState, clAlpha, iWay, inFlyDirection, deltaZ, lastUpdateX, clusters, prop, inter, dEdx, dEdxAlt, sumInvSqrtCharge, nAvgCharge, ihit, ihitMergeFirst, allowChangeClusters, refit, finalFit, nMissed, nMissed2, uncorrectedY, retryAttempt);
0 commit comments