CMS 3D CMS Logo

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

float deriv (float x) const
 
float eval (float x) const
 
float integral (float x) const
 

Public Attributes

float area
 
float coeffs [4]
 

Detailed Description

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

Definition at line 56 of file Spline.h.

Member Function Documentation

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

Definition at line 34 of file Spline.cc.

References coeffs, ztail::d, and createJobs::tmp.

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

34  {
35  float tmp;
36  float d = 0.0;
37  d += coeffs[1];
38  tmp = x;
39  d += coeffs[2] * tmp * 2.0;
40  tmp *= x;
41  d += coeffs[3] * tmp * 3.0;
42  return d;
43  }
d
Definition: ztail.py:151
tmp
align.sh
Definition: createJobs.py:716
float PhysicsTools::Spline::Segment::eval ( float  x) const

Definition at line 21 of file Spline.cc.

References coeffs, and createJobs::tmp.

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

21  {
22  float tmp;
23  float y = 0.0;
24  y += coeffs[0];
25  tmp = x;
26  y += coeffs[1] * tmp;
27  tmp *= x;
28  y += coeffs[2] * tmp;
29  tmp *= x;
30  y += coeffs[3] * tmp;
31  return y;
32  }
tmp
align.sh
Definition: createJobs.py:716
float PhysicsTools::Spline::Segment::integral ( float  x) const

Definition at line 45 of file Spline.cc.

References area, coeffs, and createJobs::tmp.

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

45  {
46  float tmp = x;
47  float area = this->area;
48  area += coeffs[0] * tmp;
49  tmp *= x;
50  area += coeffs[1] * tmp * (1.0 / 2.0);
51  tmp *= x;
52  area += coeffs[2] * tmp * (1.0 / 3.0);
53  tmp *= x;
54  area += coeffs[3] * tmp * (1.0 / 4.0);
55  return area;
56  }
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

float PhysicsTools::Spline::Segment::area

Definition at line 58 of file Spline.h.

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

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

Definition at line 57 of file Spline.h.

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