@@ -1489,7 +1489,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
14891489 if (jtr >= 0 ) {
14901490 int32_t lasttr = itr;
14911491 while (jtr >= 0 ) { // --------------- count segments ---------------
1492- if (&mSectorTrackInfos [jtr] == trbase) {
1492+ if (Param (). rec . enableCyclicGraphWorkarounds && &mSectorTrackInfos [jtr] == trbase) {
14931493 break ; // Break cyclic graph
14941494 }
14951495 lasttr = jtr;
@@ -1512,7 +1512,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
15121512 mainT = t;
15131513 }
15141514 int32_t next = trchk->NextSegmentNeighbour ();
1515- if (next < 0 || next == ichk) {
1515+ if (next < 0 || ( Param (). rec . enableCyclicGraphWorkarounds && next == ichk) ) {
15161516 break ; // Breaks also cycles
15171517 }
15181518 trchk = &mSectorTrackInfos [next];
@@ -1533,7 +1533,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
15331533 length = trchk->OrigTrack ()->NHits ();
15341534 }
15351535 int32_t next = trchk->NextSegmentNeighbour ();
1536- if (next < 0 || next == ichk) {
1536+ if (next < 0 || ( Param (). rec . enableCyclicGraphWorkarounds && next == ichk) ) {
15371537 break ; // Breaks also cycles
15381538 }
15391539 trchk = &mSectorTrackInfos [next];
@@ -1797,7 +1797,7 @@ GPUd() void GPUTPCGMMerger::PrepareForFit1(int32_t nBlocks, int32_t nThreads, in
17971797 CAMath::AtomicAdd (&mSharedCount [mClusters [trk.FirstClusterRef () + j].num ], 1u );
17981798 }
17991799 if (!trk.CCE () && !trk.MergedLooper ()) {
1800- GPUTPCGMMergedTrack* updTrk = trk.GetFirstSegment (mMergedTracks );
1800+ GPUTPCGMMergedTrack* updTrk = trk.GetFirstSegment (mMergedTracks , Param (). rec . enableCyclicGraphWorkarounds );
18011801 const auto &cl0 = mClusters [trk.FirstClusterRef ()], &cln = mClusters [updTrk->FirstClusterRef () + updTrk->NClusters () - 1 ];
18021802 const auto & GPUrestrict () cls = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear ;
18031803 float z0 = cls[cl0.num ].getTime (), zn = cls[cln.num ].getTime ();
@@ -1806,7 +1806,7 @@ GPUd() void GPUTPCGMMerger::PrepareForFit1(int32_t nBlocks, int32_t nThreads, in
18061806 updTrk = &trk;
18071807 while (updTrk->PrevSegment () >= 0 ) {
18081808 auto next = &mMergedTracks [updTrk->PrevSegment ()];
1809- if (next == &trk) {
1809+ if (Param (). rec . enableCyclicGraphWorkarounds && next == &trk) {
18101810 break ;
18111811 }
18121812 updTrk = next;
@@ -1966,7 +1966,7 @@ GPUd() void GPUTPCGMMerger::MergeLoopersMain(int32_t nBlocks, int32_t nThreads,
19661966 const GPUTPCGMMergedTrack* trkI = &mMergedTracks [candidates[i].id ];
19671967 float refZI = candidates[i].refz ;
19681968 {
1969- const auto * tmp = trkI->GetFirstSegment (mMergedTracks );
1969+ const auto * tmp = trkI->GetFirstSegment (mMergedTracks , Param (). rec . enableCyclicGraphWorkarounds );
19701970 if (tmp != trkI && tmp->CSide () == trkI->CSide () && CAMath::Abs (tmp->GetParam ().GetZ ()) > CAMath::Abs (trkI->GetParam ().GetZ ())) {
19711971 float tmpRefZ = refZI + tmp->GetParam ().GetZ () - trkI->GetParam ().GetZ ();
19721972 if (CAMath::Abs (tmpRefZ) < CAMath::Abs (candidates[j].refz ) && CAMath::Abs (tmpRefZ) > CAMath::Abs (refZI)) {
0 commit comments