Skip to content

Commit 7bc5d3c

Browse files
committed
GPU/TPC: extend noisy pad filter with Highly Ionising Particle filter
1 parent b4da18e commit 7bc5d3c

13 files changed

+498
-41
lines changed

GPU/Common/GPUCommonAlgorithm.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,11 @@ GPUdi() uint8_t warp_broadcast_FUNC<uint8_t>(uint8_t v, int32_t i)
354354
#define warp_scan_inclusive_add(v) warp_scan_inclusive_add_FUNC(v)
355355
#define warp_broadcast(v, i) warp_broadcast_FUNC(v, i)
356356

357+
[[nodiscard]] GPUdi() int32_t work_group_count(bool pred)
358+
{
359+
return work_group_reduce_add((int32_t)pred);
360+
}
361+
357362
#elif (defined(__CUDACC__) || defined(__HIPCC__))
358363
// CUDA and HIP work the same way using cub, need just different header
359364

@@ -416,6 +421,16 @@ GPUdi() T warp_broadcast_FUNC(T v, int32_t i)
416421
#endif
417422
}
418423

424+
[[nodiscard]] GPUdi() bool work_group_any(bool pred)
425+
{
426+
return __syncthreads_or(pred);
427+
}
428+
429+
[[nodiscard]] GPUdi() uint32_t work_group_count(bool pred)
430+
{
431+
return __syncthreads_count(pred);
432+
}
433+
419434
#else
420435
// Trivial implementation for the CPU
421436

@@ -449,6 +464,16 @@ GPUdi() T warp_broadcast(T v, int32_t i)
449464
return v;
450465
}
451466

467+
[[nodiscard]] GPUdi() bool work_group_any(bool pred)
468+
{
469+
return pred;
470+
}
471+
472+
[[nodiscard]] GPUdi() uint32_t work_group_count(bool pred)
473+
{
474+
return pred;
475+
}
476+
452477
#endif
453478

454479
#ifdef GPUCA_ALGORITHM_STD
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file GPUTPCExtraADC.h
13+
/// \author Felix Weiglhofer
14+
15+
#include "GPUDefConstantsAndSettings.h"
16+
#include "DataFormatsTPC/Digit.h"
17+
#include <array>
18+
#include <vector>
19+
20+
namespace o2::gpu
21+
{
22+
struct GPUTPCExtraADC {
23+
std::array<std::vector<tpc::Digit>, GPUCA_NSECTORS> digitsBySector;
24+
};
25+
} // namespace o2::gpu

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ AddOptionRTC(trackletMinSharedNormFactor, float, 0.f, "", 0, "Max shared defined
112112
AddOptionRTC(maxTimeBinAboveThresholdIn1000Bin, uint16_t, 500, "", 0, "Except pad from cluster finding if total number of charges in a fragment is above this baseline (disable = 0)")
113113
AddOptionRTC(maxConsecTimeBinAboveThreshold, uint16_t, 200, "", 0, "Except pad from cluster finding if number of consecutive charges in a fragment is above this baseline (disable = 0)")
114114
AddOptionRTC(noisyPadSaturationThreshold, uint16_t, 700, "", 0, "Threshold where a timebin is considered saturated, disabling the noisy pad check for that pad")
115+
AddOptionRTC(hipTailFilter, uint8_t, 0, "", 0, "Enable Highly Ionising Particle tail filter in CheckPadBaseline (0 = disable, 1 = filter tails)")
116+
AddOptionRTC(hipTailFilterThreshold, uint16_t, 150, "", 0, "Threshold that must be exceeded for a timebin to be counted towards Highly Ionising Particle tail")
115117
AddOptionRTC(occupancyMapTimeBins, uint16_t, 16, "", 0, "Number of timebins per histogram bin of occupancy map (0 = disable occupancy map)")
116118
AddOptionRTC(occupancyMapTimeBinsAverage, uint16_t, 0, "", 0, "Number of timebins +/- to use for the averaging")
117119
AddOptionRTC(trackFitCovLimit, uint16_t, 1000, "", 0, "Abort fit when y/z cov exceed the limit")

GPU/GPUTracking/Global/GPUChainTracking.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "GPUChain.h"
1919
#include "GPUDataTypesIO.h"
2020
#include "GPUDataTypesConfig.h"
21-
#include <atomic>
2221
#include <mutex>
2322
#include <functional>
2423
#include <array>
@@ -70,6 +69,7 @@ struct CfFragment;
7069
class GPUTPCClusterFinder;
7170
struct GPUSettingsProcessing;
7271
struct GPUSettingsRec;
72+
struct GPUTPCExtraADC;
7373

7474
class GPUChainTracking : public GPUChain
7575
{
@@ -302,13 +302,15 @@ class GPUChainTracking : public GPUChain
302302
int32_t RunChainFinalize();
303303
void OutputSanityCheck();
304304
int32_t RunTPCTrackingSectors_internal();
305-
int32_t RunTPCClusterizer_prepare(bool restorePointers);
305+
int32_t RunTPCClusterizer_prepare(bool restorePointers, const GPUTPCExtraADC& extraADCs);
306306
#ifdef GPUCA_TPC_GEOMETRY_O2
307-
std::pair<uint32_t, uint32_t> RunTPCClusterizer_transferZS(int32_t iSector, const CfFragment& fragment, int32_t lane);
307+
std::pair<uint32_t, uint32_t> RunTPCClusterizer_transferZS(int32_t iSector, const CfFragment& fragment, int32_t lane, const GPUTPCExtraADC& extraADCs);
308308
void RunTPCClusterizer_compactPeaks(GPUTPCClusterFinder& clusterer, GPUTPCClusterFinder& clustererShadow, int32_t stage, bool doGPU, int32_t lane);
309309
std::pair<uint32_t, uint32_t> TPCClusterizerDecodeZSCount(uint32_t iSector, const CfFragment& fragment);
310310
std::pair<uint32_t, uint32_t> TPCClusterizerDecodeZSCountUpdate(uint32_t iSector, const CfFragment& fragment);
311311
void TPCClusterizerEnsureZSOffsets(uint32_t iSector, const CfFragment& fragment);
312+
void TPCClusterizerTransferExtraADC(GPUTPCClusterFinder& clusterer, GPUTPCClusterFinder& clustererShadow, int lane, const GPUTPCExtraADC& extraADCs);
313+
void TPCClusterizerCheckExtraADCZeros(GPUTPCClusterFinder& clusterer, GPUTPCClusterFinder& clustererShadow, int lane, const GPUTPCExtraADC& extraADCs);
312314
#endif
313315
void RunTPCTrackingMerger_MergeBorderTracks(int8_t withinSector, int8_t mergeMode, GPUReconstruction::krnlDeviceType deviceType);
314316
void RunTPCTrackingMerger_Resolve(int8_t useOrigTrackParam, int8_t mergeAll, GPUReconstruction::krnlDeviceType deviceType);

0 commit comments

Comments
 (0)