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

Describes the waveform from a single photoelectron. More...

#include <AsymExpPulseFunction.h>

Inheritance diagram for icarus::opdet::AsymExpPulseFunction< T >:
icarus::opdet::PhotoelectronPulseFunction< T >

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

 AsymExpPulseFunction (ADCcount amplitude, Time peakTime, Time raiseTau, Time fallTau)
 Constructor: assigns the parameters of the shape. More...
 
Parameter accessors.
Time raiseTau () const
 
Time fallTau () const
 
ADCcount amplitude () const
 
- 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
 

Static Public Member Functions

static double Exponential (Time t, Time tau)
 Returns the value of an exponential: exp(-t/tau). More...
 
static double ExponentialDiff (Time t, Time raise, Time fall)
 Returns the value of an exponential: exp(-t/tau). More...
 

Private Types

using Base_t = icarus::opdet::PhotoelectronPulseFunction< T >
 

Private Member Functions

Time myPeakTime () const
 Returns the time of the peak. More...
 
ADCcount myAmplitude () const
 Returns the amplitude of the pulse from the baseline, including its sign. 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 counts. 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...
 

Static Private Member Functions

static Time expDiffPeak (Time raiseTau, Time fallTau)
 Returns the time value at which ExponentialDiff() is maximum. More...
 
template<typename V >
static V round (V value)
 

Private Attributes

ADCcount const fAmplitude
 Amplitude at peak (transition). More...
 
Time const fPeakTime
 Time of maximum signal. More...
 
Time const fRaiseTau
 Time constant of signal rise. More...
 
Time const fFallTau
 Time constant of signal fall. More...
 
Time const fRaiseTime
 Time when the signal starts rising above baseline. More...
 
ADCcount const fA
 Normalization factor in the functional form. 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...
 

Detailed Description

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

Describes the waveform from a single photoelectron.

Template Parameters
Timetype of time unit to be used

This functor (class behaving like a function) describes the shape of the response to a single photoelectron as an exponentially raising and then exponentially falling shape:

\[ A \left[ exp(-(t - t_{0})/\tau_{s}) - exp(-(t - t_{0})/\tau) \right] \]

with $ \tau_{s} $ the rise time and $ \tau $ the fall time; $ t_{0} $ is the start of the signal formation, i.e. the time at which the signal starts raising.

Note that $ t_{0} $ is not the peak time, and $ A $ is not the peak amplitude of the signal.

Definition at line 30 of file AsymExpPulseFunction.h.

Member Typedef Documentation

template<typename T >
using icarus::opdet::AsymExpPulseFunction< T >::ADCcount = typename Base_t::ADCcount

Type for ADC counts (floating point).

Definition at line 57 of file AsymExpPulseFunction.h.

Definition at line 53 of file AsymExpPulseFunction.h.

template<typename T >
using icarus::opdet::AsymExpPulseFunction< T >::Time = typename Base_t::Time

Type of time being used.

Definition at line 59 of file AsymExpPulseFunction.h.

Constructor & Destructor Documentation

template<typename T >
icarus::opdet::AsymExpPulseFunction< T >::AsymExpPulseFunction ( ADCcount  amplitude,
Time  peakTime,
Time  raiseTau,
Time  fallTau 
)

Constructor: assigns the parameters of the shape.

Parameters
amplitudethe maximum amplitudes of the shape (at transition)
peakTimethe time of the maximum amplitude of the shape
raiseTauthe raise time (exponential parameter) of the shape
fallTauthe decay time (exponential parameter) of the shape

The time parameters (peakTime, raiseTau and fallTau) must be measured in same unit. The peakTime defines the position of the shape with respect to time 0.

Note
The construction parameters are not the ones described by the functional form documented in the class, $ A \left[ exp(-(t - t_{0})/\tau_{s}) - exp(-(t - t_{0})/\tau) \right] $: the amplitude parameter is the actual maximum of the signal response, and peakTime is the actual time at which the signal peaks. These parameters are more easily read from a measured waveform.

Definition at line 165 of file AsymExpPulseFunction.h.

