forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGPUTPCClusterFinder.h
More file actions
155 lines (131 loc) · 4.47 KB
/
GPUTPCClusterFinder.h
File metadata and controls
155 lines (131 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUTPCClusterFinder.h
/// \author David Rohr
#ifndef O2_GPU_GPUTPCCLUSTERFINDER_H
#define O2_GPU_GPUTPCCLUSTERFINDER_H
#include "GPUDef.h"
#include "GPUProcessor.h"
#include "GPUDataTypes.h"
#include "CfFragment.h"
namespace o2
{
class MCCompLabel;
namespace dataformats
{
template <typename TruthElement>
class MCTruthContainer;
template <typename TruthElement>
class ConstMCTruthContainerView;
} // namespace dataformats
namespace tpc
{
struct ClusterNative;
class Digit;
} // namespace tpc
} // namespace o2
namespace o2::gpu
{
struct GPUTPCClusterMCInterimArray;
struct TPCPadGainCalib;
struct CfChargePos;
class GPUTPCClusterFinder : public GPUProcessor
{
public:
struct Memory {
struct counters_t {
size_t nDigits = 0;
tpccf::SizeT nDigitsInFragment = 0; // num of digits in fragment can differ from nPositions if ZS is active
tpccf::SizeT nPositions = 0;
tpccf::SizeT nPeaks = 0;
tpccf::SizeT nClusters = 0;
uint32_t maxTimeBin = 0;
uint32_t nPagesSubsector = 0;
} counters;
CfFragment fragment;
};
struct ZSOffset {
uint32_t offset;
uint16_t endpoint;
uint16_t num;
};
struct MinMaxCN {
uint32_t zsPtrFirst, zsPageFirst, zsPtrLast, zsPageLast;
};
#ifndef GPUCA_GPUCODE
~GPUTPCClusterFinder();
void InitializeProcessor();
void RegisterMemoryAllocation();
void SetMaxData(const GPUTrackingInOutPointers& io);
void* SetPointersInput(void* mem);
void* SetPointersOutput(void* mem);
void* SetPointersScratch(void* mem);
void* SetPointersMemory(void* mem);
void* SetPointersZS(void* mem);
void* SetPointersZSOffset(void* mem);
uint32_t getNSteps(size_t items) const;
void SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax);
void PrepareMC();
void clearMCMemory();
#endif
uint8_t* mPzs = nullptr;
ZSOffset* mPzsOffsets = nullptr;
MinMaxCN* mMinMaxCN = nullptr;
uint8_t* mPpadIsNoisy = nullptr;
tpc::Digit* mPdigits = nullptr; // input digits, only set if ZS is skipped
CfChargePos* mPpositions = nullptr;
CfChargePos* mPpeakPositions = nullptr;
CfChargePos* mPfilteredPeakPositions = nullptr;
uint8_t* mPisPeak = nullptr;
uint32_t* mPclusterPosInRow = nullptr; // store the index where the corresponding cluster is stored in a bucket.
// Required when MC are enabled to write the mc data to the correct position.
// Set to >= mNMaxClusterPerRow if cluster was discarded.
uint16_t* mPchargeMap = nullptr;
uint8_t* mPpeakMap = nullptr;
uint32_t* mPindexMap = nullptr;
uint32_t* mPclusterInRow = nullptr;
tpc::ClusterNative* mPclusterByRow = nullptr;
GPUTPCClusterMCInterimArray* mPlabelsByRow = nullptr;
int32_t* mPscanBuf = nullptr;
Memory* mPmemory = nullptr;
GPUdi() int32_t* GetScanBuffer(int32_t iBuf) const { return mPscanBuf + iBuf * mBufSize; }
o2::dataformats::ConstMCTruthContainerView<o2::MCCompLabel> const* mPinputLabels = nullptr;
uint32_t* mPlabelsInRow = nullptr;
uint32_t mPlabelsHeaderGlobalOffset = 0;
uint32_t mPlabelsDataGlobalOffset = 0;
int32_t mISector = 0;
uint32_t mNMaxClusterPerRow = 0;
uint32_t mNMaxClusters = 0;
uint32_t mNMaxPages = 0;
size_t mNMaxDigits = 0;
size_t mNMaxDigitsFragment = 0;
size_t mNMaxDigitsEndpoint = 0;
size_t mNMaxPeaks = 0;
size_t mBufSize = 0;
uint32_t mNBufs = 0;
int16_t mMemoryId = -1;
int16_t mScratchId = -1;
int16_t mZSId = -1;
int16_t mZSOffsetId = -1;
int16_t mOutputId = -1;
#ifndef GPUCA_GPUCODE
void DumpDigits(std::ostream& out);
void DumpChargeMap(std::ostream& out, std::string_view);
void DumpPeakMap(std::ostream& out, std::string_view);
void DumpPeaks(std::ostream& out);
void DumpPeaksCompacted(std::ostream& out);
void DumpSuppressedPeaks(std::ostream& out);
void DumpSuppressedPeaksCompacted(std::ostream& out);
void DumpClusters(std::ostream& out);
#endif
};
} // namespace o2::gpu
#endif