Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-04 01:26:16

0001 #ifndef RecoPixelVertexing_PixelTriplets_plugins_CAHitNtupletGeneratorOnGPU_h
0002 #define RecoPixelVertexing_PixelTriplets_plugins_CAHitNtupletGeneratorOnGPU_h
0003 
0004 #include <cuda_runtime.h>
0005 #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DHeterogeneous.h"
0006 #include "CUDADataFormats/Track/interface/PixelTrackHeterogeneous.h"
0007 
0008 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/Utilities/interface/EDGetToken.h"
0011 #include "HeterogeneousCore/CUDAUtilities/interface/SimpleVector.h"
0012 
0013 #include "CAHitNtupletGeneratorKernels.h"
0014 #include "HelixFitOnGPU.h"
0015 
0016 #include "GPUCACell.h"
0017 
0018 namespace edm {
0019   class Event;
0020   class EventSetup;
0021   class ParameterSetDescription;
0022 }  // namespace edm
0023 
0024 class CAHitNtupletGeneratorOnGPU {
0025 public:
0026   using HitsOnGPU = TrackingRecHit2DSOAView;
0027   using HitsOnCPU = TrackingRecHit2DGPU;
0028   using hindex_type = TrackingRecHit2DSOAView::hindex_type;
0029 
0030   using Quality = pixelTrack::Quality;
0031   using OutputSoA = pixelTrack::TrackSoA;
0032   using HitContainer = pixelTrack::HitContainer;
0033   using Tuple = HitContainer;
0034 
0035   using QualityCuts = cAHitNtupletGenerator::QualityCuts;
0036   using Params = cAHitNtupletGenerator::Params;
0037   using Counters = cAHitNtupletGenerator::Counters;
0038 
0039 public:
0040   CAHitNtupletGeneratorOnGPU(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC)
0041       : CAHitNtupletGeneratorOnGPU(cfg, iC) {}
0042   CAHitNtupletGeneratorOnGPU(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC);
0043 
0044   static void fillDescriptions(edm::ParameterSetDescription& desc);
0045   static const char* fillDescriptionsLabel() { return "caHitNtupletOnGPU"; }
0046 
0047   void beginJob();
0048   void endJob();
0049 
0050   PixelTrackHeterogeneous makeTuplesAsync(TrackingRecHit2DGPU const& hits_d, float bfield, cudaStream_t stream) const;
0051 
0052   PixelTrackHeterogeneous makeTuples(TrackingRecHit2DCPU const& hits_d, float bfield) const;
0053 
0054 private:
0055   void buildDoublets(HitsOnCPU const& hh, cudaStream_t stream) const;
0056 
0057   void hitNtuplets(HitsOnCPU const& hh, const edm::EventSetup& es, bool useRiemannFit, cudaStream_t cudaStream);
0058 
0059   void launchKernels(HitsOnCPU const& hh, bool useRiemannFit, cudaStream_t cudaStream) const;
0060 
0061   Params m_params;
0062 
0063   Counters* m_counters = nullptr;
0064 };
0065 
0066 #endif  // RecoPixelVertexing_PixelTriplets_plugins_CAHitNtupletGeneratorOnGPU_h