|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
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. | |
Least-squares polynomial fit (Eigen QR) over the last n (time, value) points, used to estimate encoder values at event times.
|
inline |
Keep n points and fit a polynomial of order o; asserts that n is at least o + 1.
|
inline |
Does nothing; empty body.
| 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.
|
inline |
Set the write index to 0 and zero the stored times; the stored values are kept.
| 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.