From 6a0ce42bfc86bdddaaabbfee0d09a49ba6167813 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Wed, 5 Mar 2025 18:41:31 +0100 Subject: [PATCH 1/5] commit 1 --- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx | 2 +- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h | 1 + GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx index d145aaed705d9..c4e46058e01e0 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx @@ -97,7 +97,7 @@ GPUd() Charge ClusterAccumulator::updateOuter(PackedCharge charge, Delta2 d) return q; } -GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo) +GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo, const PackedCharge* buf) { mQtot += q; diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h index 26decbf0a5b14..43691bda28ccd 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h @@ -51,6 +51,7 @@ class ClusterAccumulator float mTimeSigma = 0; uint8_t mSplitInTime = 0; uint8_t mSplitInPad = 0; + bool edgeIsZero = 0; GPUd() void update(tpccf::Charge, tpccf::Delta2); }; diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx index ad07f2b93f3e0..6e731c5baf573 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx @@ -80,7 +80,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t } return; } - pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry); + pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry, smem.buf); tpc::ClusterNative myCluster; bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param()); From 5e63102a9bc587cc792305736865743eb62747d0 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Wed, 5 Mar 2025 19:59:04 +0100 Subject: [PATCH 2/5] Adapting edge correction --- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx | 7 ++++++- GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx index c4e46058e01e0..cf3e9c3d88310 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx @@ -97,7 +97,7 @@ GPUd() Charge ClusterAccumulator::updateOuter(PackedCharge charge, Delta2 d) return q; } -GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo, const PackedCharge* buf) +GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo, Charge* padBoundaryCharges) { mQtot += q; @@ -116,6 +116,11 @@ GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime if (CfUtils::isAtEdge(pos, geo.NPads(pos.row()))) { bool leftEdge = (pad < 2); bool correct = (leftEdge) ? (pad < mPadMean) : (pad > mPadMean); + if (leftEdge && pad == 1) { // only check charge at boundary if maximum is at least one pad away from boundary + correct = correct && (padBoundaryCharges[0] > 0); // Only correct if cluster is asymmetric with charge > 0 towards sector boundary, otherwise all charge is found + } else if (!leftEdge && pad == (geo.NPads(pos.row()) - 1)) { + correct = correct && (padBoundaryCharges[1] > 0); + } mPadMean = (correct) ? pad : mPadMean; } } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx index 6e731c5baf573..5078a4df9fdbf 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx @@ -58,6 +58,8 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t ChargePos pos = filteredPeakPositions[CAMath::Min(idx, clusternum - 1)]; Charge charge = chargeMap[pos].unpack(); + Charge padBoundaryCharges[2] = {chargeMap[pos.delta(-1,0)].unpack(), chargeMap[pos.delta(1,0)].unpack()}; + ClusterAccumulator pc; CPU_ONLY(labelAcc->collect(pos, charge)); @@ -80,7 +82,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t } return; } - pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry, smem.buf); + pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry, padBoundaryCharges); tpc::ClusterNative myCluster; bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param()); From 4246f5e73246b85f4be10d4de5bceb3f55118283 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Wed, 5 Mar 2025 20:48:02 +0100 Subject: [PATCH 3/5] Fixing edge handling --- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h | 3 +-- GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h index 43691bda28ccd..c409a6cced3a5 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h @@ -40,7 +40,7 @@ class ClusterAccumulator GPUd() tpccf::Charge updateInner(PackedCharge, tpccf::Delta2); GPUd() tpccf::Charge updateOuter(PackedCharge, tpccf::Delta2); - GPUd() void finalize(const ChargePos&, tpccf::Charge, tpccf::TPCTime, const GPUTPCGeometry&); + GPUd() void finalize(const ChargePos&, tpccf::Charge, tpccf::TPCTime, const GPUTPCGeometry&, tpccf::Charge*); GPUd() bool toNative(const ChargePos&, tpccf::Charge, tpc::ClusterNative&, const GPUParam&) const; private: @@ -51,7 +51,6 @@ class ClusterAccumulator float mTimeSigma = 0; uint8_t mSplitInTime = 0; uint8_t mSplitInPad = 0; - bool edgeIsZero = 0; GPUd() void update(tpccf::Charge, tpccf::Delta2); }; diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx index 5078a4df9fdbf..b11789937a975 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx @@ -58,7 +58,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t ChargePos pos = filteredPeakPositions[CAMath::Min(idx, clusternum - 1)]; Charge charge = chargeMap[pos].unpack(); - Charge padBoundaryCharges[2] = {chargeMap[pos.delta(-1,0)].unpack(), chargeMap[pos.delta(1,0)].unpack()}; + Charge padBoundaryCharges[2] = {chargeMap[pos.delta({-1,0})].unpack(), chargeMap[pos.delta({1,0})].unpack()}; ClusterAccumulator pc; CPU_ONLY(labelAcc->collect(pos, charge)); From 052579d1ee85eb0aa6f91e0da8496dcbca79707d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 5 Mar 2025 19:49:33 +0000 Subject: [PATCH 4/5] Please consider the following formatting changes --- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx | 2 +- GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx index cf3e9c3d88310..83c979eba19cf 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx @@ -116,7 +116,7 @@ GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime if (CfUtils::isAtEdge(pos, geo.NPads(pos.row()))) { bool leftEdge = (pad < 2); bool correct = (leftEdge) ? (pad < mPadMean) : (pad > mPadMean); - if (leftEdge && pad == 1) { // only check charge at boundary if maximum is at least one pad away from boundary + if (leftEdge && pad == 1) { // only check charge at boundary if maximum is at least one pad away from boundary correct = correct && (padBoundaryCharges[0] > 0); // Only correct if cluster is asymmetric with charge > 0 towards sector boundary, otherwise all charge is found } else if (!leftEdge && pad == (geo.NPads(pos.row()) - 1)) { correct = correct && (padBoundaryCharges[1] > 0); diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx index b11789937a975..6de1730d67fbd 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx @@ -58,7 +58,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t ChargePos pos = filteredPeakPositions[CAMath::Min(idx, clusternum - 1)]; Charge charge = chargeMap[pos].unpack(); - Charge padBoundaryCharges[2] = {chargeMap[pos.delta({-1,0})].unpack(), chargeMap[pos.delta({1,0})].unpack()}; + Charge padBoundaryCharges[2] = {chargeMap[pos.delta({-1, 0})].unpack(), chargeMap[pos.delta({1, 0})].unpack()}; ClusterAccumulator pc; CPU_ONLY(labelAcc->collect(pos, charge)); From 3b77378ad1f2149cdb8a860152a9869f282a839c Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Thu, 6 Mar 2025 11:18:07 +0100 Subject: [PATCH 5/5] Fix for right edge check --- GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx index 83c979eba19cf..a826cdf71f575 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx @@ -118,7 +118,7 @@ GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime bool correct = (leftEdge) ? (pad < mPadMean) : (pad > mPadMean); if (leftEdge && pad == 1) { // only check charge at boundary if maximum is at least one pad away from boundary correct = correct && (padBoundaryCharges[0] > 0); // Only correct if cluster is asymmetric with charge > 0 towards sector boundary, otherwise all charge is found - } else if (!leftEdge && pad == (geo.NPads(pos.row()) - 1)) { + } else if (!leftEdge && pad == (geo.NPads(pos.row()) - 2)) { correct = correct && (padBoundaryCharges[1] > 0); } mPadMean = (correct) ? pad : mPadMean;