File indexing completed on 2024-04-06 12:25:22
0001 #ifndef RecoJets_FFTJetAlgorithms_LookupTable2d_h
0002 #define RecoJets_FFTJetAlgorithms_LookupTable2d_h
0003
0004 #include <vector>
0005
0006 namespace fftjetcms {
0007 class LookupTable2d {
0008 public:
0009 LookupTable2d(
0010 unsigned nx, double xmin, double xmax, unsigned ny, double ymin, double ymax, const std::vector<double>& data);
0011 LookupTable2d() = delete;
0012
0013 inline const std::vector<double>& data() const { return data_; }
0014 inline unsigned nx() const { return nx_; }
0015 inline unsigned ny() const { return ny_; }
0016 inline double xmin() const { return xmin_; }
0017 inline double xmax() const { return xmax_; }
0018 inline double ymin() const { return ymin_; }
0019 inline double ymax() const { return ymax_; }
0020 inline double xstep() const { return bwx_; }
0021 inline double ystep() const { return bwy_; }
0022 inline double binValue(const unsigned ix, const unsigned iy) const { return data_.at(ix * ny_ + iy); }
0023
0024 double closest(double x, double y) const;
0025
0026 private:
0027 std::vector<double> data_;
0028 unsigned nx_;
0029 unsigned ny_;
0030 double xmin_;
0031 double xmax_;
0032 double ymin_;
0033 double ymax_;
0034 double bwx_;
0035 double bwy_;
0036 };
0037 }
0038
0039 #endif