Classes | Public Types | Public Member Functions | Private Attributes | List of all members
ParabolicInterpolator Class Reference

#include <ParabolicInterpolator.h>

Classes

struct  Point
 

Public Types

using Name = std::string
 

Public Member Functions

 ParabolicInterpolator (const Point xy1, const Point &xy2, double c)
 
const Pointxy1 () const
 
const Pointxy2 () const
 
double a () const
 
double b () const
 
double c () const
 
TF1 * getTF1 (Name="parint", double x1=0.0, double x2=0.0) const
 

Private Attributes

Point m_xy1
 
Point m_xy2
 
double m_a
 
double m_b
 
double m_c
 

Detailed Description

Definition at line 18 of file ParabolicInterpolator.h.

Member Typedef Documentation

Definition at line 29 of file ParabolicInterpolator.h.

Constructor & Destructor Documentation

ParabolicInterpolator::ParabolicInterpolator ( const Point  xy1,
const Point xy2,
double  c 
)

Definition at line 9 of file ParabolicInterpolator.cxx.

10 : m_xy1(a_xy1), m_xy2(a_xy2), m_a(0.0), m_b(0.0), m_c(c) {
11  double dx = xy2().x - xy1().x;
12  if ( fabs(dx) < 1.e-20 ) return;
13  m_a = xy2().y/dx;
14  m_b = xy1().y/dx;
15 }
const Point & xy1() const
const double e
const Point & xy2() const

Member Function Documentation

double ParabolicInterpolator::a ( ) const
inline

Definition at line 37 of file ParabolicInterpolator.h.

37 { return m_a; }
double ParabolicInterpolator::b ( ) const
inline

Definition at line 38 of file ParabolicInterpolator.h.

38 { return m_b; }
double ParabolicInterpolator::c ( ) const
inline

Definition at line 39 of file ParabolicInterpolator.h.

39 { return m_c; }
TF1 * ParabolicInterpolator::getTF1 ( Name  fnam = "parint",
double  x1 = 0.0,
double  x2 = 0.0 
) const

Definition at line 19 of file ParabolicInterpolator.cxx.

19  {
20  const Name sfun = "[2]*(x-[0]) + [3]*(x-[1]) + [4]*(x-[0])*(x-[1])";
21  TF1* pf = new TF1(fnam.c_str(), sfun.c_str(), x1, x2);
22  pf->SetParName(0, "x1");
23  pf->SetParName(1, "x2");
24  pf->SetParName(2, "a");
25  pf->SetParName(3, "b");
26  pf->SetParName(4, "c");
27  pf->SetParameter(0, xy1().x);
28  pf->SetParameter(1, xy2().x);
29  pf->SetParameter(2, a());
30  pf->SetParameter(3, b());
31  pf->SetParameter(4, c());
32  return pf;
33 }
ChannelGroupService::Name Name
const Point & xy1() const
const Point & xy2() const
list x
Definition: train.py:276
const Point& ParabolicInterpolator::xy1 ( ) const
inline

Definition at line 35 of file ParabolicInterpolator.h.

35 { return m_xy1; }
const Point& ParabolicInterpolator::xy2 ( ) const
inline

Definition at line 36 of file ParabolicInterpolator.h.

36 { return m_xy2; }

Member Data Documentation

double ParabolicInterpolator::m_a
private

Definition at line 49 of file ParabolicInterpolator.h.

double ParabolicInterpolator::m_b
private

Definition at line 50 of file ParabolicInterpolator.h.

double ParabolicInterpolator::m_c
private

Definition at line 51 of file ParabolicInterpolator.h.

Point ParabolicInterpolator::m_xy1
private

Definition at line 47 of file ParabolicInterpolator.h.

Point ParabolicInterpolator::m_xy2
private

Definition at line 48 of file ParabolicInterpolator.h.


The documentation for this class was generated from the following files: