CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoJets/FFTJetAlgorithms/interface/LookupTable2d.h

Go to the documentation of this file.
00001 #ifndef RecoJets_FFTJetAlgorithms_LookupTable2d_h
00002 #define RecoJets_FFTJetAlgorithms_LookupTable2d_h
00003 
00004 #include <vector>
00005 
00006 namespace fftjetcms {
00007     class LookupTable2d
00008     {
00009     public:
00010         LookupTable2d(unsigned nx, double xmin, double xmax,
00011                       unsigned ny, double ymin, double ymax,
00012                       const std::vector<double>& data);
00013 
00014         inline const std::vector<double>& data() const {return data_;}
00015         inline unsigned nx() const {return nx_;}
00016         inline unsigned ny() const {return ny_;}
00017         inline double xmin() const {return xmin_;}
00018         inline double xmax() const {return xmax_;}
00019         inline double ymin() const {return ymin_;}
00020         inline double ymax() const {return ymax_;}
00021         inline double xstep() const {return bwx_;}
00022         inline double ystep() const {return bwy_;}
00023         inline double binValue(const unsigned ix, const unsigned iy) const
00024             {return data_.at(ix*ny_ + iy);}
00025 
00026         double closest(double x, double y) const;
00027 
00028     private:
00029         LookupTable2d();
00030 
00031         std::vector<double> data_;
00032         unsigned nx_;
00033         unsigned ny_;
00034         double xmin_;
00035         double xmax_;
00036         double ymin_;
00037         double ymax_;
00038         double bwx_;
00039         double bwy_;
00040     };
00041 }
00042 
00043 #endif // RecoJets_FFTJetAlgorithms_LookupTable2d_h