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 56 of file Spline.h.

Member Function Documentation

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

Definition at line 32 of file Spline.cc.

References tmp, and x.

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

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

Definition at line 21 of file Spline.cc.

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

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

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

Definition at line 42 of file Spline.cc.

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

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

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

Member Data Documentation

double PhysicsTools::Spline::Segment::area

Definition at line 58 of file Spline.h.

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

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

Definition at line 57 of file Spline.h.

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