forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpuVertexFinder.h
83 lines (66 loc) · 2.64 KB
/
gpuVertexFinder.h
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
#ifndef RecoPixelVertexing_PixelVertexFinding_src_gpuVertexFinder_h
#define RecoPixelVertexing_PixelVertexFinding_src_gpuVertexFinder_h
#include <cstddef>
#include <cstdint>
#include "CUDADataFormats/ZVertexHeterogeneous.h"
namespace gpuVertexFinder {
using ZVertices = ZVertexSoA;
using TkSoA = pixelTrack::TrackSoA;
// workspace used in the vertex reco algos
struct WorkSpace {
static constexpr uint32_t MAXTRACKS = ZVertexSoA::MAXTRACKS;
static constexpr uint32_t MAXVTX = ZVertexSoA::MAXVTX;
uint32_t ntrks; // number of "selected tracks"
uint16_t itrk[MAXTRACKS]; // index of original track
float zt[MAXTRACKS]; // input track z at bs
float ezt2[MAXTRACKS]; // input error^2 on the above
float ptt2[MAXTRACKS]; // input pt^2 on the above
uint8_t izt[MAXTRACKS]; // interized z-position of input tracks
int32_t iv[MAXTRACKS]; // vertex index for each associated track
uint32_t nvIntermediate; // the number of vertices after splitting pruning etc.
__host__ __device__ void init() {
ntrks = 0;
nvIntermediate = 0;
}
};
__global__ void init(ZVertexSoA* pdata, WorkSpace* pws) {
pdata->init();
pws->init();
}
class Producer {
public:
using ZVertices = ZVertexSoA;
using WorkSpace = gpuVertexFinder::WorkSpace;
using TkSoA = pixelTrack::TrackSoA;
Producer(bool oneKernel,
bool useDensity,
bool useDBSCAN,
bool useIterative,
int iminT, // min number of neighbours to be "core"
float ieps, // max absolute distance to cluster
float ierrmax, // max error to be "seed"
float ichi2max // max normalized distance to cluster
)
: oneKernel_(oneKernel && !(useDBSCAN || useIterative)),
useDensity_(useDensity),
useDBSCAN_(useDBSCAN),
useIterative_(useIterative),
minT(iminT),
eps(ieps),
errmax(ierrmax),
chi2max(ichi2max) {}
~Producer() = default;
ZVertexHeterogeneous makeAsync(cudaStream_t stream, TkSoA const* tksoa, float ptMin) const;
ZVertexHeterogeneous make(TkSoA const* tksoa, float ptMin) const;
private:
const bool oneKernel_;
const bool useDensity_;
const bool useDBSCAN_;
const bool useIterative_;
int minT; // min number of neighbours to be "core"
float eps; // max absolute distance to cluster
float errmax; // max error to be "seed"
float chi2max; // max normalized distance to cluster
};
} // namespace gpuVertexFinder
#endif // RecoPixelVertexing_PixelVertexFinding_src_gpuVertexFinder_h