All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
icarus::opdet::PhotoelectronPulseFunction< T > Class Template Referenceabstract

Interface for a function describing a pulse from a photoelectron. More...

#include <PhotoelectronPulseFunction.h>

Inheritance diagram for icarus::opdet::PhotoelectronPulseFunction< T >:
icarus::opdet::AsymExpPulseFunction< T > icarus::opdet::AsymGaussPulseFunction< T > icarus::opdet::CustomPulseFunction< T > icarus::opdet::SampledWaveformFunction< T >

Public Types

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

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
 

Protected Member Functions

Mandatory customization
virtual ADCcount doEvaluateAt (Time time) const =0
 Implementation of the function evaluation at time. More...
 
virtual Time doPeakTime () const =0
 Returns the time at which the first peak is found. More...
 
Optional customization
virtual ADCcount doPeakAmplitude () const
 Returns the amplitude of the first peak in ADC counts. 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...
 
virtual void doDump (std::ostream &out, std::string const &indent, std::string const &firstIndent) const
 Prints into the stream the parameters of this shape. More...
 

Detailed Description

template<typename T>
class icarus::opdet::PhotoelectronPulseFunction< T >

Interface for a function describing a pulse from a photoelectron.

Template Parameters
Ttype used to represent time

A function implementing this interface expresses a sampled value in ADC counts (ADCcount type) as function of time (Time type).

The time types in LArSoft quantities library can be used as Time (T): e.g., PhotoelectronPulseFunction<util::quantities::nanosecond>.

Definition at line 26 of file PhotoelectronPulseFunction.h.

Member Typedef Documentation

Type for ADC counts (floating point).

Definition at line 49 of file PhotoelectronPulseFunction.h.

template<typename T >
using icarus::opdet::PhotoelectronPulseFunction< T >::Time = T

Type of time being used.

Definition at line 51 of file PhotoelectronPulseFunction.h.

Constructor & Destructor Documentation

template<typename T >
virtual icarus::opdet::PhotoelectronPulseFunction< T >::~PhotoelectronPulseFunction ( )
virtualdefault

Member Function Documentation

template<typename T >
ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::baseline ( ) const
inline

Returns the baseline of the pulse in ADC counts.

Definition at line 73 of file PhotoelectronPulseFunction.h.

73 { return doBaseline(); }
virtual ADCcount doBaseline() const
Returns the baseline of the pulse.
template<typename T >
virtual ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::doBaseline ( ) const
inlineprotectedvirtual

Returns the baseline of the pulse.

Definition at line 134 of file PhotoelectronPulseFunction.h.

134 { return ADCcount{ 0 }; }
util::quantities::counts_f ADCcount
Type for ADC counts (floating point).
template<typename T >
virtual void icarus::opdet::PhotoelectronPulseFunction< T >::doDump ( std::ostream &  out,
std::string const &  indent,
std::string const &  firstIndent 
) const
inlineprotectedvirtual

Prints into the stream the parameters of this shape.

Parameters
outthe C++ output stream to write into
indentindentation string, prepended to all lines except first
indentFirstindentation string prepended to the first line

Reimplemented in icarus::opdet::CustomPulseFunction< T >, icarus::opdet::AsymExpPulseFunction< T >, icarus::opdet::SampledWaveformFunction< T >, and icarus::opdet::AsymGaussPulseFunction< T >.

Definition at line 147 of file PhotoelectronPulseFunction.h.

150  {}
template<typename T >
virtual ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::doEvaluateAt ( Time  time) const
protectedpure virtual

Implementation of the function evaluation at time.

template<typename T >
virtual ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::doPeakAmplitude ( ) const
inlineprotectedvirtual

Returns the amplitude of the first peak in ADC counts.

Reimplemented in icarus::opdet::CustomPulseFunction< T >, icarus::opdet::AsymExpPulseFunction< T >, icarus::opdet::SampledWaveformFunction< T >, and icarus::opdet::AsymGaussPulseFunction< T >.

Definition at line 131 of file PhotoelectronPulseFunction.h.

131 { return evaluateAt(peakTime()); }
Time peakTime() const
Returns the time at which the first peak is found.
ADCcount evaluateAt(Time time) const
Evaluates the pulse at the given time.
template<typename T >
virtual Time icarus::opdet::PhotoelectronPulseFunction< T >::doPeakTime ( ) const
protectedpure virtual
template<typename T >
virtual int icarus::opdet::PhotoelectronPulseFunction< T >::doPolarity ( ) const
inlineprotectedvirtual

