diff --git a/GPU/GPUTracking/Definitions/GPUSettingsList.h b/GPU/GPUTracking/Definitions/GPUSettingsList.h index 48074826c9245..d60a9bf5775f4 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsList.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsList.h @@ -123,6 +123,7 @@ AddOptionRTC(hipTailFilter, uint8_t, 0, "", 0, "Enable Highly Ionising Particle AddOptionRTC(hipTailFilterMinimum, uint16_t, 1023, "", 0, "Treat signal above this minimum as saturated") AddOptionRTC(hipTailFilterThreshold, uint16_t, 100, "", 0, "Threshold that must be exceeded for a timebin to be counted towards Highly Ionising Particle tail") AddOptionRTC(hipTailFilterAlpha, float, 0.5f, "", 0, "Smoothing factor for the exponential Highly Ionising Particle tail filter") +AddOptionRTC(hipTailFwdAsCluster, uint8_t, 0, "", 0, "Forward Highly Ionising Particle tail as single pad clusters and don't attempt to merge neighboring tails") AddOptionRTC(occupancyMapTimeBins, uint16_t, 16, "", 0, "Number of timebins per histogram bin of occupancy map (0 = disable occupancy map)") AddOptionRTC(occupancyMapTimeBinsAverage, uint16_t, 0, "", 0, "Number of timebins +/- to use for the averaging") AddOptionRTC(trackFitCovLimit, uint16_t, 1000, "", 0, "Abort fit when y/z cov exceed the limit") diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx index ecd11250b239c..dabd79c5601bd 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx @@ -22,6 +22,7 @@ #ifndef GPUCA_GPUCODE #include "MCLabelAccumulator.h" #include "utils/VcShim.h" +#include #include #endif @@ -747,6 +748,11 @@ GPUd() void GPUTPCCFHIPTailConnector::Thread<0>(int32_t nBlocks, int32_t nThread if (iBlock >= (int32_t)GPUTPCGeometry::NROWS) { return; } + + if (clusterer.Param().rec.tpc.hipTailFwdAsCluster) { + return; + } + const uint32_t row = iBlock; const uint32_t nTails = CAMath::Min(clusterer.mPnHIPTails[row], (uint32_t)MaxHIPTailsPerRow - 1); @@ -836,6 +842,8 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, CPU_ONLY(auto labelAcc = MCLabelAccumulator{clusterer}); + uint16_t padMin = 0xFFFF, padMax = 0; + float qTot = 0; float qMax = 0; float padSum = 0; @@ -848,11 +856,10 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, // Zero-th element is empty tail for (; tail != tails; tail = &tails[tail->iNext]) { const float tailWeight = tail->qTot; - const float tailPad = tail->pad; qMax = CAMath::Max(qMax, tail->qMax); qTot += tail->qTot; - padSum += tailWeight * tailPad; - padSqSum += tailWeight * tailPad * tailPad; + padSum += tailWeight * tail->pad; + padSqSum += tailWeight * tail->pad * tail->pad; if (tail->satStart >= 0 && tail->satEnd >= 0) { satTimeSum += 0.5f * (tail->satStart + tail->satEnd); nSatTails++; @@ -860,6 +867,9 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, tailStart = CAMath::Min(tailStart, tail->tailStart); tailEnd = CAMath::Max(tailEnd, tail->tailEnd); + padMin = CAMath::Min(padMin, tail->pad); + padMax = CAMath::Max(padMax, tail->pad); + CPU_ONLY(labelAcc.collectTail(row, tail->pad, tail->tailStart, tail->tailEnd)); } @@ -867,12 +877,14 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, const float padMean = padSum / weightSum; const float padSigma = CAMath::Sqrt(CAMath::Max(0.f, padSqSum / weightSum - padMean * padMean)); + const bool singlePad = padMin == padMax; + tpc::ClusterNative cn; cn.qMax = qMax; cn.setSaturatedQtot(qTot); cn.setSaturatedTailLength(tailEnd - tailStart); cn.setPad(padMean); - cn.setSigmaPad(padSigma); + cn.setSigmaPad(singlePad ? 0.f : padSigma); if (cn.qMax >= 1023) { @@ -881,7 +893,9 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, // but these never contain a saturated charge and are dropped by the qMax cut. const float clusterTime = frag.start + satTimeSum / nSatTails - clusterer.Param().rec.tpc.clustersShiftTimebinsClusterizer; assert(!CAMath::IsNaN(clusterTime)); - cn.setTimeFlags(clusterTime, 0); + + const uint8_t flags = singlePad ? tpc::ClusterNative::flagSingle : 0; + cn.setTimeFlags(clusterTime, flags); uint32_t index; diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx index d778dce37c4af..6ca6b250a1648 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx @@ -166,7 +166,7 @@ void GPUTPCClusterFinder::DumpClusters(std::ostream& out) out << "Row: " << i << ": " << N << "\n"; for (const auto& cl : sortedCluster) { - uint32_t qTot = cl.getQtot(); + uint32_t qTot = cl.qTotPacked; uint32_t sigmaTime = cl.sigmaTimePacked; if (cl.isSaturated()) { sigmaTime = cl.getSaturatedTailLength();