46: fX(theGraph->GetX(), theGraph->GetX() + theGraph->GetN()),
47 fY(theGraph->GetY(), theGraph->GetY() + theGraph->GetN())
67 if (ibin < 0 ) ibin = 0;
68 if (ibin >=
N) ibin =
N - 1;
72 Warning(
"Eval",
"Graph has less than 3 points, returning value of the closest");
74 }
else if (ibin == 0) {
84 }
else if (ibin >= (
N - 2)) {
96 retval = ( Quadrax(
x,
140 Float_t a = cos1*(dm2-dm3) + cos2*(dm3-dm1) + cos3*(dm1-dm2);
141 Float_t b = cos1*(dm2*dm2-dm3*dm3) + cos2*(dm3*dm3-dm1*dm1) + cos3*(dm1*dm1-dm2*dm2);
142 Float_t c = cos1*(dm2-dm3)*dm2*dm3 + cos2*(dm3-dm1)*dm3*dm1 + cos3*(dm1-dm2)*dm1*dm2;
144 Float_t denom = (dm2-dm3)*(dm3-dm1)*(dm1-dm2);
146 return (denom != 0.0) ? (-
a*dm*dm+
b*dm-
c)/denom : 0.0;
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
A TGraph is an object made of two arrays X and Y with npoints each.
Quadratic interpolation of TGraph.
virtual void BuildCoeff(void)
no coefficients to precompute
TSpline2(const TString &title, const TGraph *theGraph)
constructor from TGraph pointer (not owned by TSpline2) TSpline is a TNamed object
virtual ~TSpline2(void)
destructor
virtual Double_t Eval(Double_t x) const
returns quadratically interpolated TGraph entry around x
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const
no knots
Double_t Quadrax(Float_t dm, Float_t dm1, Float_t dm2, Float_t dm3, Float_t cos1, Float_t cos2, Float_t cos3) const
quadratic interpolation Revised and checked by Francois Nov, 16th, 2000 Note the beautiful non-sponta...
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.