Go to the documentation of this file.00001 #ifndef PhysicsTools_MVAComputer_Spline_h
00002 #define PhysicsTools_MVAComputer_Spline_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 namespace PhysicsTools {
00016
00026 class Spline {
00027 public:
00028 Spline();
00029 Spline(const Spline &orig);
00030
00032 Spline(unsigned int n, const double *vals);
00033 ~Spline();
00034
00035 Spline &operator = (const Spline &orig);
00036
00038 void set(unsigned int n, const double *vals);
00039
00041 double eval(double x) const;
00042
00044 double deriv(double x) const;
00045
00047 double integral(double x) const;
00048
00050 double getArea() const { return area; }
00051
00053 inline unsigned int numberOfEntries() const { return n + 1; }
00054
00055 private:
00057 struct Segment {
00058 double coeffs[4];
00059 double area;
00060
00061 double eval(double x) const;
00062 double deriv(double x) const;
00063 double integral(double x) const;
00064 };
00065
00066 unsigned int n;
00067 Segment *segments;
00068 double area;
00069 };
00070
00071 }
00072
00073 #endif // PhysicsTools_MVAComputer_Spline_h