45: fX(theGraph->GetX(), theGraph->GetX() + theGraph->GetN()),
46 fY(theGraph->GetY(), theGraph->GetY() + theGraph->GetN())
64 if (ibin < 0 ) ibin = 0;
65 if (ibin >=
N) ibin =
N - 1;
68 if ((
x > fX[ibin] && ibin !=
N-1) || ibin == 0)
74 Double_t dx = fX[ibin] - fX[nextbin];
75 Double_t dy = fY[ibin] - fY[nextbin];
76 return fY[ibin] + (
x - fX[ibin]) * dy/dx;
A TGraph is an object made of two arrays X and Y with npoints each.
Linear interpolation of TGraph.
TSpline1(const TString &title, const TGraph *theGraph)
constructor from TGraph pointer (not owned by TSpline1) TSpline is a TNamed object
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const
no knots
virtual ~TSpline1(void)
destructor
virtual void BuildCoeff(void)
no coefficients to precompute
virtual Double_t Eval(Double_t x) const
returns linearly interpolated TGraph entry around x
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.