Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ GPUd() Charge ClusterAccumulator::updateOuter(PackedCharge charge, Delta2 d)
return q;
}

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

Expand All @@ -73,8 +73,13 @@ GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, Charge q, tpc::Cl
Pad pad = pos.pad();
mPadMean += pad;
mTimeMean += timeOffset + pos.time();
}

GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, const Charge q, tpc::ClusterNative& cn, const GPUParam& param, const Array2D<PackedCharge>& chargeMap)
{
Pad pad = pos.pad();

bool isEdgeCluster = pos.pad() < 2 || pos.pad() >= param.tpcGeometry.NPads(pos.row()) - 2; // Geometrical edge check, peak within 2 pads of sector edge
bool isEdgeCluster = pad < 2 || pad >= param.tpcGeometry.NPads(pos.row()) - 2; // Geometrical edge check, peak within 2 pads of sector edge
if (isEdgeCluster) {
bool leftEdge = (pad < 2);
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)) {
Expand Down
3 changes: 2 additions & 1 deletion GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class ClusterAccumulator
GPUd() tpccf::Charge updateInner(PackedCharge, tpccf::Delta2);
GPUd() tpccf::Charge updateOuter(PackedCharge, tpccf::Delta2);

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

private:
float mQtot = 0;
Expand Down
3 changes: 2 additions & 1 deletion GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t
return;
}
tpc::ClusterNative myCluster;
bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param(), fragment.start, chargeMap);
pc.finalize(pos, charge, fragment.start);
bool rejectCluster = !pc.toNative(pos, charge, myCluster, clusterer.Param(), chargeMap);

if (rejectCluster) {
if (clusterPosInRow) {
Expand Down