9#include <top/dataobjects/TOPRawDigit.h>
11#include <framework/logging/Logger.h>
40 if (i0 >= size) i0 = size - 1;
42 if (i1 >= size) i1 = size - 1;
43 if (i0 == i1)
return false;
46 if (diff < 0) diff += storageDepth;
47 if (diff != 1)
return true;
57 for (
unsigned i = 1; i < std::min(last, size); i++) {
59 if (diff < 0) diff += storageDepth;
60 if (diff != 1)
return false;
73 for (
unsigned i = 1; i < std::min(last, size); i++) {
75 if (diff < 0) diff += storageDepth;
76 if (diff != 1) missing += diff - 1;
77 if (diff == 0) B2ERROR(
"TOPRawDigit: two consecutive windows with the same number");
88 double a = 1.0 / (2.0 * dy);
89 double b = (ym - y2) / (dy * dy);
90 double c = (ym - y1) / (dy * dy);
92 return sqrt(a * a + b * b + c * c);
@ c_WindowSize
number of samples per window
std::vector< unsigned short > m_windows
storage windows of waveform segments
unsigned getSampleFall() const
Returns sample number at falling edge just before 50% CFD crossing.
unsigned short m_dSampleFall
same for falling edge, rel.
unsigned getSampleRise() const
Returns sample number at leading edge just before 50% CFD crossing.
short m_VPeak
ADC value at m_sampleRise + m_dSamplePeak.
unsigned short m_sampleRise
sample number just before 50% CFD crossing
double sqrt(double a)
sqrt for double
double correctTime(double time, unsigned short storageDepth=508) const
Corrects time after window discontinuity by adding missing samples.
bool isAtWindowDiscontinuity(unsigned short storageDepth=508) const
Checks if feature extraction points are at window discontinuity (e.g.
double timeErrorCoefficient(double y1, double y2) const
Calculate the coefficient of time error.
bool isPedestalJump() const
Checks if feature extraction finds a pedestal jump.
bool areWindowsInOrder(unsigned short storageDepth=508) const
Checks if storage windows come in the consecutive order before the last sample (no gaps before the la...
Abstract base class for different kinds of events.