CMS 3D CMS Logo

Public Member Functions | Public Attributes

PhysicsTools::Spline::Segment Struct Reference

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

List of all members.

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 x.

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

{
        double tmp;
        double d = 0.0;
        d += coeffs[1];                 tmp = x;
        d += coeffs[2] * tmp * 2.0;     tmp *= x;
        d += coeffs[3] * tmp * 3.0;
        return d;
}
double PhysicsTools::Spline::Segment::eval ( double  x) const

Definition at line 22 of file Spline.cc.

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

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

{
        double tmp;
        double y = 0.0;
        y += coeffs[0];         tmp = x;
        y += coeffs[1] * tmp;   tmp *= x;
        y += coeffs[2] * tmp;   tmp *= x;
        y += coeffs[3] * tmp;
        return y;
}
double PhysicsTools::Spline::Segment::integral ( double  x) const

Definition at line 43 of file Spline.cc.

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

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

{
        double tmp = x;
        double area = this->area;
        area += coeffs[0] * tmp;               tmp *= x;
        area += coeffs[1] * tmp * (1.0 / 2.0); tmp *= x;
        area += coeffs[2] * tmp * (1.0 / 3.0); tmp *= x;
        area += coeffs[3] * tmp * (1.0 / 4.0);
        return area;
}

Member Data Documentation

Definition at line 59 of file Spline.h.

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

Definition at line 58 of file Spline.h.

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