CMS 3D CMS Logo

gpuVertexFinder.h
Go to the documentation of this file.
1 #ifndef RecoPixelVertexing_PixelVertexFinding_plugins_gpuVertexFinder_h
2 #define RecoPixelVertexing_PixelVertexFinding_plugins_gpuVertexFinder_h
3 
4 #include <cstddef>
5 #include <cstdint>
6 
9 
10 namespace gpuVertexFinder {
11 
14 
15  // workspace used in the vertex reco algos
16  struct WorkSpace {
17  static constexpr uint32_t MAXTRACKS = ZVertexSoA::MAXTRACKS;
18  static constexpr uint32_t MAXVTX = ZVertexSoA::MAXVTX;
19 
20  uint32_t ntrks; // number of "selected tracks"
21  uint16_t itrk[MAXTRACKS]; // index of original track
22  float zt[MAXTRACKS]; // input track z at bs
23  float ezt2[MAXTRACKS]; // input error^2 on the above
24  float ptt2[MAXTRACKS]; // input pt^2 on the above
25  uint8_t izt[MAXTRACKS]; // interized z-position of input tracks
26  int32_t iv[MAXTRACKS]; // vertex index for each associated track
27 
28  uint32_t nvIntermediate; // the number of vertices after splitting pruning etc.
29 
31  ntrks = 0;
32  nvIntermediate = 0;
33  }
34  };
35 
36  __global__ void init(ZVertexSoA* pdata, WorkSpace* pws) {
37  pdata->init();
38  pws->init();
39  }
40 
41  class Producer {
42  public:
46 
48  bool useDensity,
49  bool useDBSCAN,
50  bool useIterative,
51  int iminT, // min number of neighbours to be "core"
52  float ieps, // max absolute distance to cluster
53  float ierrmax, // max error to be "seed"
54  float ichi2max // max normalized distance to cluster
55  )
60  minT(iminT),
61  eps(ieps),
62  errmax(ierrmax),
63  chi2max(ichi2max) {}
64 
65  ~Producer() = default;
66 
67  ZVertexHeterogeneous makeAsync(cudaStream_t stream, TkSoA const* tksoa, float ptMin, float ptMax) const;
68  ZVertexHeterogeneous make(TkSoA const* tksoa, float ptMin, float ptMax) const;
69 
70  private:
71  const bool oneKernel_;
72  const bool useDensity_;
73  const bool useDBSCAN_;
74  const bool useIterative_;
75 
76  int minT; // min number of neighbours to be "core"
77  float eps; // max absolute distance to cluster
78  float errmax; // max error to be "seed"
79  float chi2max; // max normalized distance to cluster
80  };
81 
82 } // namespace gpuVertexFinder
83 
84 #endif // RecoPixelVertexing_PixelVertexFinding_plugins_gpuVertexFinder_h
ZVertexHeterogeneous makeAsync(cudaStream_t stream, TkSoA const *tksoa, float ptMin, float ptMax) const
#define __host__
#define __global__
Definition: cudaCompat.h:19
uint16_t itrk[MAXTRACKS]
static constexpr uint32_t MAXVTX
Definition: ZVertexSoA.h:12
__host__ __device__ void init()
static constexpr uint32_t MAXVTX
uint8_t izt[MAXTRACKS]
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Producer(bool oneKernel, bool useDensity, bool useDBSCAN, bool useIterative, int iminT, float ieps, float ierrmax, float ichi2max)
static constexpr uint32_t MAXTRACKS
TrackSoAHeterogeneousT< maxNumber()> TrackSoA
ZVertexHeterogeneous make(TkSoA const *tksoa, float ptMin, float ptMax) const
static constexpr uint32_t MAXTRACKS
Definition: ZVertexSoA.h:11
__host__ __device__ void init()
Definition: ZVertexSoA.h:23
ZVertexSoA WorkSpace float float ptMax
#define __device__
ZVertexSoA WorkSpace float ptMin