@@ -218,26 +218,31 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
218218 }
219219
220220 const float maxSinForUpdate = CAMath::Sin (70 .f * CAMath::Deg2Rad ());
221- if (mNDF > 0 && CAMath::Abs (prop.GetSinPhi0 ()) >= maxSinForUpdate) {
222- MarkClusters (clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
223- nMissed2++;
224- CADEBUG (printf (" --- break-sinphi\n " ));
225- NTolerated++;
221+ 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
226222 const bool inward = clusters[0 ].row > clusters[maxN - 1 ].row ;
227223 const bool markHighIncl = (mP [2 ] > 0 ) ^ (mP [4 ] < 0 ) ^ inward ^ (iWay & 1 );
228- if (param.rec .tpc .rebuildTrackInFit && markHighIncl) {
229- if (inward ^ (iWay & 1 )) {
230- if (merger.TrackRebuildHelper ()[iTrk].highInclRowLow == 255 ) {
231- merger.TrackRebuildHelper ()[iTrk].highInclRowLow = cluster.row ;
232- }
233- } else {
234- if (merger.TrackRebuildHelper ()[iTrk].highInclRowHigh == 255 ) {
235- merger.TrackRebuildHelper ()[iTrk].highInclRowHigh = cluster.row ;
224+ if (mNDF > 10 && CAMath::Abs (mP [2 ]) < maxSinForUpdate && markHighIncl) {
225+ CADEBUG (printf (" Reinit linearization\n " ));
226+ prop.SetTrack (this , prop.GetAlpha ());
227+ } else {
228+ MarkClusters (clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
229+ nMissed2++;
230+ CADEBUG (printf (" --- break-sinphi\n " ));
231+ NTolerated++;
232+ if (param.rec .tpc .rebuildTrackInFit && markHighIncl) {
233+ if (inward ^ (iWay & 1 )) {
234+ if (merger.TrackRebuildHelper ()[iTrk].highInclRowLow == 255 ) {
235+ merger.TrackRebuildHelper ()[iTrk].highInclRowLow = cluster.row ;
236+ }
237+ } else {
238+ if (merger.TrackRebuildHelper ()[iTrk].highInclRowHigh == 255 ) {
239+ merger.TrackRebuildHelper ()[iTrk].highInclRowHigh = cluster.row ;
240+ }
236241 }
242+ // TODO: We can perhaps break here, if we pick up remaining rows
237243 }
238- // TODO: We can perhaps break here, if we pick up remaining rows
244+ continue ;
239245 }
240- continue ;
241246 }
242247
243248 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