Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:38:05

0001 #ifndef RecoVertex_PixelVertexFinding_plugins_gpuVertexFinder_h
0002 #define RecoVertex_PixelVertexFinding_plugins_gpuVertexFinder_h
0003 
0004 #include <cstddef>
0005 #include <cstdint>
0006 
0007 #include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
0008 #include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h"
0009 #include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h"
0010 #include "CUDADataFormats/Vertex/interface/ZVertexUtilities.h"
0011 #include "PixelVertexWorkSpaceUtilities.h"
0012 #include "PixelVertexWorkSpaceSoAHost.h"
0013 #include "PixelVertexWorkSpaceSoADevice.h"
0014 
0015 namespace gpuVertexFinder {
0016 
0017   using VtxSoAView = zVertex::ZVertexSoAView;
0018   using WsSoAView = gpuVertexFinder::workSpace::PixelVertexWorkSpaceSoAView;
0019 
0020   __global__ void init(VtxSoAView pdata, WsSoAView pws) {
0021     zVertex::utilities::init(pdata);
0022     gpuVertexFinder::workSpace::utilities::init(pws);
0023   }
0024 
0025   template <typename TrackerTraits>
0026   class Producer {
0027     using TkSoAConstView = TrackSoAConstView<TrackerTraits>;
0028 
0029   public:
0030     Producer(bool oneKernel,
0031              bool useDensity,
0032              bool useDBSCAN,
0033              bool useIterative,
0034              bool doSplitting,
0035              int iminT,      // min number of neighbours to be "core"
0036              float ieps,     // max absolute distance to cluster
0037              float ierrmax,  // max error to be "seed"
0038              float ichi2max  // max normalized distance to cluster
0039              )
0040         : oneKernel_(oneKernel && !(useDBSCAN || useIterative)),
0041           useDensity_(useDensity),
0042           useDBSCAN_(useDBSCAN),
0043           useIterative_(useIterative),
0044           doSplitting_(doSplitting),
0045           minT(iminT),
0046           eps(ieps),
0047           errmax(ierrmax),
0048           chi2max(ichi2max) {}
0049 
0050     ~Producer() = default;
0051 
0052     ZVertexSoADevice makeAsync(cudaStream_t stream, const TkSoAConstView &tracks_view, float ptMin, float ptMax) const;
0053     ZVertexSoAHost make(const TkSoAConstView &tracks_view, float ptMin, float ptMax) const;
0054 
0055   private:
0056     const bool oneKernel_;
0057     const bool useDensity_;
0058     const bool useDBSCAN_;
0059     const bool useIterative_;
0060     const bool doSplitting_;
0061 
0062     int minT;       // min number of neighbours to be "core"
0063     float eps;      // max absolute distance to cluster
0064     float errmax;   // max error to be "seed"
0065     float chi2max;  // max normalized distance to cluster
0066   };
0067 
0068 }  // namespace gpuVertexFinder
0069 
0070 #endif  // RecoVertex_PixelVertexFinding_plugins_gpuVertexFinder_h