1616
1717#include " GPUHostDataTypes.h"
1818#include " GPUTPCClusterFinder.h"
19- #include " PackedCharge.h"
2019#include " SimulationDataFormat/MCTruthContainer.h"
2120
2221using namespace o2 ::gpu;
@@ -29,13 +28,18 @@ MCLabelAccumulator::MCLabelAccumulator(GPUTPCClusterFinder& clusterer)
2928
3029MCLabelAccumulator::~MCLabelAccumulator () {}
3130
32- void MCLabelAccumulator::collect (const CfChargePos& pos, Charge q )
31+ void MCLabelAccumulator::collect (const CfChargePos& pos)
3332{
34- if (q == 0 || !engaged ()) {
33+ if (!engaged ()) {
3534 return ;
3635 }
3736
37+ // Use -1 as sentinel to indicate a missing label.
38+ // Can't use zero charge, as HIP filter will zero existing digits.
3839 uint32_t index = mIndexMap [pos];
40+ if (index == uint32_t (-1 )) {
41+ return ;
42+ }
3943
4044 const auto & labels = mLabels ->getLabels (index);
4145
@@ -54,16 +58,13 @@ void MCLabelAccumulator::collect(const CfChargePos& pos, Charge q)
5458 }
5559}
5660
57- void MCLabelAccumulator::collectTail (GPUTPCClusterFinder& clusterer, tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd)
61+ void MCLabelAccumulator::collectTail (tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd)
5862{
59- CfArray2D<const PackedCharge> chargeMap (reinterpret_cast <PackedCharge*>(clusterer.mPchargeMap ));
60-
6163 const auto basePos = CfChargePos{row, pad, 0 };
6264
6365 for (uint16_t t = tailStart; t < tailEnd; t++) {
6466 const auto pos = basePos.delta ({0 , (int16_t )t});
65- const auto q = chargeMap[pos].unpack ();
66- collect (pos, q);
67+ collect (pos);
6768 }
6869}
6970
0 commit comments