Skip to content
Closed
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
7 changes: 6 additions & 1 deletion GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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, Charge* padBoundaryCharges)
{
mQtot += q;

Expand All @@ -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()) - 2)) {
correct = correct && (padBoundaryCharges[1] > 0);
}
mPadMean = (correct) ? pad : mPadMean;
}
}
2 changes: 1 addition & 1 deletion GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you define this further down, where it is actually used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where excatly? Directly above pc.finalize?


ClusterAccumulator pc;
CPU_ONLY(labelAcc->collect(pos, charge));

Expand All @@ -80,7 +82,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, padBoundaryCharges);

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