Project
Loading...
Searching...
No Matches
GPUTPCClusterFinder.h
Go to the documentation of this file.
1// Copyright 2019-2020 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
14
15#ifndef O2_GPU_GPUTPCCLUSTERFINDER_H
16#define O2_GPU_GPUTPCCLUSTERFINDER_H
17
18#include "GPUDef.h"
19#include "GPUProcessor.h"
20#include "GPUDataTypes.h"
21#include "CfFragment.h"
22
23namespace o2
24{
25
26class MCCompLabel;
27
28namespace dataformats
29{
30template <typename TruthElement>
32template <typename TruthElement>
33class ConstMCTruthContainerView;
34} // namespace dataformats
35
36namespace tpc
37{
38struct ClusterNative;
39class Digit;
40} // namespace tpc
41
42} // namespace o2
43
44namespace o2::gpu
45{
46struct GPUTPCClusterMCInterimArray;
47struct TPCPadGainCalib;
48
49struct ChargePos;
50
51class GPUTPCGeometry;
52
54{
55 public:
56 struct Memory {
57 struct counters_t {
58 size_t nDigits = 0;
59 tpccf::SizeT nDigitsInFragment = 0; // num of digits in fragment can differ from nPositions if ZS is active
63 uint32_t maxTimeBin = 0;
64 uint32_t nPagesSubsector = 0;
67 };
68
69 struct ZSOffset {
70 uint32_t offset;
71 uint16_t endpoint;
72 uint16_t num;
73 };
74
78
79#ifndef GPUCA_GPUCODE
84
85 void* SetPointersInput(void* mem);
86 void* SetPointersOutput(void* mem);
87 void* SetPointersScratch(void* mem);
88 void* SetPointersMemory(void* mem);
89 void* SetPointersZS(void* mem);
90 void* SetPointersZSOffset(void* mem);
91
92 uint32_t getNSteps(size_t items) const;
93 void SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax);
94
95 void PrepareMC();
96 void clearMCMemory();
97#endif
98 uint8_t* mPzs = nullptr;
100 MinMaxCN* mMinMaxCN = nullptr;
101 uint8_t* mPpadIsNoisy = nullptr;
102 tpc::Digit* mPdigits = nullptr; // input digits, only set if ZS is skipped
106 uint8_t* mPisPeak = nullptr;
107 uint32_t* mPclusterPosInRow = nullptr; // store the index where the corresponding cluster is stored in a bucket.
108 // Required when MC are enabled to write the mc data to the correct position.
109 // Set to >= mNMaxClusterPerRow if cluster was discarded.
110 uint16_t* mPchargeMap = nullptr;
111 uint8_t* mPpeakMap = nullptr;
112 uint32_t* mPindexMap = nullptr;
113 uint32_t* mPclusterInRow = nullptr;
116 int32_t* mPbuf = nullptr;
117 Memory* mPmemory = nullptr;
118
119 GPUdi() int32_t* GetScanBuffer(int32_t iBuf) const { return mPbuf + iBuf * mBufSize; }
120
122 uint32_t* mPlabelsInRow = nullptr;
125
126 int32_t mISector = 0;
127 constexpr static int32_t mScanWorkGroupSize = GPUCA_THREAD_COUNT_SCAN;
128 uint32_t mNMaxClusterPerRow = 0;
129 uint32_t mNMaxClusters = 0;
130 uint32_t mNMaxPages = 0;
131 size_t mNMaxDigits = 0;
134 size_t mNMaxPeaks = 0;
135 size_t mBufSize = 0;
136 uint32_t mNBufs = 0;
137
138 int16_t mMemoryId = -1;
139 int16_t mScratchId = -1;
140 int16_t mZSId = -1;
141 int16_t mZSOffsetId = -1;
142 int16_t mOutputId = -1;
143
144#ifndef GPUCA_GPUCODE
145 void DumpDigits(std::ostream& out);
146 void DumpChargeMap(std::ostream& out, std::string_view);
147 void DumpPeakMap(std::ostream& out, std::string_view);
148 void DumpPeaks(std::ostream& out);
149 void DumpPeaksCompacted(std::ostream& out);
150 void DumpSuppressedPeaks(std::ostream& out);
151 void DumpSuppressedPeaksCompacted(std::ostream& out);
152 void DumpClusters(std::ostream& out);
153#endif
154};
155
156} // namespace o2::gpu
157
158#endif
#define GPUCA_THREAD_COUNT_SCAN
static constexpr int32_t mScanWorkGroupSize
void SetMaxData(const GPUTrackingInOutPointers &io)
void SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax)
void DumpSuppressedPeaks(std::ostream &out)
GPUTPCClusterMCInterimArray * mPlabelsByRow
void DumpPeakMap(std::ostream &out, std::string_view)
o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > const * mPinputLabels
GPUdi() int32_t *GetScanBuffer(int32_t iBuf) const
void DumpChargeMap(std::ostream &out, std::string_view)
uint32_t getNSteps(size_t items) const
void DumpSuppressedPeaksCompacted(std::ostream &out)
void DumpPeaksCompacted(std::ostream &out)
tpc::ClusterNative * mPclusterByRow
o2::cpv::Digit Digit
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
struct o2::gpu::GPUTPCClusterFinder::Memory::counters_t counters