174  , fFallTau(fallTau)
177 {
178  // numerical sanity checks (for debugging only)
179  assert(std::isnormal(fA.value()));
180 } // icarus::opdet::AsymExpPulseFunction<>::AsymExpPulseFunction()
Time const fRaiseTime
Time when the signal starts rising above baseline.
Time const fPeakTime
Time of maximum signal.
Time peakTime() const
Returns the time at which the first peak is found.
ADCcount const fAmplitude
Amplitude at peak (transition).
static double ExponentialDiff(Time t, Time raise, Time fall)
Returns the value of an exponential: exp(-t/tau).
ADCcount const fA
Normalization factor in the functional form.
Time const fFallTau
Time constant of signal fall.
static Time expDiffPeak(Time raiseTau, Time fallTau)
Returns the time value at which ExponentialDiff() is maximum.
Time const fRaiseTau
Time constant of signal rise.

Member Function Documentation

template<typename T >
ADCcount icarus::opdet::AsymExpPulseFunction< T >::amplitude ( ) const
inline

Definition at line 94 of file AsymExpPulseFunction.h.

94 { return fAmplitude; }
ADCcount const fAmplitude
Amplitude at peak (transition).
template<typename T >
void icarus::opdet::AsymExpPulseFunction< T >::doDump ( std::ostream &  out,
std::string const &  indent,
std::string const &  firstIndent 
) const
overrideprivatevirtual

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

Reimplemented from icarus::opdet::PhotoelectronPulseFunction< T >.

Definition at line 196 of file AsymExpPulseFunction.h.

200 {
201  out << firstIndent
202  << "Pulse shape: exponential sum with peak at "
203  << myPeakTime() << " and amplitude " << amplitude()
204  << ", time constants: " << raiseTau()
205  << " (raise) and " << fallTau() << " (fall)"
206  << indent << " start at " << fRaiseTime << ", normalization factor " << fA
207  << '\n';
208 } // icarus::opdet::AsymExpPulseFunction<>::doDump()
Time const fRaiseTime
Time when the signal starts rising above baseline.
ADCcount const fA
Normalization factor in the functional form.
Time myPeakTime() const
Returns the time of the peak.
template<typename T >
auto icarus::opdet::AsymExpPulseFunction< T >::doEvaluateAt ( Time  time) const
overrideprivatevirtual

Evaluates the pulse at the given time.

Parameters
timetime to evaluate the shape at

The scale of the time is defined by the transition time passed at construction.

Definition at line 185 of file AsymExpPulseFunction.h.

187 {
188  return (time <= fRaiseTime)
189  ? ADCcount{ 0 }
191 } // icarus::opdet::AsymExpPulseFunction<>::doEvaluateAt()
Time const fRaiseTime
Time when the signal starts rising above baseline.
typename Base_t::ADCcount ADCcount
Type for ADC counts (floating point).
static double ExponentialDiff(Time t, Time raise, Time fall)
Returns the value of an exponential: exp(-t/tau).
ADCcount const fA
Normalization factor in the functional form.
Time const fFallTau
Time constant of signal fall.
Time const fRaiseTau
Time constant of signal rise.
template<typename T >
virtual ADCcount icarus::opdet::AsymExpPulseFunction< T >::doPeakAmplitude ( ) const
inlineoverrideprivatevirtual

Returns the amplitude of the first peak in ADC counts.

Reimplemented from icarus::opdet::PhotoelectronPulseFunction< T >.

Definition at line 135 of file AsymExpPulseFunction.h.

135 { return myAmplitude(); }
ADCcount myAmplitude() const
Returns the amplitude of the pulse from the baseline, including its sign.
template<typename T >
virtual Time icarus::opdet::AsymExpPulseFunction< T >::doPeakTime ( ) const
inlineoverrideprivatevirtual

Returns the time at which the first peak is found.

Implements icarus::opdet::PhotoelectronPulseFunction< T >.

Definition at line 132 of file AsymExpPulseFunction.h.

132 { return myPeakTime(); }
Time myPeakTime() const
Returns the time of the peak.
template<typename T >
auto icarus::opdet::AsymExpPulseFunction< T >::expDiffPeak ( Time  raiseTau,
Time  fallTau 
)
staticprivate

