Skip to content

Commit 5e63102

Browse files
committed
Adapting edge correction
1 parent 6a0ce42 commit 5e63102

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ GPUd() Charge ClusterAccumulator::updateOuter(PackedCharge charge, Delta2 d)
9797
return q;
9898
}
9999

100-
GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo, const PackedCharge* buf)
100+
GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime timeOffset, const GPUTPCGeometry& geo, Charge* padBoundaryCharges)
101101
{
102102
mQtot += q;
103103

@@ -116,6 +116,11 @@ GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, Charge q, TPCTime
116116
if (CfUtils::isAtEdge(pos, geo.NPads(pos.row()))) {
117117
bool leftEdge = (pad < 2);
118118
bool correct = (leftEdge) ? (pad < mPadMean) : (pad > mPadMean);
119+
if (leftEdge && pad == 1) { // only check charge at boundary if maximum is at least one pad away from boundary
120+
correct = correct && (padBoundaryCharges[0] > 0); // Only correct if cluster is asymmetric with charge > 0 towards sector boundary, otherwise all charge is found
121+
} else if (!leftEdge && pad == (geo.NPads(pos.row()) - 1)) {
122+
correct = correct && (padBoundaryCharges[1] > 0);
123+
}
119124
mPadMean = (correct) ? pad : mPadMean;
120125
}
121126
}

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t
5858
ChargePos pos = filteredPeakPositions[CAMath::Min(idx, clusternum - 1)];
5959
Charge charge = chargeMap[pos].unpack();
6060

61+
Charge padBoundaryCharges[2] = {chargeMap[pos.delta(-1,0)].unpack(), chargeMap[pos.delta(1,0)].unpack()};
62+
6163
ClusterAccumulator pc;
6264
CPU_ONLY(labelAcc->collect(pos, charge));
6365

@@ -80,7 +82,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t
8082
}
8183
return;
8284
}
83-
pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry, smem.buf);
85+
pc.finalize(pos, charge, fragment.start, clusterer.Param().tpcGeometry, padBoundaryCharges);
8486

8587
tpc::ClusterNative myCluster;
8688
bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param());

0 commit comments

Comments
 (0)