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