CMS 3D CMS Logo

Spline.h

Go to the documentation of this file.
00001 #ifndef PhysicsTools_MVAComputer_Spline_h
00002 #define PhysicsTools_MVAComputer_Spline_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     MVAComputer
00006 // Class  :     Spline
00007 //
00008 
00009 //
00010 // Author:      Christophe Saout <christophe.saout@cern.ch>
00011 // Created:     Sat Apr 24 15:18 CEST 2007
00012 // $Id: Spline.h,v 1.4 2007/10/07 02:48:38 saout Exp $
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 integral(double x) const;
00045 
00047         double getArea() const { return area; }
00048 
00050         inline unsigned int numberOfEntries() const { return n + 1; }
00051 
00052     private:
00054         struct Segment {
00055                 double coeffs[4];
00056                 double area;
00057 
00058                 double eval(double x) const;
00059                 double integral(double x) const;
00060         };
00061 
00062         unsigned int    n;
00063         Segment         *segments;
00064         double          area;
00065 };
00066 
00067 } // namespace PhysicsTools
00068 
00069 #endif // PhysicsTools_MVAComputer_Spline_h

Generated on Tue Jun 9 17:41:20 2009 for CMSSW by  doxygen 1.5.4