From 0d219ef5d6b9d97fb88f62404d8c422ad3102a5f Mon Sep 17 00:00:00 2001 From: David Rohr Date: Wed, 2 Dec 2026 17:10:29 +0100 Subject: [PATCH 1/2] GPU TPC Clusterizer: correct handling of cluster overlap --- .../TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx index dd015f3bc61e9..1999f639ce79a 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx @@ -891,7 +891,14 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, // Use the middle of the saturated plateau, averaged over all tails of the cluster that were triggered by saturation on their own pad. // Computed only here: chains consisting only of tails inherited from neighboring pads have no saturated plateau, // but these never contain a saturated charge and are dropped by the qMax cut. - const float clusterTime = frag.start + satTimeSum / nSatTails - clusterer.Param().rec.tpc.clustersShiftTimebinsClusterizer; + const float fragmentTime = satTimeSum / nSatTails; + if (frag.isOverlap((tpccf::TPCFragmentTime)fragmentTime)) { // The neighboring fragment creates this cluster + if (clusterPosInRow) { + clusterPosInRow[iTail] = clusterer.mNMaxClusterPerRow; + } + continue; + } + const float clusterTime = frag.start + fragmentTime - clusterer.Param().rec.tpc.clustersShiftTimebinsClusterizer; assert(!CAMath::IsNaN(clusterTime)); const uint8_t flags = singlePad ? tpc::ClusterNative::flagSingle : 0; From 43b5cc3d022ab0513fa3c70576a2ff560fcd69dd Mon Sep 17 00:00:00 2001 From: David Rohr Date: Wed, 2 Dec 2026 19:46:56 +0100 Subject: [PATCH 2/2] GPU TPC Clusterizer: Copy HIP clusters to host for MC label creation --- GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx index 4575bf538c0c8..5c9eb781856e3 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx @@ -1384,6 +1384,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput) } if (doGPU && propagateMCLabels) { TransferMemoryResourceLinkToHost(RecoStep::TPCClusterFinding, clusterer.mScratchClustersId, lane); + GPUMemCpy(RecoStep::TPCClusterFinding, clusterer.mPhipClusterPosInRow, clustererShadow.mPhipClusterPosInRow, GPUTPCGeometry::NROWS * GPUTPCCFHIPClusterizer::MaxHIPTailsPerRow * sizeof(*clusterer.mPhipClusterPosInRow), lane, false); // Written by the kernel above, part of the scratch memory SynchronizeStream(lane); runKernel({GetGrid(GPUTPCGeometry::NROWS, lane, GPUReconstruction::krnlDeviceType::CPU), {iSector}}, 1); // Computes MC labels }