laura is hosted by Hepforge, IPPP Durham
Laura++  v2r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.

Class for defining a 2D cubic spline based on an input histogram. More...

#include <Lau2DCubicSpline.hh>

Public Member Functions

 Lau2DCubicSpline (const TH2 &h)
 Constructor from histogram. More...
 
virtual ~Lau2DCubicSpline ()
 Destructor. More...
 
virtual Double_t evaluate (Double_t x, Double_t y) const
 Evaluate the function at given point. More...
 
virtual Double_t analyticalIntegral (Double_t x1, Double_t x2, Double_t y1, Double_t y2) const
 Evaluate analytical integral in x, y, or x and y. More...
 
virtual Double_t analyticalIntegral () const
 Evaluate analytical integral across the whole function. More...
 

Private Types

enum  { NCoeff = 16, CoeffRecLen = 17 }
 Length of coefficient record in array. More...
 

Private Member Functions

 Lau2DCubicSpline (const Lau2DCubicSpline &rhs)
 Copy constructor - not implemented. More...
 
Lau2DCubicSplineoperator= (const Lau2DCubicSpline &rhs)
 Copy assignment operator - not implemented. More...
 
Double_t histcont (const TH2 &h, Int_t xbin, Int_t ybin) const
 Get contents of a given bin from a histogram. More...
 
Double_t dhistdx (const TH2 &h, Int_t xbin, Int_t ybin) const
 Get d/dx finite difference in a given bin from a histogram. More...
 
Double_t dhistdy (const TH2 &h, Int_t xbin, Int_t ybin) const
 Get d/dy finite difference in a given bin from a histogram. More...
 
Double_t d2histdxdy (const TH2 &h, Int_t xbin, Int_t ybin) const
 Get d^2/dydx finite difference in a given bin from a histogram. More...
 
const Double_t & coeff (Int_t binx, Int_t biny, Int_t theCoeff) const
 Const access to coefficients. More...
 
Double_t & coeff (Int_t binx, Int_t biny, Int_t theCoeff)
 Access to coefficients. More...
 
Double_t evalX (Double_t x1, Double_t x2, Double_t y) const
 Evaluate integral over x at a given y from (x1, y) to (x2, y) More...
 
Double_t evalY (Double_t x, Double_t y1, Double_t y2) const
 Evaluate integral over y at a given x from (x, y1) to (x, y2) More...
 
Double_t evalXY (Double_t x1, Double_t x2, Double_t y1, Double_t y2) const
 Evaluate integral over x and y from (x1, y1) to (x2, y2) More...
 
 ClassDef (Lau2DCubicSpline, 0)
 

Private Attributes

Int_t nBinsX
 Number of bins in x axis. More...
 
Int_t nBinsY
 Number of bins in y axis. More...
 
Double_t binSizeX
 Bin size in x. More...
 
Double_t binSizeY
 Bin size in y. More...
 
Double_t xmin
 Minimum x value. More...
 
Double_t xmax
 Maximum x value. More...
 
Double_t ymin
 Minimum y value. More...
 
Double_t ymax
 Maximum y value. More...
 
std::vector< Double_t > coeffs
 Coefficients of interpolation polynomials. More...
 

Detailed Description

Class for defining a 2D cubic spline based on an input histogram.

Class for defining a 2D cubic spline based on RooBinned2DBicubicBase by Manuel Tobias Schiller manue.nosp@m.l.sc.nosp@m.hille.nosp@m.r@ni.nosp@m.khef..nosp@m.nl (2012-08-29).

Smoothly interpolate between bin midpoints of a 2D histogram with equal-sized bins

The interpolation function coincides with the saved histogram values in bin midpoints; a cubic interpolation polynomial is used. Bins must all have the same size. The interpolation polynomial in a "cell" between four bin midpoints is:

\[ p(x, y) = \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} x^i y^j \]

The coefficients $a_{ij}$ are determined by the requirement that function value, first derivatives and the mixed second derivative must agree with that of the binned function at the four bin midpoints at the edges of the cell. Symmetric finite differences are used to approximate these derivatives.

For each cell, the coefficients are determined at constuction time. The object also keeps a cache of 2D integrals over complete cells, such that 2D integrations can be done analytically in a reasonably short amount of time.

Definition at line 47 of file Lau2DCubicSpline.hh.

Member Enumeration Documentation

anonymous enum
private

Length of coefficient record in array.

Enumerator
NCoeff 
CoeffRecLen 

Definition at line 51 of file Lau2DCubicSpline.hh.

Constructor & Destructor Documentation

Lau2DCubicSpline::Lau2DCubicSpline ( const TH2 &  h)

Constructor from histogram.

/param h the histogram

Definition at line 69 of file Lau2DCubicSpline.cc.

Lau2DCubicSpline::~Lau2DCubicSpline ( )
virtual

Destructor.

Definition at line 27 of file Lau2DCubicSpline.cc.

Lau2DCubicSpline::Lau2DCubicSpline ( const Lau2DCubicSpline rhs)
private

Copy constructor - not implemented.

Member Function Documentation

