File indexing completed on 2024-09-13 22:52:46
0001 #ifndef RecoVertex_PixelVertexFinding_plugins_alpaka_vertexFinder_h
0002 #define RecoVertex_PixelVertexFinding_plugins_alpaka_vertexFinder_h
0003
0004 #include <cstddef>
0005 #include <cstdint>
0006
0007 #include <alpaka/alpaka.hpp>
0008
0009 #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h"
0010 #include "DataFormats/VertexSoA/interface/ZVertexDevice.h"
0011 #include "DataFormats/VertexSoA/interface/ZVertexHost.h"
0012 #include "DataFormats/VertexSoA/interface/ZVertexSoA.h"
0013 #include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h"
0014 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0015 #include "RecoVertex/PixelVertexFinding/interface/PixelVertexWorkSpaceLayout.h"
0016 #include "RecoVertex/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceSoADeviceAlpaka.h"
0017
0018 namespace ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder {
0019
0020 using namespace cms::alpakatools;
0021 using VtxSoAView = ::reco::ZVertexSoAView;
0022 using TrkSoAView = ::reco::ZVertexTracksSoAView;
0023 using WsSoAView = ::vertexFinder::PixelVertexWorkSpaceSoAView;
0024
0025 class Init {
0026 public:
0027 ALPAKA_FN_ACC void operator()(Acc1D const &acc, VtxSoAView data, WsSoAView ws) const {
0028 data.nvFinal() = 0;
0029 ::vertexFinder::init(ws);
0030 }
0031 };
0032
0033 template <typename TrackerTraits>
0034 class Producer {
0035 using TkSoAConstView = reco::TrackSoAConstView<TrackerTraits>;
0036
0037 public:
0038 Producer(bool oneKernel,
0039 bool useDensity,
0040 bool useDBSCAN,
0041 bool useIterative,
0042 bool doSplitting,
0043 int iminT,
0044 float ieps,
0045 float ierrmax,
0046 float ichi2max
0047 )
0048 : oneKernel_(oneKernel && !(useDBSCAN || useIterative)),
0049 useDensity_(useDensity),
0050 useDBSCAN_(useDBSCAN),
0051 useIterative_(useIterative),
0052 doSplitting_(doSplitting),
0053 minT(iminT),
0054 eps(ieps),
0055 errmax(ierrmax),
0056 chi2max(ichi2max) {}
0057
0058 ~Producer() = default;
0059
0060 ZVertexSoACollection makeAsync(
0061 Queue &queue, TkSoAConstView const &tracks_view, int maxVertices, float ptMin, float ptMax) const;
0062
0063 private:
0064 const bool oneKernel_;
0065 const bool useDensity_;
0066 const bool useDBSCAN_;
0067 const bool useIterative_;
0068 const bool doSplitting_;
0069
0070 int minT;
0071 float eps;
0072 float errmax;
0073 float chi2max;
0074 };
0075
0076 }
0077
0078 #endif