Skip to content

Commit df5bcc4

Browse files
committed
Make exp filter alpha a parameter
1 parent 42f75e8 commit df5bcc4

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ AddOptionRTC(maxConsecTimeBinAboveThreshold, uint16_t, 200, "", 0, "Except pad f
114114
AddOptionRTC(noisyPadSaturationThreshold, uint16_t, 700, "", 0, "Threshold where a timebin is considered saturated, disabling the noisy pad check for that pad")
115115
AddOptionRTC(hipTailFilter, uint8_t, 0, "", 0, "Enable Highly Ionising Particle tail filter in CheckPadBaseline (0 = disable, 1 = filter tails)")
116116
AddOptionRTC(hipTailFilterThreshold, uint16_t, 150, "", 0, "Threshold that must be exceeded for a timebin to be counted towards Highly Ionising Particle tail")
117+
AddOptionRTC(hipTailFilterAlpha, float, 0.25f, "", 0, "Smoothing factor for the exponential Highly Ionising Particle tail filter")
117118
AddOptionRTC(occupancyMapTimeBins, uint16_t, 16, "", 0, "Number of timebins per histogram bin of occupancy map (0 = disable occupancy map)")
118119
AddOptionRTC(occupancyMapTimeBinsAverage, uint16_t, 0, "", 0, "Number of timebins +/- to use for the averaging")
119120
AddOptionRTC(trackFitCovLimit, uint16_t, 1000, "", 0, "Abort fit when y/z cov exceed the limit")

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ using namespace o2::gpu::tpccf;
4141

4242
using Kernel = GPUTPCCFCheckPadBaseline;
4343

44+
static GPUdi() Charge UpdateHIPTailFilter(Charge filteredCharge, Charge charge, Charge alpha)
45+
{
46+
return filteredCharge + alpha * (charge - filteredCharge);
47+
}
48+
4449
// Collect tails marked for closing across the workgroup using a prefix scan,
4550
// then cooperatively zero the charge map entries for each closed tail.
4651
// Caller must set acc.activeHIPTail.end before calling if the tail is open.
@@ -74,6 +79,7 @@ static GPUdi() uint16_t CloseHIPTails(
7479
}
7580

7681
acc.tailQTot = 0;
82+
acc.tailFilterCharge = 0;
7783
acc.activeHIPTail.Reset();
7884
}
7985

@@ -94,7 +100,7 @@ static GPUdi() uint16_t CloseHIPTails(
94100
}
95101

96102
template <bool CheckHIPTrigger, bool CheckHIPTailEnd>
97-
static GPUdi() void ScanCachedCharges(Kernel::GPUSharedMemory& smem, uint16_t timeOffset, uint16_t pad, Charge hipTailThreshold, Kernel::PadChargeAccu& acc)
103+
static GPUdi() void ScanCachedCharges(Kernel::GPUSharedMemory& smem, uint16_t timeOffset, uint16_t pad, Charge hipTailThreshold, Charge hipTailFilterAlpha, Kernel::PadChargeAccu& acc)
98104
{
99105
for (int32_t i = 0; i < Kernel::NumOfCachedTBs; i++) {
100106
const Charge qs = smem.charges[i][pad];
@@ -123,7 +129,8 @@ static GPUdi() void ScanCachedCharges(Kernel::GPUSharedMemory& smem, uint16_t ti
123129
if constexpr (CheckHIPTailEnd) {
124130
if (acc.activeHIPTail.IsOpen()) {
125131
acc.tailQTot += qs;
126-
if (qs < hipTailThreshold) {
132+
acc.tailFilterCharge = UpdateHIPTailFilter(acc.tailFilterCharge, qs, hipTailFilterAlpha);
133+
if (acc.tailFilterCharge < hipTailThreshold) {
127134
acc.activeHIPTail.end = curTB;
128135
}
129136
}
@@ -157,6 +164,7 @@ GPUd() void GPUTPCCFCheckPadBaseline::CheckBaselineGPU(int32_t nBlocks, int32_t
157164
const CfFragment& fragment = clusterer.mPmemory->fragment;
158165
const bool hipFilterOn = clusterer.Param().rec.tpc.hipTailFilter;
159166
const Charge hipTailThreshold = clusterer.Param().rec.tpc.hipTailFilterThreshold;
167+
const Charge hipTailFilterAlpha = clusterer.Param().rec.tpc.hipTailFilterAlpha;
160168
CfArray2D<PackedCharge> chargeMap(reinterpret_cast<PackedCharge*>(clusterer.mPchargeMap));
161169

162170
const auto iRow = iBlock;
@@ -205,15 +213,15 @@ GPUd() void GPUTPCCFCheckPadBaseline::CheckBaselineGPU(int32_t nBlocks, int32_t
205213
// Why is the old version so much slower, when we just add short branches to the loop???
206214
if (!hasHIPTrigger) [[likely]] {
207215
if (!acc.activeHIPTail.IsOpen()) {
208-
ScanCachedCharges<false, false>(smem, t, iPadHandle, hipTailThreshold, acc);
216+
ScanCachedCharges<false, false>(smem, t, iPadHandle, hipTailThreshold, hipTailFilterAlpha, acc);
209217
} else {
210-
ScanCachedCharges<false, true>(smem, t, iPadHandle, hipTailThreshold, acc);
218+
ScanCachedCharges<false, true>(smem, t, iPadHandle, hipTailThreshold, hipTailFilterAlpha, acc);
211219
}
212220
} else {
213221
if (!acc.activeHIPTail.IsOpen()) {
214-
ScanCachedCharges<true, false>(smem, t, iPadHandle, hipTailThreshold, acc);
222+
ScanCachedCharges<true, false>(smem, t, iPadHandle, hipTailThreshold, hipTailFilterAlpha, acc);
215223
} else {
216-
ScanCachedCharges<true, true>(smem, t, iPadHandle, hipTailThreshold, acc);
224+
ScanCachedCharges<true, true>(smem, t, iPadHandle, hipTailThreshold, hipTailFilterAlpha, acc);
217225
}
218226
}
219227
}
@@ -255,6 +263,7 @@ GPUd() void GPUTPCCFCheckPadBaseline::CheckBaselineGPU(int32_t nBlocks, int32_t
255263
if (acc.HIPtb > -1) {
256264
DPRINT("%d: start = %d\n", iThread, acc.HIPtb);
257265
acc.activeHIPTail.SetOpen(acc.HIPtb);
266+
acc.tailFilterCharge = Charge(MaxADC);
258267
}
259268

260269
// Clear smem between iterations to prevent stale entries

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
///
1919
/// Optionally detects Highly Ionising Particle (HIP) tails: when a saturated
2020
/// ADC value (1023) is found, the tail region on the triggering pad and its
21-
/// neighbors is zeroed in the charge map until charges drop below a
22-
/// configurable threshold.
21+
/// neighbors is zeroed in the charge map until an exponential charge filter
22+
/// drops below a configurable threshold.
2323

2424
#ifndef O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H
2525
#define O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H
@@ -107,6 +107,7 @@ class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate
107107
int16_t HIPtb = -1;
108108
int16_t aboveThresholdStart = -1; // first TB of current above-hipTailThreshold streak; used to extend the tail back over the rising edge before saturation
109109
HipTailRange activeHIPTail{-1, -1};
110+
tpccf::Charge tailFilterCharge = 0;
110111
float tailQTot = 0;
111112
};
112113

0 commit comments

Comments
 (0)