@@ -85,7 +85,7 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
8585 StoreOuter (&track.OuterParam (), prop.GetAlpha ()); // TODO: Fix outer param!
8686 }
8787
88- int32_t resetT0 = initResetT0 ( );
88+ int32_t resetT0 = CAMath::Max ( 10 , CAMath::Min< int32_t >( 40 , 150 . f / CAMath::Abs ( mP [ 4 ])) );
8989 const bool refit = (nWays == 1 || iWay >= 1 );
9090 const bool finalOutInFit = iWay + 2 >= nWays;
9191 const bool finalFit = iWay == nWays - 1 ;
@@ -239,9 +239,15 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
239239 continue ;
240240 }
241241
242- 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, resetT0, uncorrectedY, retryAttempt);
242+ 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);
243243 if (retValHit == 0 ) {
244- DodEdx (dEdx, dEdxAlt, merger, finalFit, ihit, ihitMergeFirst, wayDirection, clusters, clusterState, zz, dEdxSubThresholdRow);
244+ DodEdx (dEdx, dEdxAlt, merger, finalFit, ihit, ihitMergeFirst, wayDirection, clusters, clusterState, zz, dEdxSubThresholdRow GPUCA_DEBUG_STREAMER_CHECK (, iTrk));
245+ if (CAMath::Abs (mP [4 ]) * param.qptB5Scaler > 10 && --resetT0 <= 0 && CAMath::Abs (mP [2 ]) < 0 .15f && CAMath::Square (mP [0 ] - prop.Model ().Y ()) + CAMath::Square (mP [1 ] - prop.Model ().Z ()) > 1 ) {
246+ CADEBUG (printf (" Reinit linearization\n " ));
247+ prop.SetTrack (this , prop.GetAlpha ());
248+ resetT0 = 20 ;
249+ }
250+
245251 ihitStart = ihit;
246252 interpolatedStart = interpolationIndex;
247253 N++;
@@ -347,7 +353,7 @@ GPUdii() void GPUTPCGMTrackParam::HandleCrossCE(const GPUParam& GPUrestrict() pa
347353 }
348354}
349355
350- GPUdii () int32_t GPUTPCGMTrackParam::FitHit(GPUTPCGMMerger& GPUrestrict () merger, const int32_t iTrk, const GPUTPCGMMergedTrack& GPUrestrict() track, const float xx, const float yy, const float zz, const uint8_t clusterState, const float clAlpha, const int32_t iWay, const bool inFlyDirection, float& GPUrestrict() deltaZ, float& GPUrestrict() lastUpdateX, GPUTPCGMMergedTrackHit* GPUrestrict() clusters, GPUTPCGMPropagator& GPUrestrict() prop, gputpcgmmergertypes::InterpolationErrorHit& GPUrestrict() inter, GPUdEdx& GPUrestrict() dEdx, GPUdEdx& GPUrestrict() dEdxAlt, float& GPUrestrict() sumInvSqrtCharge, int32_t& GPUrestrict() nAvgCharge, const int32_t ihit, const int32_t ihitMergeFirst, const bool allowChangeClusters, const bool refit, const bool finalFit, int32_t& GPUrestrict() nMissed, int32_t& GPUrestrict() nMissed2, int32_t& GPUrestrict() resetT0, float uncorrectedY, bool retryAttempt)
356+ GPUdii () int32_t GPUTPCGMTrackParam::FitHit(GPUTPCGMMerger& GPUrestrict () merger, const int32_t iTrk, const GPUTPCGMMergedTrack& GPUrestrict() track, const float xx, const float yy, const float zz, const uint8_t clusterState, const float clAlpha, const int32_t iWay, const bool inFlyDirection, float& GPUrestrict() deltaZ, float& GPUrestrict() lastUpdateX, GPUTPCGMMergedTrackHit* GPUrestrict() clusters, GPUTPCGMPropagator& GPUrestrict() prop, gputpcgmmergertypes::InterpolationErrorHit& GPUrestrict() inter, GPUdEdx& GPUrestrict() dEdx, GPUdEdx& GPUrestrict() dEdxAlt, float& GPUrestrict() sumInvSqrtCharge, int32_t& GPUrestrict() nAvgCharge, const int32_t ihit, const int32_t ihitMergeFirst, const bool allowChangeClusters, const bool refit, const bool finalFit, int32_t& GPUrestrict() nMissed, int32_t& GPUrestrict() nMissed2, float uncorrectedY, bool retryAttempt)
351357{
352358 const GPUParam& GPUrestrict () param = merger.Param ();
353359 const int32_t nWays = param.rec .tpc .nWays ;
@@ -412,12 +418,6 @@ GPUdii() int32_t GPUTPCGMTrackParam::FitHit(GPUTPCGMMerger& GPUrestrict() merger
412418 lastUpdateX = mX ;
413419 nMissed = nMissed2 = 0 ;
414420 UnmarkClusters (clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
415- float dy = mP [0 ] - prop.Model ().Y ();
416- float dz = mP [1 ] - prop.Model ().Z ();
417- if (CAMath::Abs (mP [4 ]) * param.qptB5Scaler > 10 && --resetT0 <= 0 && CAMath::Abs (mP [2 ]) < 0 .15f && dy * dy + dz * dz > 1 ) {
418- CADEBUG (printf (" Reinit linearization\n " ));
419- prop.SetTrack (this , prop.GetAlpha ());
420- }
421421 return 0 ; // ok
422422 } else if (retValInt || retValUpd >= GPUTPCGMPropagator::updateErrorClusterRejected) { // cluster far away form the track
423423 if (retValInt || allowChangeClusters) {
@@ -570,7 +570,7 @@ GPUdni() void GPUTPCGMTrackParam::InterpolateMissingRows(GPUTPCGMMerger& GPUrest
570570 }
571571}
572572
573- GPUd () void GPUTPCGMTrackParam::DodEdx(GPUdEdx& GPUrestrict () dEdx, GPUdEdx& GPUrestrict() dEdxAlt, GPUTPCGMMerger& GPUrestrict() merger, bool finalFit, int ihit, int ihitMergeFirst, int wayDirection, const GPUTPCGMMergedTrackHit* GPUrestrict() clusters, uint8_t clusterState, float zz, uint8_t dEdxSubThresholdRow)
573+ GPUd () void GPUTPCGMTrackParam::DodEdx(GPUdEdx& GPUrestrict () dEdx, GPUdEdx& GPUrestrict() dEdxAlt, GPUTPCGMMerger& GPUrestrict() merger, bool finalFit, int ihit, int ihitMergeFirst, int wayDirection, const GPUTPCGMMergedTrackHit* GPUrestrict() clusters, uint8_t clusterState, float zz, uint8_t dEdxSubThresholdRow GPUCA_DEBUG_STREAMER_CHECK(, int32_t iTrk) )
574574{
575575 const GPUParam& GPUrestrict () param = merger.Param ();
576576 if GPUCA_RTC_CONSTEXPR (GPUCA_GET_CONSTEXPR (param.par , dodEdx)) {
0 commit comments