56 if (fGraph)
delete fGraph;
71 if (ibin < 0 ) ibin = 0;
72 if (ibin >= fGraph->GetN()) ibin = fGraph->GetN() - 1;
79 fGraph->GetX()[ibin] + dx,
80 fGraph->GetX()[ibin+1] + dx,
81 fGraph->GetX()[ibin+2] + dx,
83 fGraph->GetY()[ibin+1],
84 fGraph->GetY()[ibin+2]);
87 else if (ibin >= (fGraph->GetN()-2)) {
88 ibin = fGraph->GetN() - 1;
91 fGraph->GetX()[ibin-2] + dx,
92 fGraph->GetX()[ibin-1] + dx,
93 fGraph->GetX()[ibin] + dx,
94 fGraph->GetY()[ibin-2],
95 fGraph->GetY()[ibin-1],
96 fGraph->GetY()[ibin]);
100 retval = ( Quadrax(
x,
101 fGraph->GetX()[ibin-1] + dx,
102 fGraph->GetX()[ibin] + dx,
103 fGraph->GetX()[ibin+1] + dx,
104 fGraph->GetY()[ibin-1],
105 fGraph->GetY()[ibin],
106 fGraph->GetY()[ibin+1])
108 Quadrax(
x, fGraph->GetX()[ibin] + dx,
109 fGraph->GetX()[ibin+1] + dx,
110 fGraph->GetX()[ibin+2] + dx,
111 fGraph->GetY()[ibin],
112 fGraph->GetY()[ibin+1],
113 fGraph->GetY()[ibin+2]) )*0.5;
143 Float_t a = cos1*(dm2-dm3) + cos2*(dm3-dm1) + cos3*(dm1-dm2);
144 Float_t b = cos1*(dm2*dm2-dm3*dm3) + cos2*(dm3*dm3-dm1*dm1) + cos3*(dm1*dm1-dm2*dm2);
145 Float_t c = cos1*(dm2-dm3)*dm2*dm3 + cos2*(dm3-dm1)*dm3*dm1 + cos3*(dm1-dm2)*dm1*dm2;
147 Float_t denom = (dm2-dm3)*(dm3-dm1)*(dm1-dm2);
149 return (denom != 0.0) ? (-
a*dm*dm+
b*dm-
c)/denom : 0.0;
A TGraph is an object made of two arrays X and Y with npoints each.
Quadratic interpolation of TGraph.
TSpline2(const TString &title, TGraph *theGraph)
constructor from TGraph TSpline is a TNamed object
virtual void BuildCoeff(void)
no coefficients to precompute
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)