55 if (fGraph)
delete fGraph;
66 Int_t nbin = fGraph->GetN();
69 if (ibin < 0 ) ibin = 0;
70 if (ibin >= nbin) ibin = nbin - 1;
73 if ((
x > fGraph->GetX()[ibin] && ibin != nbin-1) || ibin == 0)
79 Double_t dx = fGraph->GetX()[ibin] - fGraph->GetX()[nextbin];
80 Double_t dy = fGraph->GetY()[ibin] - fGraph->GetY()[nextbin];
81 return fGraph->GetY()[ibin] + (
x - fGraph->GetX()[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, TGraph *theGraph)
constructor from TGraph 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)