CMS 3D CMS Logo

LookupTable2d.h
Go to the documentation of this file.
1 #ifndef RecoJets_FFTJetAlgorithms_LookupTable2d_h
2 #define RecoJets_FFTJetAlgorithms_LookupTable2d_h
3 
4 #include <vector>
5 
6 namespace fftjetcms {
7  class LookupTable2d {
8  public:
10  unsigned nx, double xmin, double xmax, unsigned ny, double ymin, double ymax, const std::vector<double>& data);
11  LookupTable2d() = delete;
12 
13  inline const std::vector<double>& data() const { return data_; }
14  inline unsigned nx() const { return nx_; }
15  inline unsigned ny() const { return ny_; }
16  inline double xmin() const { return xmin_; }
17  inline double xmax() const { return xmax_; }
18  inline double ymin() const { return ymin_; }
19  inline double ymax() const { return ymax_; }
20  inline double xstep() const { return bwx_; }
21  inline double ystep() const { return bwy_; }
22  inline double binValue(const unsigned ix, const unsigned iy) const { return data_.at(ix * ny_ + iy); }
23 
24  double closest(double x, double y) const;
25 
26  private:
27  std::vector<double> data_;
28  unsigned nx_;
29  unsigned ny_;
30  double xmin_;
31  double xmax_;
32  double ymin_;
33  double ymax_;
34  double bwx_;
35  double bwy_;
36  };
37 } // namespace fftjetcms
38 
39 #endif // RecoJets_FFTJetAlgorithms_LookupTable2d_h
const std::vector< double > & data() const
Definition: LookupTable2d.h:13
double binValue(const unsigned ix, const unsigned iy) const
Definition: LookupTable2d.h:22
double closest(double x, double y) const
unsigned ny() const
Definition: LookupTable2d.h:15
unsigned nx() const
Definition: LookupTable2d.h:14
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
std::vector< double > data_
Definition: LookupTable2d.h:27