Describes the waveform from a single photoelectron. More...
#include <SampledWaveformFunction.h>
Classes | |
struct | WaveformSpecs_t |
Specifies the waveform shape and features. More... | |
Public Types | |
using | ADCcount = typename Base_t::ADCcount |
Type for ADC counts (floating point). More... | |
using | Time = typename Base_t::Time |
Type of time being used. More... | |
Public Types inherited from icarus::opdet::PhotoelectronPulseFunction< T > | |
using | ADCcount = util::quantities::counts_f |
Type for ADC counts (floating point). More... | |
using | Time = T |
Type of time being used. More... | |
Public Member Functions | |
SampledWaveformFunction (WaveformSpecs_t specs, Time peakTime, float gain) | |
Constructor: initializes from an hard-coded shape. More... | |
Parameter accessors. | |
float | gain () const |
Returns the gain the waveform is representing. More... | |
Public Member Functions inherited from icarus::opdet::PhotoelectronPulseFunction< T > | |
virtual | ~PhotoelectronPulseFunction ()=default |
ADCcount | evaluateAt (Time time) const |
Evaluates the pulse at the given time. More... | |
ADCcount | operator() (Time time) const |
Alias of evaluateAt() . More... | |
Time | peakTime () const |
Returns the time at which the first peak is found. More... | |
ADCcount | peakAmplitude () const |
Returns the amplitude of the first peak in ADC counts. More... | |
ADCcount | baseline () const |
Returns the baseline of the pulse in ADC counts. More... | |
int | polarity () const |
Returns the polarity of the pulse (+1 : positive, or -1 : negative). More... | |
void | dump (std::ostream &out, std::string const &indent, std::string const &firstIndent) const |
Prints on stream the parameters of this shape. More... | |
void | dump (std::ostream &&out, std::string const &indent="") const |
std::string | toString (std::string const &indent, std::string const &firstIndent) const |
Returns the parameters of this shape as a descriptive string. More... | |
std::string | toString (std::string const &indent="") const |
Private Types | |
using | Base_t = icarus::opdet::PhotoelectronPulseFunction< T > |
Private Member Functions | |
Time | sampleDuration () const |
The duration of each sample. More... | |
virtual ADCcount | doEvaluateAt (Time time) const override |
Evaluates the pulse at the given time. More... | |
virtual Time | doPeakTime () const override |
Returns the time at which the first peak is found. More... | |
virtual ADCcount | doPeakAmplitude () const override |
Returns the amplitude of the first peak in ADC. More... | |
virtual void | doDump (std::ostream &out, std::string const &indent, std::string const &firstIndent) const override |
Prints on stream the parameters of this shape. More... | |
bool | hasSample (std::ptrdiff_t index) const |
Returns whether a sample with the specified index is within the range. More... | |
ADCcount | integral () const |
Returns the integral of the waveform. More... | |
std::vector< ADCcount > | buildSamples (float targetGain) const |
Transforms the input waveform. More... | |
Static Private Member Functions | |
static std::size_t | findPeak (std::vector< ADCcount > const &samples) |
Returns the index of the sample under the peak of the waveform. More... | |
Private Attributes | |
WaveformSpecs_t const | fSource |
Waveform information. More... | |
std::vector< ADCcount > const | fSamples |
All samples. More... | |
float const | fGain |
The gain this waveform represents. More... | |
std::size_t const | fPeakSample |
The sample with the absolute peak. More... | |
Time const | fRefTime |
The time of the start of sample #0. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icarus::opdet::PhotoelectronPulseFunction< T > | |
virtual ADCcount | doEvaluateAt (Time time) const =0 |
Implementation of the function evaluation at time . More... | |
virtual ADCcount | doBaseline () const |
Returns the baseline of the pulse. More... | |
virtual int | doPolarity () const |
Returns the polarity of the pulse (+1 or -1). More... | |
Describes the waveform from a single photoelectron.
T | type of time unit to be used |
This functor (class behaving like a function) describes the shape of the response to a single photoelectron in a non-analytical form from a sequence of samples.
The peak time is assigned to the sample with the largest value.
See more details in the constructor.
Definition at line 34 of file SampledWaveformFunction.h.
using icarus::opdet::SampledWaveformFunction< T >::ADCcount = typename Base_t::ADCcount |
Type for ADC counts (floating point).
Definition at line 58 of file SampledWaveformFunction.h.
|
private |
Definition at line 54 of file SampledWaveformFunction.h.
using icarus::opdet::SampledWaveformFunction< T >::Time = typename Base_t::Time |
Type of time being used.
Definition at line 60 of file SampledWaveformFunction.h.
icarus::opdet::SampledWaveformFunction< T >::SampledWaveformFunction | ( | WaveformSpecs_t | specs, |
Time | peakTime, | ||
float | gain | ||
) |
Constructor: initializes from an hard-coded shape.
waveformSpecs | all information on the single photoelectron response |
peakTime | time to assign to the peak |
gain | the gain of the optical detector |
The shape described in waveformSpecs is shifted in time so that evaluation at peakTime
(evaluateAt(peakTime)
) returns the peak amplitude; more precisely, peakTime
is set to match the start of the largest sample.
The gain
is rescaled starting from the one in the waveform specifications.
The polarity of the waveform is deduced by the value at peak.
Definition at line 177 of file SampledWaveformFunction.h.
|
private |
Transforms the input waveform.
waveform | input waveform (in millivolt and for a known gain) |
targetGain | the desired gain |
The returned waveform has the same time domain as the input one, but is expressed in ADC instead of voltage (conversion is perfectly linear, 2 V across 14 bits), and rescaled to meet the target gain.
Definition at line 231 of file SampledWaveformFunction.h.
|
overrideprivatevirtual |
Prints on stream the parameters of this shape.
out | the stream to write into |
indent | indentation string, prepended to all lines except first |
indentFirst | indentation string prepended to the first line |
Reimplemented from icarus::opdet::PhotoelectronPulseFunction< T >.
Definition at line 199 of file SampledWaveformFunction.h.
|
overrideprivatevirtual |
Evaluates the pulse at the given time.
time | time to evaluate the shape at |
The scale of the time is defined by the peak time passed at construction.
Definition at line 188 of file SampledWaveformFunction.h.
|
inlineoverrideprivatevirtual |
Returns the amplitude of the first peak in ADC.
Reimplemented from icarus::opdet::PhotoelectronPulseFunction< T >.
Definition at line 129 of file SampledWaveformFunction.h.
|
inlineoverrideprivatevirtual |
Returns the time at which the first peak is found.
Implements icarus::opdet::PhotoelectronPulseFunction< T >.
Definition at line 125 of file SampledWaveformFunction.h.
|
staticprivate |
Returns the index of the sample under the peak of the waveform.
Definition at line 272 of file SampledWaveformFunction.h.
|
inline |
Returns the gain the waveform is representing.
Definition at line 95 of file SampledWaveformFunction.h.
|
inlineprivate |
Returns whether a sample with the specified index is within the range.
Definition at line 147 of file SampledWaveformFunction.h.
|
private |
Returns the integral of the waveform.
Definition at line 224 of file SampledWaveformFunction.h.
|
inlineprivate |
The duration of each sample.
Definition at line 112 of file SampledWaveformFunction.h.
|
private |
The gain this waveform represents.
Definition at line 105 of file SampledWaveformFunction.h.
|
private |
The sample with the absolute peak.
Definition at line 107 of file SampledWaveformFunction.h.
|
private |
The time of the start of sample #0.
Definition at line 109 of file SampledWaveformFunction.h.
|
private |
All samples.
Definition at line 103 of file SampledWaveformFunction.h.
|
private |
Waveform information.
Definition at line 101 of file SampledWaveformFunction.h.