laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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.
 
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.
 

Private Types

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

Private Member Functions

 Lau2DCubicSpline (const Lau2DCubicSpline &rhs)
 Copy constructor - not implemented.
 
Lau2DCubicSplineoperator= (const Lau2DCubicSpline &rhs)
 Copy assignment operator - not implemented.
 
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...
 

Private Attributes

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

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 65 of file Lau2DCubicSpline.hh.

Constructor & Destructor Documentation

◆ Lau2DCubicSpline()

Lau2DCubicSpline::Lau2DCubicSpline ( const TH2 &  h)

Constructor from histogram.

Parameters
hthe histogram

Definition at line 80 of file Lau2DCubicSpline.cc.

Member Function Documentation

◆ analyticalIntegral()

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.

◆ coeff() [1/2]

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 191 of file Lau2DCubicSpline.hh.

◆ coeff() [2/2]

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 179 of file Lau2DCubicSpline.hh.

◆ d2histdxdy()

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 74 of file Lau2DCubicSpline.cc.

◆ dhistdx()

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 64 of file Lau2DCubicSpline.cc.

◆ dhistdy()

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 69 of file Lau2DCubicSpline.cc.

◆ evaluate()

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.

◆ evalX()

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 226 of file Lau2DCubicSpline.cc.

◆ evalXY()

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 312 of file Lau2DCubicSpline.cc.

◆ evalY()

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 269 of file Lau2DCubicSpline.cc.

◆ histcont()

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 45 of file Lau2DCubicSpline.cc.


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