Returns the time value at which ExponentialDiff() is maximum.

Definition at line 214 of file AsymExpPulseFunction.h.

215 {
216  // the strange order of the operations makes sure that if Time defines
217  // difference (into Time), ratio (into scalar) and multiplication to scalar,
218  // the expression is valid.
219  return
220  raiseTau * (fallTau / (raiseTau - fallTau)) * std::log(raiseTau/fallTau);
221 } // icarus::opdet::AsymExpPulseFunction<T>::expDiffPeak()
template<typename T >
static double icarus::opdet::AsymExpPulseFunction< T >::Exponential ( Time  t,
Time  tau 
)
inlinestatic

Returns the value of an exponential: exp(-t/tau).

Definition at line 99 of file AsymExpPulseFunction.h.

99 { return std::exp(-t/tau); }
template<typename T >
static double icarus::opdet::AsymExpPulseFunction< T >::ExponentialDiff ( Time  t,
Time  raise,
Time  fall 
)
inlinestatic

Returns the value of an exponential: exp(-t/tau).

Definition at line 102 of file AsymExpPulseFunction.h.

103  { return Exponential(t, raise) - Exponential(t, fall); }
static double Exponential(Time t, Time tau)
Returns the value of an exponential: exp(-t/tau).
template<typename T >
Time icarus::opdet::AsymExpPulseFunction< T >::fallTau ( ) const
inline

Definition at line 93 of file AsymExpPulseFunction.h.

93 { return fFallTau; }
Time const fFallTau
Time constant of signal fall.
template<typename T >
ADCcount icarus::opdet::AsymExpPulseFunction< T >::myAmplitude ( ) const
inlineprivate

Returns the amplitude of the pulse from the baseline, including its sign.

Definition at line 118 of file AsymExpPulseFunction.h.

118 { return fAmplitude; }
ADCcount const fAmplitude
Amplitude at peak (transition).
template<typename T >
Time icarus::opdet::AsymExpPulseFunction< T >::myPeakTime ( ) const
inlineprivate

Returns the time of the peak.

Definition at line 115 of file AsymExpPulseFunction.h.

115 { return fPeakTime; }
Time const fPeakTime
Time of maximum signal.
template<typename T >
Time icarus::opdet::AsymExpPulseFunction< T >::raiseTau ( ) const
inline

Definition at line 92 of file AsymExpPulseFunction.h.

92 { return fRaiseTau; }
Time const fRaiseTau
Time constant of signal rise.
template<typename T >
template<typename V >
static V icarus::opdet::AsymExpPulseFunction< T >::round ( V  value)
inlinestaticprivate

Definition at line 155 of file AsymExpPulseFunction.h.

155 { return (value.abs() < V{ 1e-6 })? V{ 0.0 }: value; }
BEGIN_PROLOG V
do i e
temporary value

Member Data Documentation

template<typename T >
ADCcount const icarus::opdet::AsymExpPulseFunction< T >::fA
private

Normalization factor in the functional form.

Definition at line 112 of file AsymExpPulseFunction.h.

template<typename T >
ADCcount const icarus::opdet::AsymExpPulseFunction< T >::fAmplitude
private

Amplitude at peak (transition).

Definition at line 106 of file AsymExpPulseFunction.h.

template<typename T >
Time const icarus::opdet::AsymExpPulseFunction< T >::fFallTau
private

Time constant of signal fall.

Definition at line 109 of file AsymExpPulseFunction.h.

template<typename T >
Time const icarus::opdet::AsymExpPulseFunction< T >::fPeakTime
private

Time of maximum signal.

Definition at line 107 of file AsymExpPulseFunction.h.

template<typename T >
Time const icarus::opdet::AsymExpPulseFunction< T >::fRaiseTau
private

Time constant of signal rise.

Definition at line 108 of file AsymExpPulseFunction.h.

template<typename T >
Time const icarus::opdet::AsymExpPulseFunction< T >::fRaiseTime
private

Time when the signal starts rising above baseline.

Definition at line 111 of file AsymExpPulseFunction.h.


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