Skip to content

Commit 641977c

Browse files
ChSonnabenddavidrohr
authored andcommitted
Fixing handling of edge clusters
Adapting edge correction Fixing edge handling Please consider the following formatting changes Fix for right edge check
1 parent 5c6657a commit 641977c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
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)
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()) - 2)) {
122+
correct = correct && (padBoundaryCharges[1] > 0);
123+
}
119124
mPadMean = (correct) ? pad : mPadMean;
120125
}
121126
}

GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ClusterAccumulator
4040
GPUd() tpccf::Charge updateInner(PackedCharge, tpccf::Delta2);
4141
GPUd() tpccf::Charge updateOuter(PackedCharge, tpccf::Delta2);
4242

43-
GPUd() void finalize(const ChargePos&, tpccf::Charge, tpccf::TPCTime, const GPUTPCGeometry&);
43+
GPUd() void finalize(const ChargePos&, tpccf::Charge, tpccf::TPCTime, const GPUTPCGeometry&, tpccf::Charge*);
4444
GPUd() bool toNative(const ChargePos&, tpccf::Charge, tpc::ClusterNative&, const GPUParam&) const;
4545

4646
private:

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);
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)