Returns the polarity of the pulse (+1 or -1).

Definition at line 137 of file PhotoelectronPulseFunction.h.

138  { return ((peakAmplitude() - baseline()) >= ADCcount{ 0 })? +1: -1; }
ADCcount baseline() const
Returns the baseline of the pulse in ADC counts.
ADCcount peakAmplitude() const
Returns the amplitude of the first peak in ADC counts.
util::quantities::counts_f ADCcount
Type for ADC counts (floating point).
template<typename T >
void icarus::opdet::PhotoelectronPulseFunction< T >::dump ( std::ostream &  out,
std::string const &  indent,
std::string const &  firstIndent 
) const
inline

Prints on stream the parameters of this shape.

Parameters
outthe stream to write into
indentindentation string, prepended to all lines except first
indentFirstindentation string prepended to the first line

Definition at line 86 of file PhotoelectronPulseFunction.h.

90  { doDump(out, indent, firstIndent); }
virtual void doDump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const
Prints into the stream the parameters of this shape.
template<typename T >
void icarus::opdet::PhotoelectronPulseFunction< T >::dump ( std::ostream &&  out,
std::string const &  indent = "" 
) const
inline

Definition at line 91 of file PhotoelectronPulseFunction.h.

92  { dump(out, indent, indent); }
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const
Prints on stream the parameters of this shape.
template<typename T >
ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::evaluateAt ( Time  time) const
inline

Evaluates the pulse at the given time.

Parameters
timetime to evaluate the shape at
Returns
value of the pulse at the specified time

Definition at line 61 of file PhotoelectronPulseFunction.h.

61 { return doEvaluateAt(time); }
virtual ADCcount doEvaluateAt(Time time) const =0
Implementation of the function evaluation at time.
template<typename T >
ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::operator() ( Time  time) const
inline

Alias of evaluateAt().

Definition at line 64 of file PhotoelectronPulseFunction.h.

64 { return evaluateAt(time); }
ADCcount evaluateAt(Time time) const
Evaluates the pulse at the given time.
template<typename T >
ADCcount icarus::opdet::PhotoelectronPulseFunction< T >::peakAmplitude ( ) const
inline

Returns the amplitude of the first peak in ADC counts.

Definition at line 70 of file PhotoelectronPulseFunction.h.

70 { return doPeakAmplitude(); }
virtual ADCcount doPeakAmplitude() const
Returns the amplitude of the first peak in ADC counts.
template<typename T >
Time icarus::opdet::PhotoelectronPulseFunction< T >::peakTime ( ) const
inline

Returns the time at which the first peak is found.

Definition at line 67 of file PhotoelectronPulseFunction.h.

67 { return doPeakTime(); }
virtual Time doPeakTime() const =0
Returns the time at which the first peak is found.
template<typename T >
int icarus::opdet::PhotoelectronPulseFunction< T >::polarity ( ) const
inline

Returns the polarity of the pulse (+1: positive, or -1: negative).

Definition at line 76 of file PhotoelectronPulseFunction.h.

76 { return doPolarity(); }
virtual int doPolarity() const
Returns the polarity of the pulse (+1 or -1).
template<typename T >
std::string icarus::opdet::PhotoelectronPulseFunction< T >::toString ( std::string const &  indent,
std::string const &  firstIndent 
) const

Returns the parameters of this shape as a descriptive string.

Parameters
indentindentation string, prepended to all lines except first
indentFirstindentation string prepended to the first line
Returns
a string with the parameters of this shape

Definition at line 164 of file PhotoelectronPulseFunction.h.

165 {
166  std::ostringstream sstr;
167  dump(sstr, indent, firstIndent);
168  return std::move(sstr).str();
169 } // icarus::opdet::PhotoelectronPulseFunction<>::toString()
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const
Prints on stream the parameters of this shape.
template<typename T >
std::string icarus::opdet::PhotoelectronPulseFunction< T >::toString ( std::string const &  indent = "") const
inline

Definition at line 105 of file PhotoelectronPulseFunction.h.

106  { return toString(indent, indent); }
std::string toString(std::string const &indent, std::string const &firstIndent) const
Returns the parameters of this shape as a descriptive string.

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