Skip to content

Commit 705ebfb

Browse files
committed
GPU TPC CF: Split toNative back to finalize and toNative, to be used by NNClusterer
1 parent 650a6ff commit 705ebfb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ GPUd() Charge ClusterAccumulator::updateOuter(PackedCharge charge, Delta2 d)
5858
return q;
5959
}
6060

61-
GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, Charge q, tpc::ClusterNative& cn, const GPUParam& param, TPCTime timeOffset, const Array2D<PackedCharge>& chargeMap)
61+
GPUd() void ClusterAccumulator::finalize(const ChargePos& pos, const Charge q, TPCTime timeOffset)
6262
{
6363
mQtot += q;
6464

@@ -73,8 +73,13 @@ GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, Charge q, tpc::Cl
7373
Pad pad = pos.pad();
7474
mPadMean += pad;
7575
mTimeMean += timeOffset + pos.time();
76+
}
77+
78+
GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, const Charge q, tpc::ClusterNative& cn, const GPUParam& param, const Array2D<PackedCharge>& chargeMap)
79+
{
80+
Pad pad = pos.pad();
7681

77-
bool isEdgeCluster = pos.pad() < 2 || pos.pad() >= param.tpcGeometry.NPads(pos.row()) - 2; // Geometrical edge check, peak within 2 pads of sector edge
82+
bool isEdgeCluster = pad < 2 || pad >= param.tpcGeometry.NPads(pos.row()) - 2; // Geometrical edge check, peak within 2 pads of sector edge
7883
if (isEdgeCluster) {
7984
bool leftEdge = (pad < 2);
8085
if (leftEdge ? (pad == 1 && chargeMap[pos.delta({-1, 0})].unpack() < 1) : (pad == (param.tpcGeometry.NPads(pos.row()) - 2) && chargeMap[pos.delta({1, 0})].unpack() < 1)) {

GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class ClusterAccumulator
4141
GPUd() tpccf::Charge updateInner(PackedCharge, tpccf::Delta2);
4242
GPUd() tpccf::Charge updateOuter(PackedCharge, tpccf::Delta2);
4343

44-
GPUd() bool toNative(const ChargePos&, tpccf::Charge, tpc::ClusterNative&, const GPUParam&, tpccf::TPCTime, const Array2D<PackedCharge>&);
44+
GPUd() void finalize(const ChargePos&, const tpccf::Charge, tpccf::TPCTime);
45+
GPUd() bool toNative(const ChargePos&, const tpccf::Charge, tpc::ClusterNative&, const GPUParam&, const Array2D<PackedCharge>&);
4546

4647
private:
4748
float mQtot = 0;

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t
6060
return;
6161
}
6262
tpc::ClusterNative myCluster;
63-
bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param(), fragment.start, chargeMap);
63+
pc.finalize(pos, charge, fragment.start);
64+
bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param(), chargeMap);
6465

6566
if (rejectCluster) {
6667
if (clusterPosInRow) {

0 commit comments

Comments
 (0)