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::AsymGaussPulseFunction< T > Class Template Reference

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

#include <AsymGaussPulseFunction.h>

Inheritance diagram for icarus::opdet::AsymGaussPulseFunction< 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

 AsymGaussPulseFunction (ADCcount amplitude, Time peakTime, Time sigmaLeft, Time sigmaRight)
 Constructor: assigns the parameters of the shape. More...
 
Parameter accessors.
Time leftSigma () const
 
Time rightSigma () 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 ADCcount Gaussian (Time x, Time mean, Time sigma, ADCcount amplitude)
 Returns the value of normal distribution at specified point. More...
 

Private Types

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

Private Member Functions

Time myPeakTime () const
 Returns the time of the center of the Gaussian. 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

template<typename V >
static V sqr (V value)
 
template<typename V >
static V round (V value)
 

Private Attributes

ADCcount fAmplitude
 Amplitude at peak (transition). More...
 
Time fTransitTime
 Time of transition between the two forms of shape. More...
 
Time fSigmaL
 RMS parameter of the shape before transition. More...
 
Time fSigmaR
 RMS parameter of the shape after transition. 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::AsymGaussPulseFunction< 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 asymmetric Gaussian shape.

Definition at line 29 of file AsymGaussPulseFunction.h.

Member Typedef Documentation

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

Type for ADC counts (floating point).

Definition at line 48 of file AsymGaussPulseFunction.h.

Definition at line 44 of file AsymGaussPulseFunction.h.

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

Type of time being used.

Definition at line 50 of file AsymGaussPulseFunction.h.

Constructor & Destructor Documentation

template<typename T >
icarus::opdet::AsymGaussPulseFunction< T >::AsymGaussPulseFunction ( ADCcount  amplitude,
Time  peakTime,
Time  sigmaLeft,
Time  sigmaRight 
)
inline

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
sigmaLeftthe standard deviation of the shape before transition
sigmaRightthe standard deviation of the shape after transition

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

Definition at line 64 of file AsymGaussPulseFunction.h.

72  , fSigmaL(sigmaLeft)
73  , fSigmaR(sigmaRight)
74  {}
Time fSigmaR
RMS parameter of the shape after transition.
Time peakTime() const
Returns the time at which the first peak is found.
Time fTransitTime
Time of transition between the two forms of shape.
Time fSigmaL
RMS parameter of the shape before transition.
ADCcount fAmplitude
Amplitude at peak (transition).

Member Function Documentation

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

Definition at line 82 of file AsymGaussPulseFunction.h.

82 { return fAmplitude; }
ADCcount fAmplitude
Amplitude at peak (transition).
template<typename T >
void icarus::opdet::AsymGaussPulseFunction< 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 164 of file AsymGaussPulseFunction.h.

168 {
169  out
170  << firstIndent << "Pulse shape: asymmetric Gaussian with peak at "
171  << myPeakTime() << " and amplitude " << amplitude() << ":"
172  << '\n' << indent
173  << " (t < " << myPeakTime() << "): sigma " << leftSigma()
174  << '\n' << indent
175  << " (t >= " << myPeakTime() << "): sigma " << rightSigma()
176  << '\n';
177 } // icarus::opdet::AsymGaussPulseFunction<>::doDump()
Time myPeakTime() const
Returns the time of the center of the Gaussian.
template<typename T >
auto icarus::opdet::AsymGaussPulseFunction< 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 150 of file AsymGaussPulseFunction.h.

152 {
153  return round(Gaussian(
154  time,
155  myPeakTime(),
156  ((time < myPeakTime())? leftSigma(): rightSigma()),
157  amplitude()
158  ));
159 } // icarus::opdet::AsymGaussPulseFunction<T>::doEvaluateAt()
static ADCcount Gaussian(Time x, Time mean, Time sigma, ADCcount amplitude)
Returns the value of normal distribution at specified point.
Time myPeakTime() const
Returns the time of the center of the Gaussian.
template<typename T >
virtual ADCcount icarus::opdet::AsymGaussPulseFunction< T >::doPeakAmplitude ( ) const
inlineoverrideprivatevirtual

Returns the amplitude of the first peak in ADC counts.

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

Definition at line 117 of file AsymGaussPulseFunction.h.

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

Returns the time at which the first peak is found.

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

Definition at line 114 of file AsymGaussPulseFunction.h.

114 { return myPeakTime(); }
Time myPeakTime() const
Returns the time of the center of the Gaussian.
template<typename T >
static ADCcount icarus::opdet::AsymGaussPulseFunction< T >::Gaussian ( Time  x,
Time  mean,
Time  sigma,
ADCcount  amplitude 
)
inlinestatic

Returns the value of normal distribution at specified point.

Definition at line 87 of file AsymGaussPulseFunction.h.

88  { return amplitude * std::exp(-sqr((x - mean)/sigma)/2.0); }
process_name opflash particleana ie x
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
template<typename T >
Time icarus::opdet::AsymGaussPulseFunction< T >::leftSigma ( ) const
inline

Definition at line 80 of file AsymGaussPulseFunction.h.

80 { return fSigmaL; }
Time fSigmaL
RMS parameter of the shape before transition.
template<typename T >
ADCcount icarus::opdet::AsymGaussPulseFunction< T >::myAmplitude ( ) const
inlineprivate

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

Definition at line 100 of file AsymGaussPulseFunction.h.

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

Returns the time of the center of the Gaussian.

Definition at line 97 of file AsymGaussPulseFunction.h.

97 { return fTransitTime; }
Time fTransitTime
Time of transition between the two forms of shape.
template<typename T >
Time icarus::opdet::AsymGaussPulseFunction< T >::rightSigma ( ) const
inline

Definition at line 81 of file AsymGaussPulseFunction.h.

81 { return fSigmaR; }
Time fSigmaR
RMS parameter of the shape after transition.
template<typename T >
template<typename V >
static V icarus::opdet::AsymGaussPulseFunction< T >::round ( V  value)
inlinestaticprivate

Definition at line 136 of file AsymGaussPulseFunction.h.

137  {
138  using namespace util::quantities::electronics_literals;
139  return (value.abs() < 1e-6_ADCf)? 0.0_ADCf: value;
140  }
do i e
temporary value
template<typename T >
template<typename V >
static V icarus::opdet::AsymGaussPulseFunction< T >::sqr ( V  value)
inlinestaticprivate

Definition at line 133 of file AsymGaussPulseFunction.h.

133 { return value * value; }
temporary value

Member Data Documentation

template<typename T >
ADCcount icarus::opdet::AsymGaussPulseFunction< T >::fAmplitude
private

Amplitude at peak (transition).

Definition at line 91 of file AsymGaussPulseFunction.h.

template<typename T >
Time icarus::opdet::AsymGaussPulseFunction< T >::fSigmaL
private

RMS parameter of the shape before transition.

Definition at line 93 of file AsymGaussPulseFunction.h.

template<typename T >
Time icarus::opdet::AsymGaussPulseFunction< T >::fSigmaR
private

RMS parameter of the shape after transition.

Definition at line 94 of file AsymGaussPulseFunction.h.

template<typename T >
Time icarus::opdet::AsymGaussPulseFunction< T >::fTransitTime
private

Time of transition between the two forms of shape.

Definition at line 92 of file AsymGaussPulseFunction.h.


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