CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
PhysicsTools::Spline::Segment Struct Reference

internal class describing a "segment" (between two x points) More...

Public Member Functions

double deriv (double x) const
 
double eval (double x) const
 
double integral (double x) const
 

Public Attributes

double area
 
double coeffs [4]
 

Detailed Description

internal class describing a "segment" (between two x points)

Definition at line 57 of file Spline.h.

Member Function Documentation

double PhysicsTools::Spline::Segment::deriv ( double  x) const

Definition at line 33 of file Spline.cc.

References tmp, and ExpressReco_HICollisions_FallBack::x.

Referenced by PhysicsTools::Spline::deriv().

34 {
35  double tmp;
36  double d = 0.0;
37  d += coeffs[1]; tmp = x;
38  d += coeffs[2] * tmp * 2.0; tmp *= x;
39  d += coeffs[3] * tmp * 3.0;
40  return d;
41 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double PhysicsTools::Spline::Segment::eval ( double  x) const

Definition at line 22 of file Spline.cc.

References coeffs, tmp, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

Referenced by PhysicsTools::Spline::eval().

23 {
24  double tmp;
25  double y = 0.0;
26  y += coeffs[0]; tmp = x;
27  y += coeffs[1] * tmp; tmp *= x;
28  y += coeffs[2] * tmp; tmp *= x;
29  y += coeffs[3] * tmp;
30  return y;
31 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double PhysicsTools::Spline::Segment::integral ( double  x) const

Definition at line 43 of file Spline.cc.

References PhysicsTools::Spline::area, tmp, and ExpressReco_HICollisions_FallBack::x.

Referenced by PhysicsTools::Spline::set().

44 {
45  double tmp = x;
46  double area = this->area;
47  area += coeffs[0] * tmp; tmp *= x;
48  area += coeffs[1] * tmp * (1.0 / 2.0); tmp *= x;
49  area += coeffs[2] * tmp * (1.0 / 3.0); tmp *= x;
50  area += coeffs[3] * tmp * (1.0 / 4.0);
51  return area;
52 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

double PhysicsTools::Spline::Segment::area

Definition at line 59 of file Spline.h.

Referenced by PhysicsTools::Spline::set().

double PhysicsTools::Spline::Segment::coeffs[4]

Definition at line 58 of file Spline.h.

Referenced by eval(), and PhysicsTools::Spline::set().