45:
fX(theGraph->GetX(), theGraph->GetX() + theGraph->GetN()),
46 fY(theGraph->GetY(), theGraph->GetY() + theGraph->GetN())
63 Int_t ibin = std::distance(std::lower_bound(
fX.rbegin(),
fX.rend(),
x, std::greater{}),
fX.rend()) - 1;
66 if (ibin < 0 ) ibin = 0;
67 if (ibin >=
N) ibin =
N - 1;
71 Warning(
"Eval",
"Graph has less than 3 points, returning value of the closest");
73 }
else if (ibin == 0) {
83 }
else if (ibin >= (
N - 2)) {
139 Float_t a = cos1*(dm2-dm3) + cos2*(dm3-dm1) + cos3*(dm1-dm2);
140 Float_t b = cos1*(dm2*dm2-dm3*dm3) + cos2*(dm3*dm3-dm1*dm1) + cos3*(dm1*dm1-dm2*dm2);
141 Float_t c = cos1*(dm2-dm3)*dm2*dm3 + cos2*(dm3-dm1)*dm3*dm1 + cos3*(dm1-dm2)*dm1*dm2;
143 Float_t denom = (dm2-dm3)*(dm3-dm1)*(dm1-dm2);
145 return (denom != 0.0) ? (-
a*dm*dm+
b*dm-
c)/denom : 0.0;
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
void GetKnot(Int_t i, Double_t &x, Double_t &y) const override
no knots
void BuildCoeff(void) override
no coefficients to precompute
Double_t Eval(Double_t x) const override
returns quadratically interpolated TGraph entry around x
std::vector< Double_t > fX
TSpline2(const TString &title, const TGraph *theGraph)
constructor from TGraph pointer (not owned by TSpline2) TSpline is a TNamed object
virtual ~TSpline2(void)
destructor
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...
std::vector< Double_t > fY
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).