11 #ifndef ICARUSCODE_PMT_ALGORITHMS_ASYMEXPPULSEFUNCTION_H
12 #define ICARUSCODE_PMT_ALGORITHMS_ASYMEXPPULSEFUNCTION_H
29 namespace icarus::opdet {
145 std::string
const& indent, std::string
const& firstIndent
154 template <
typename V>
164 template <
typename T>
171 : fAmplitude(amplitude)
172 , fPeakTime(peakTime)
173 , fRaiseTau(raiseTau)
175 , fRaiseTime(fPeakTime - expDiffPeak(fRaiseTau, fFallTau))
176 , fA(fAmplitude/ExponentialDiff(fPeakTime - fRaiseTime, fRaiseTau, fFallTau))
179 assert(std::isnormal(
fA.value()));
184 template <
typename T>
188 return (time <= fRaiseTime)
190 : round(fA * ExponentialDiff(time - fRaiseTime, fRaiseTau, fFallTau) );
195 template <
typename T>
198 std::string
const& indent, std::string
const& 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
212 template <
typename T>
220 raiseTau * (fallTau / (raiseTau - fallTau)) * std::log(raiseTau/fallTau);
226 #endif // ICARUSCODE_PMT_ALGORITHMS_ASYMEXPPULSEFUNCTION_H
Time const fRaiseTime
Time when the signal starts rising above baseline.
Time const fPeakTime
Time of maximum signal.
typename Base_t::ADCcount ADCcount
Type for ADC counts (floating point).
T Time
Type of time being used.
virtual ADCcount doEvaluateAt(Time time) const override
Evaluates the pulse at the given time.
ADCcount amplitude() const
Abstract interface of shape of a pulse from one photoelectron.
static double Exponential(Time t, Time tau)
Returns the value of an exponential: exp(-t/tau).
Time peakTime() const
Returns the time at which the first peak is found.
virtual void doDump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const override
Prints on stream the parameters of this shape.
virtual Time doPeakTime() const override
Returns the time at which the first peak is found.
Interface for a function describing a pulse from a photoelectron.
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).
Describes the waveform from a single photoelectron.
ADCcount myAmplitude() const
Returns the amplitude of the pulse from the baseline, including its sign.
Dimensioned variables related to electronics.
typename Base_t::Time Time
Type of time being used.
ADCcount const fA
Normalization factor in the functional form.
Time myPeakTime() const
Returns the time of the peak.
Time const fFallTau
Time constant of signal fall.
virtual ADCcount doPeakAmplitude() const override
Returns the amplitude of the first peak in ADC counts.
AsymExpPulseFunction(ADCcount amplitude, Time peakTime, Time raiseTau, Time fallTau)
Constructor: assigns the parameters of the shape.
util::quantities::counts_f ADCcount
Type for ADC counts (floating point).
static Time expDiffPeak(Time raiseTau, Time fallTau)
Returns the time value at which ExponentialDiff() is maximum.
Time const fRaiseTau
Time constant of signal rise.