laura is hosted by Hepforge, IPPP Durham
Laura++  v3r3
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau2DCubicSpline.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2006 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
42 #ifndef LAU_2DCUBICSPLINE
43 #define LAU_2DCUBICSPLINE
44 
45 class TH2;
46 
48 {
49  private:
51  enum { NCoeff = 16, CoeffRecLen = 17 };
52 
53  public:
55 
58  Lau2DCubicSpline(const TH2& h);
59 
61  virtual ~Lau2DCubicSpline();
62 
64 
68  virtual Double_t evaluate(Double_t x, Double_t y) const;
69 
71 
77  virtual Double_t analyticalIntegral(Double_t x1, Double_t x2, Double_t y1, Double_t y2) const;
78 
80  virtual Double_t analyticalIntegral() const;
81 
82 
83  private:
85  Lau2DCubicSpline( const Lau2DCubicSpline& rhs );
86 
89 
91  Int_t nBinsX;
92 
94  Int_t nBinsY;
95 
97  Double_t binSizeX;
98 
100  Double_t binSizeY;
101 
103  Double_t xmin;
104 
106  Double_t xmax;
107 
109  Double_t ymin;
110 
112  Double_t ymax;
113 
115  std::vector<Double_t> coeffs;
116 
118 
124  Double_t histcont(const TH2& h, Int_t xbin, Int_t ybin) const;
125 
127 
133  Double_t dhistdx(const TH2& h, Int_t xbin, Int_t ybin) const;
134 
136 
142  Double_t dhistdy(const TH2& h, Int_t xbin, Int_t ybin) const;
143 
145 
151  Double_t d2histdxdy(const TH2& h, Int_t xbin, Int_t ybin) const;
152 
154 
160  inline const Double_t& coeff(Int_t binx, Int_t biny, Int_t theCoeff) const
161  { return coeffs[theCoeff + CoeffRecLen * (binx + nBinsX * biny)]; }
162 
164 
170  inline Double_t& coeff(Int_t binx, Int_t biny, Int_t theCoeff)
171  { return coeffs[theCoeff + CoeffRecLen * (binx + nBinsX * biny)]; }
172 
174 
180  Double_t evalX(Double_t x1, Double_t x2, Double_t y) const;
181 
183 
189  Double_t evalY(Double_t x, Double_t y1, Double_t y2) const;
190 
192 
199  Double_t evalXY(Double_t x1, Double_t x2, Double_t y1, Double_t y2) const;
200 
201  ClassDef(Lau2DCubicSpline, 0); // Class for defining a 2D cubic spline based on an input histogram
202 };
203 
204 #endif
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.
Double_t histcont(const TH2 &h, Int_t xbin, Int_t ybin) const
Get contents of a given bin from a histogram.
Double_t xmax
Maximum x value.
virtual Double_t analyticalIntegral() const
Evaluate analytical integral across the whole function.
Double_t & coeff(Int_t binx, Int_t biny, Int_t theCoeff)
Access to coefficients.
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.
Class for defining a 2D cubic spline based on an input histogram.
Lau2DCubicSpline & operator=(const Lau2DCubicSpline &rhs)
Copy assignment operator - not implemented.
ClassDef(Lau2DCubicSpline, 0)
Int_t nBinsX
Number of bins in x axis.
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)
Int_t nBinsY
Number of bins in y axis.
virtual Double_t evaluate(Double_t x, Double_t y) const
Evaluate the function at given point.
Double_t xmin
Minimum x value.
Lau2DCubicSpline(const TH2 &h)
Constructor from histogram.
Double_t binSizeX
Bin size in x.
virtual ~Lau2DCubicSpline()
Destructor.
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)
Double_t ymax
Maximum y value.
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.
Double_t ymin
Minimum y value.
Double_t binSizeY
Bin size in y.
std::vector< Double_t > coeffs
Coefficients of interpolation polynomials.
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)
const Double_t & coeff(Int_t binx, Int_t biny, Int_t theCoeff) const
Const access to coefficients.