A numeric analysis tool class for interpolating 1-D functions. More...
#include <Spline.h>
Public Member Functions | |
Spline () | |
Spline (string filename, string xtag="", string ytag="", bool is_xml=false) | |
Spline (TNtupleD *ntuple, string xy, string cut="") | |
Spline (TTree *tree, string xy, string cut="") | |
Spline (TSQLServer *db, string query) | |
Spline (int nentries, double x[], double y[]) | |
Spline (int nentries, float x[], float y[]) | |
Spline (const Spline &spline) | |
Spline (const TSpline3 &spline, int nknots) | |
virtual | ~Spline () |
bool | LoadFromXmlFile (string filename, string xtag, string ytag) |
bool | LoadFromAsciiFile (string filename) |
bool | LoadFromNtuple (TNtupleD *nt, string xy, string cut="") |
bool | LoadFromTree (TTree *tr, string xy, string cut="") |
bool | LoadFromDBase (TSQLServer *db, string query) |
bool | LoadFromTSpline3 (const TSpline3 &spline, int nknots) |
int | NKnots (void) const |
void | GetKnot (int iknot, double &x, double &y) const |
double | GetKnotX (int iknot) const |
double | GetKnotY (int iknot) const |
double | XMin (void) const |
double | XMax (void) const |
double | YMax (void) const |
double | Evaluate (double x) const |
bool | IsWithinValidRange (double x) const |
void | SetName (string name) |
string | Name (void) const |
void | YCanBeNegative (bool tf) |
void | SaveAsXml (string filename, string xtag, string ytag, string name="") const |
void | SaveAsXml (ofstream &str, string xtag, string ytag, string name="") const |
void | SaveAsText (string filename, string format="%10.6f\t%10.6f") const |
void | SaveAsROOT (string filename, string name="", bool recreate=false) const |
TGraph * | GetAsTGraph (int np=500, bool xscaling=false, bool inlog=false, double fx=1., double fy=1.) const |
TSpline3 * | GetAsTSpline (void) const |
void | FindClosestKnot (double x, double &xknot, double &yknot, Option_t *opt="-+") const |
bool | ClosestKnotValueIsZero (double x, Option_t *opt="-+") const |
void | Add (const Spline &spl, double c=1) |
void | Multiply (const Spline &spl, double c=1) |
void | Divide (const Spline &spl, double c=1) |
void | Add (double a) |
void | Multiply (double a) |
void | Divide (double a) |
void | Print (ostream &stream) const |
Private Member Functions | |
void | InitSpline (void) |
void | ResetSpline (void) |
void | BuildSpline (int nentries, double x[], double y[]) |
Private Attributes | |
string | fName |
int | fNKnots |
double | fXMin |
double | fXMax |
double | fYMax |
TSpline3 * | fInterpolator |
bool | fYCanBeNegative |
Friends | |
ostream & | operator<< (ostream &stream, const Spline &spl) |
A numeric analysis tool class for interpolating 1-D functions.
Uses ROOT's TSpline3 for the actual interpolation and can retrieve function (x,y(x)) pairs from an XML file, a flat ascii file, a TNtuple, a TTree or an SQL database.
May 04, 2004
Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org
Spline::Spline | ( | ) |
Definition at line 52 of file Spline.cxx.
Definition at line 57 of file Spline.cxx.
Definition at line 73 of file Spline.cxx.
Definition at line 82 of file Spline.cxx.
Spline::Spline | ( | TSQLServer * | db, |
string | query | ||
) |
Definition at line 91 of file Spline.cxx.
Spline::Spline | ( | int | nentries, |
double | x[], | ||
double | y[] | ||
) |
Definition at line 100 of file Spline.cxx.
Spline::Spline | ( | int | nentries, |
float | x[], | ||
float | y[] | ||
) |
Definition at line 110 of file Spline.cxx.
Spline::Spline | ( | const Spline & | spline | ) |
Definition at line 131 of file Spline.cxx.
Spline::Spline | ( | const TSpline3 & | spline, |
int | nknots | ||
) |
Definition at line 139 of file Spline.cxx.
|
virtual |
Definition at line 148 of file Spline.cxx.
void Spline::Add | ( | const Spline & | spl, |
double | c = 1 |
||
) |
Definition at line 580 of file Spline.cxx.
void Spline::Add | ( | double | a | ) |
Definition at line 663 of file Spline.cxx.
|
private |
Definition at line 738 of file Spline.cxx.
bool Spline::ClosestKnotValueIsZero | ( | double | x, |
Option_t * | opt = "-+" |
||
) | const |
Definition at line 554 of file Spline.cxx.
void Spline::Divide | ( | const Spline & | spl, |
double | c = 1 |
||
) |
Definition at line 630 of file Spline.cxx.
void Spline::Divide | ( | double | a | ) |
Definition at line 695 of file Spline.cxx.
double Spline::Evaluate | ( | double | x | ) | const |
Definition at line 361 of file Spline.cxx.
void Spline::FindClosestKnot | ( | double | x, |
double & | xknot, | ||
double & | yknot, | ||
Option_t * | opt = "-+" |
||
) | const |
Definition at line 527 of file Spline.cxx.
TGraph * Spline::GetAsTGraph | ( | int | np = 500 , |
bool | xscaling = false , |
||
bool | inlog = false , |
||
double | fx = 1. , |
||
double | fy = 1. |
||
) | const |
Definition at line 489 of file Spline.cxx.
void Spline::GetKnot | ( | int | iknot, |
double & | x, | ||
double & | y | ||
) | const |
Definition at line 324 of file Spline.cxx.
double Spline::GetKnotX | ( | int | iknot | ) | const |
Definition at line 333 of file Spline.cxx.
double Spline::GetKnotY | ( | int | iknot | ) | const |
Definition at line 344 of file Spline.cxx.
|
private |
Definition at line 716 of file Spline.cxx.
bool Spline::IsWithinValidRange | ( | double | x | ) | const |
Definition at line 355 of file Spline.cxx.
Definition at line 240 of file Spline.cxx.
Definition at line 297 of file Spline.cxx.
Definition at line 251 of file Spline.cxx.
Definition at line 259 of file Spline.cxx.
bool Spline::LoadFromTSpline3 | ( | const TSpline3 & | spline, |
int | nknots | ||
) |
Definition at line 303 of file Spline.cxx.
Definition at line 153 of file Spline.cxx.
void Spline::Multiply | ( | const Spline & | spl, |
double | c = 1 |
||
) |
Definition at line 605 of file Spline.cxx.
void Spline::Multiply | ( | double | a | ) |
Definition at line 679 of file Spline.cxx.
void Spline::Print | ( | ostream & | stream | ) | const |
Definition at line 562 of file Spline.cxx.
|
private |
Definition at line 732 of file Spline.cxx.
Definition at line 478 of file Spline.cxx.
Definition at line 457 of file Spline.cxx.
Definition at line 412 of file Spline.cxx.
Definition at line 428 of file Spline.cxx.
|
friend |