A simple class for cubic splines. More...
#include <Spline.h>
Classes | |
struct | Segment |
internal class describing a "segment" (between two x points) More... | |
Public Member Functions | |
double | deriv (double x) const |
compute the derivate at x coordinate x More... | |
double | eval (double x) const |
compute y coordinate at x coordinate x More... | |
double | getArea () const |
total area (integral between 0 and 1) under curve More... | |
double | integral (double x) const |
compute integral under curve between 0 and x More... | |
unsigned int | numberOfEntries () const |
return the number of entries More... | |
Spline & | operator= (const Spline &orig) |
void | set (unsigned int n, const double *vals) |
initialize spline from n y coordinates in array vals More... | |
Spline () | |
Spline (const Spline &orig) | |
Spline (unsigned int n, const double *vals) | |
construct spline from n y coordinates in array vals More... | |
~Spline () | |
Private Attributes | |
double | area |
unsigned int | n |
Segment * | segments |
A simple class for cubic splines.
This class implements cubic splines for n equidistant points in x between 0 and 1. It is constructed from an array of n y coordinates and can compute the interpolated y coordinate for a given x.
PhysicsTools::Spline::Spline | ( | unsigned int | n, |
const double * | vals | ||
) |
construct spline from n y coordinates in array vals
Definition at line 62 of file Spline.cc.
References set().
double PhysicsTools::Spline::deriv | ( | double | x | ) | const |
compute the derivate at x coordinate x
Definition at line 144 of file Spline.cc.
References PhysicsTools::Spline::Segment::deriv(), n, segments, and pileupDistInMC::total.
double PhysicsTools::Spline::eval | ( | double | x | ) | const |
compute y coordinate at x coordinate x
Definition at line 131 of file Spline.cc.
References PhysicsTools::Spline::Segment::eval(), n, segments, and pileupDistInMC::total.
|
inline |
double PhysicsTools::Spline::integral | ( | double | x | ) | const |
compute integral under curve between 0 and x
Definition at line 159 of file Spline.cc.
References area, alignCSCRings::e, n, segments, and pileupDistInMC::total.
|
inline |
void PhysicsTools::Spline::set | ( | unsigned int | n, |
const double * | vals | ||
) |
initialize spline from n y coordinates in array vals
Definition at line 66 of file Spline.cc.
References PhysicsTools::Spline::Segment::area, area, PhysicsTools::Spline::Segment::coeffs, i, PhysicsTools::Spline::Segment::integral(), n, and segments.
Referenced by betterConfigParser.BetterConfigParser::getGeneral(), and Spline().
|
private |
Definition at line 67 of file Spline.h.
Referenced by getArea(), integral(), PhysicsTools::Spline::Segment::integral(), operator=(), and set().
|
private |
Definition at line 65 of file Spline.h.
Referenced by deriv(), eval(), integral(), operator=(), set(), and Spline().
|
private |
Definition at line 66 of file Spline.h.
Referenced by deriv(), eval(), integral(), operator=(), set(), Spline(), and ~Spline().