CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

fftjetcms::LookupTable2d Class Reference

#include <LookupTable2d.h>

List of all members.

Public Member Functions

double binValue (const unsigned ix, const unsigned iy) const
double closest (double x, double y) const
const std::vector< double > & data () const
 LookupTable2d (unsigned nx, double xmin, double xmax, unsigned ny, double ymin, double ymax, const std::vector< double > &data)
unsigned nx () const
unsigned ny () const
double xmax () const
double xmin () const
double xstep () const
double ymax () const
double ymin () const
double ystep () const

Private Member Functions

 LookupTable2d ()

Private Attributes

double bwx_
double bwy_
std::vector< double > data_
unsigned nx_
unsigned ny_
double xmax_
double xmin_
double ymax_
double ymin_

Detailed Description

Definition at line 7 of file LookupTable2d.h.


Constructor & Destructor Documentation

fftjetcms::LookupTable2d::LookupTable2d ( unsigned  nx,
double  xmin,
double  xmax,
unsigned  ny,
double  ymin,
double  ymax,
const std::vector< double > &  data 
)

Definition at line 7 of file LookupTable2d.cc.

References data_, nx_, ny_, xmax_, xmin_, ymax_, and ymin_.

        : data_(data),
          nx_(nx),
          ny_(ny),
          xmin_(xmin),
          xmax_(xmax),
          ymin_(ymin),
          ymax_(ymax),
          bwx_((xmax - xmin)/nx),
          bwy_((ymax - ymin)/ny)
    {
        assert(nx_);
        assert(ny_);
        assert(xmin_ < xmax_);
        assert(ymin_ < ymax_);
        assert(data_.size() == nx_*ny_);
    }
fftjetcms::LookupTable2d::LookupTable2d ( ) [private]

Member Function Documentation

double fftjetcms::LookupTable2d::binValue ( const unsigned  ix,
const unsigned  iy 
) const [inline]

Definition at line 23 of file LookupTable2d.h.

References data_, and ny_.

            {return data_.at(ix*ny_ + iy);}
double fftjetcms::LookupTable2d::closest ( double  x,
double  y 
) const

Definition at line 27 of file LookupTable2d.cc.

References bwx_, bwy_, data_, nx_, ny_, xmax_, xmin_, ymax_, and ymin_.

Referenced by fftjetcms::EtaAndPtLookupPeakSelector::operator()().

    {
        const unsigned ix = x <= xmin_ ? 0U : x >= xmax_-bwx_/2.0 ? nx_ - 1U : 
            static_cast<unsigned>((x - xmin_)/bwx_);
        const unsigned iy = y <= ymin_ ? 0U : y >= ymax_-bwy_/2.0 ? ny_ - 1U : 
            static_cast<unsigned>((y - ymin_)/bwy_);
        return data_[ix*ny_ + iy];
    }
const std::vector<double>& fftjetcms::LookupTable2d::data ( ) const [inline]

Definition at line 14 of file LookupTable2d.h.

References data_.

{return data_;}
unsigned fftjetcms::LookupTable2d::nx ( ) const [inline]

Definition at line 15 of file LookupTable2d.h.

References nx_.

{return nx_;}
unsigned fftjetcms::LookupTable2d::ny ( ) const [inline]

Definition at line 16 of file LookupTable2d.h.

References ny_.

{return ny_;}
double fftjetcms::LookupTable2d::xmax ( ) const [inline]

Definition at line 18 of file LookupTable2d.h.

References xmax_.

{return xmax_;}
double fftjetcms::LookupTable2d::xmin ( ) const [inline]

Definition at line 17 of file LookupTable2d.h.

References xmin_.

{return xmin_;}
double fftjetcms::LookupTable2d::xstep ( ) const [inline]

Definition at line 21 of file LookupTable2d.h.

References bwx_.

{return bwx_;}
double fftjetcms::LookupTable2d::ymax ( ) const [inline]

Definition at line 20 of file LookupTable2d.h.

References ymax_.

{return ymax_;}
double fftjetcms::LookupTable2d::ymin ( ) const [inline]

Definition at line 19 of file LookupTable2d.h.

References ymin_.

{return ymin_;}
double fftjetcms::LookupTable2d::ystep ( ) const [inline]

Definition at line 22 of file LookupTable2d.h.

References bwy_.

{return bwy_;}

Member Data Documentation

Definition at line 38 of file LookupTable2d.h.

Referenced by closest(), and xstep().

Definition at line 39 of file LookupTable2d.h.

Referenced by closest(), and ystep().

std::vector<double> fftjetcms::LookupTable2d::data_ [private]

Definition at line 31 of file LookupTable2d.h.

Referenced by binValue(), closest(), data(), and LookupTable2d().

unsigned fftjetcms::LookupTable2d::nx_ [private]

Definition at line 32 of file LookupTable2d.h.

Referenced by closest(), LookupTable2d(), and nx().

unsigned fftjetcms::LookupTable2d::ny_ [private]

Definition at line 33 of file LookupTable2d.h.

Referenced by binValue(), closest(), LookupTable2d(), and ny().

Definition at line 35 of file LookupTable2d.h.

Referenced by closest(), LookupTable2d(), and xmax().

Definition at line 34 of file LookupTable2d.h.

Referenced by closest(), LookupTable2d(), and xmin().

Definition at line 37 of file LookupTable2d.h.

Referenced by closest(), LookupTable2d(), and ymax().

Definition at line 36 of file LookupTable2d.h.

Referenced by closest(), LookupTable2d(), and ymin().