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