Double_t Lau2DCubicSpline::analyticalIntegral ( Double_t  x1,
Double_t  x2,
Double_t  y1,
Double_t  y2 
) const
virtual

Evaluate analytical integral in x, y, or x and y.

Parameters
[in]x1the lower x limit
[in]x2the upper x limit
[in]y1the lower y limit
[in]y2the upper y limit

Definition at line 217 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::analyticalIntegral ( ) const
virtual

Evaluate analytical integral across the whole function.

Definition at line 212 of file Lau2DCubicSpline.cc.

Lau2DCubicSpline::ClassDef ( Lau2DCubicSpline  ,
 
)
private
const Double_t& Lau2DCubicSpline::coeff ( Int_t  binx,
Int_t  biny,
Int_t  theCoeff 
) const
inlineprivate

Const access to coefficients.

Parameters
[in]binxthe x bin index
[in]binythe y bin index
[in]theCoeffthe coefficient index
Returns
the coefficient

Definition at line 160 of file Lau2DCubicSpline.hh.

Double_t& Lau2DCubicSpline::coeff ( Int_t  binx,
Int_t  biny,
Int_t  theCoeff 
)
inlineprivate

Access to coefficients.

Parameters
[in]binxthe x bin index
[in]binythe y bin index
[in]theCoeffthe coefficient index
Returns
the coefficient

Definition at line 170 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::d2histdxdy ( const TH2 &  h,
Int_t  xbin,
Int_t  ybin 
) const
inlineprivate

Get d^2/dydx finite difference in a given bin from a histogram.

Parameters
[in]hthe histogram
[in]xbinthe x bin index
[in]ybinthe y bin index
Returns
the d^2/dydx finite difference

Definition at line 60 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::dhistdx ( const TH2 &  h,
Int_t  xbin,
Int_t  ybin 
) const
inlineprivate

Get d/dx finite difference in a given bin from a histogram.

Parameters
[in]hthe histogram
[in]xbinthe x bin index
[in]ybinthe y bin index
Returns
the d/dx finite difference

Definition at line 46 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::dhistdy ( const TH2 &  h,
Int_t  xbin,
Int_t  ybin 
) const
inlineprivate

Get d/dy finite difference in a given bin from a histogram.

Parameters
[in]hthe histogram
[in]xbinthe x bin index
[in]ybinthe y bin index
Returns
the d/dy finite difference

Definition at line 53 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::evaluate ( Double_t  x,
Double_t  y 
) const
virtual

Evaluate the function at given point.

Parameters
[in]xthe x co-ordinate
[in]ythe y co-ordinate

Definition at line 185 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::evalX ( Double_t  x1,
Double_t  x2,
Double_t  y 
) const
private

Evaluate integral over x at a given y from (x1, y) to (x2, y)

Parameters
[in]x1lower x limit
[in]x2upper x limit
[in]yy value
Returns
integral over x

Definition at line 224 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::evalXY ( Double_t  x1,
Double_t  x2,
Double_t  y1,
Double_t  y2 
) const
private

Evaluate integral over x and y from (x1, y1) to (x2, y2)

Parameters
[in]x1lower x limit
[in]x2upper x limit
[in]y1lower y limit
[in]y2upper y limit
Returns
integral over x and y

Definition at line 300 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::evalY ( Double_t  x,
Double_t  y1,
Double_t  y2 
) const
private

Evaluate integral over y at a given x from (x, y1) to (x, y2)

Parameters
[in]xx value
[in]y1lower y limit
[in]y2upper y limit
Returns
integral over y

Definition at line 262 of file Lau2DCubicSpline.cc.

Double_t Lau2DCubicSpline::histcont ( const TH2 &  h,
Int_t  xbin,
Int_t  ybin 
) const
inlineprivate

Get contents of a given bin from a histogram.

Parameters
[in]hthe histogram
[in]xbinthe x bin index
[in]ybinthe y bin index
Returns
the bin contents

Definition at line 30 of file Lau2DCubicSpline.cc.

Lau2DCubicSpline& Lau2DCubicSpline::operator= ( const Lau2DCubicSpline rhs)
private

Copy assignment operator - not implemented.

Member Data Documentation

Double_t Lau2DCubicSpline::binSizeX
private

Bin size in x.

Definition at line 97 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::binSizeY
private

Bin size in y.

Definition at line 100 of file Lau2DCubicSpline.hh.

std::vector<Double_t> Lau2DCubicSpline::coeffs
private

Coefficients of interpolation polynomials.

Definition at line 115 of file Lau2DCubicSpline.hh.

Int_t Lau2DCubicSpline::nBinsX
private

Number of bins in x axis.

Definition at line 91 of file Lau2DCubicSpline.hh.

Int_t Lau2DCubicSpline::nBinsY
private

Number of bins in y axis.

Definition at line 94 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::xmax
private

Maximum x value.

Definition at line 106 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::xmin
private

Minimum x value.

Definition at line 103 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::ymax
private

Maximum y value.

Definition at line 112 of file Lau2DCubicSpline.hh.

Double_t Lau2DCubicSpline::ymin
private

Minimum y value.

Definition at line 109 of file Lau2DCubicSpline.hh.


The documentation for this class was generated from the following files: