lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::Interpolator Class Reference

Least-squares polynomial fit (Eigen QR) over the last n (time, value) points, used to estimate encoder values at event times. More...

#include <UdpEncoder.hh>

Public Member Functions

 Interpolator (unsigned n, unsigned o)
 Keep n points and fit a polynomial of order o; asserts that n is at least o + 1.
 
 ~Interpolator ()
 Does nothing; empty body.
 
void reset ()
 Set the write index to 0 and zero the stored times; the stored values are kept.
 
void update (XtcData::TimeStamp t, unsigned v)
 Store (t, v) in the circular buffer and, once all n slots hold a time, refit the polynomial with times taken relative to the oldest point.
 
unsigned calculate (XtcData::TimeStamp t, XtcData::Damage &damage) const
 Evaluate the fitted polynomial at ts once all slots are filled; otherwise return the most recently stored value and add MissingData to damage.
 

Detailed Description

Least-squares polynomial fit (Eigen QR) over the last n (time, value) points, used to estimate encoder values at event times.

Constructor & Destructor Documentation

◆ Interpolator()

Drp::Interpolator::Interpolator ( unsigned  n,
unsigned  o 
)
inline

Keep n points and fit a polynomial of order o; asserts that n is at least o + 1.

◆ ~Interpolator()

Drp::Interpolator::~Interpolator ( )
inline

Does nothing; empty body.

Member Function Documentation

◆ calculate()

unsigned Drp::Interpolator::calculate ( XtcData::TimeStamp  t,
XtcData::Damage &  damage 
) const

Evaluate the fitted polynomial at ts once all slots are filled; otherwise return the most recently stored value and add MissingData to damage.

◆ reset()

void Drp::Interpolator::reset ( )
inline

Set the write index to 0 and zero the stored times; the stored values are kept.

◆ update()

void Drp::Interpolator::update ( XtcData::TimeStamp  t,
unsigned  v 
)

Store (t, v) in the circular buffer and, once all n slots hold a time, refit the polynomial with times taken relative to the oldest point.


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