CMS 3D CMS Logo

PixelCPEFast.h
Go to the documentation of this file.
1 #ifndef RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h
2 #define RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h
3 
4 #include <utility>
5 
13 
14 class MagneticField;
15 template <typename TrackerTraits>
16 class PixelCPEFast final : public PixelCPEGenericBase {
17 public:
18  PixelCPEFast(edm::ParameterSet const &conf,
19  const MagneticField *,
20  const TrackerGeometry &,
21  const TrackerTopology &,
22  const SiPixelLorentzAngle *,
24  const SiPixelLorentzAngle *);
25 
26  ~PixelCPEFast() override = default;
27 
29 
30  // The return value can only be used safely in kernels launched on
31  // the same cudaStream, or after cudaStreamSynchronize.
35 
36  const ParamsOnGPU *getGPUProductAsync(cudaStream_t cudaStream) const;
37 
38  ParamsOnGPU const &getCPUProduct() const { return cpuData_; }
39 
40 private:
41  LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
42  LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
43 
44  void errorFromTemplates(DetParam const &theDetParam, ClusterParamGeneric &theClusterParam, float qclus) const;
45 
46  //--- DB Error Parametrization object, new light templates
47  std::vector<SiPixelGenErrorStore> thePixelGenError_;
48 
49  // allocate this with posix malloc to be compatible with the cpu workflow
50  std::vector<pixelCPEforGPU::DetParams> detParamsGPU_;
55 
56  struct GPUData {
57  ~GPUData();
58  // not needed if not used on CPU...
60  ParamsOnGPU *paramsOnGPU_d = nullptr; // copy of the above on the Device
61  };
63 
64  void fillParamsForGpu();
65 };
66 
67 #endif // RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h
LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
ParamsOnGPU * paramsOnGPU_d
Definition: PixelCPEFast.h:60
ParamsOnGPU const & getCPUProduct() const
Definition: PixelCPEFast.h:38
static void fillPSetDescription(edm::ParameterSetDescription &desc)
std::vector< SiPixelGenErrorStore > thePixelGenError_
Definition: PixelCPEFast.h:47
PixelCPEFast(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelGenErrorDBObject *, const SiPixelLorentzAngle *)
The constructor.
Definition: PixelCPEFast.cc:24
std::vector< pixelCPEforGPU::DetParams > detParamsGPU_
Definition: PixelCPEFast.h:50
cms::cuda::ESProduct< GPUData > gpuData_
Definition: PixelCPEFast.h:62
ParamsOnGPU cpuData_
Definition: PixelCPEFast.h:54
LayerGeometry layerGeometry_
Definition: PixelCPEFast.h:52
void fillParamsForGpu()
Definition: PixelCPEFast.cc:92
~PixelCPEFast() override=default
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
ParamsOnGPU paramsOnGPU_h
Definition: PixelCPEFast.h:59
AverageGeometry averageGeometry_
Definition: PixelCPEFast.h:53
const ParamsOnGPU * getGPUProductAsync(cudaStream_t cudaStream) const
Definition: PixelCPEFast.cc:51
pixelCPEforGPU::CommonParams commonParamsGPU_
Definition: PixelCPEFast.h:51
void errorFromTemplates(DetParam const &theDetParam, ClusterParamGeneric &theClusterParam, float qclus) const