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

Public Member Functions

 GainFluctuator ()=default
 
 GainFluctuator (double const refGain, Rand &&randomGain)
 
double operator() (double const n)
 Returns the new number of photoelectrons after fluctuation from n. More...
 

Private Attributes

std::optional< Rand > fRandomGain
 Random gain extractor (optional). More...
 
double const fReferenceGain = 0.0
 Reference (average) gain. More...
 

Detailed Description

template<typename Rand>
class icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >

Applies a random gain fluctuation to the specified number of photoelectrons.

Definition at line 555 of file PMTsimulationAlg.h.

Constructor & Destructor Documentation

template<typename Rand >
icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >::GainFluctuator ( )
default
template<typename Rand >
icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >::GainFluctuator ( double const  refGain,
Rand &&  randomGain 
)
inline

Definition at line 562 of file PMTsimulationAlg.h.

563  : fRandomGain(std::move(randomGain))
564  , fReferenceGain(refGain)
565  {}
std::optional< Rand > fRandomGain
Random gain extractor (optional).
double const fReferenceGain
Reference (average) gain.

Member Function Documentation

template<typename Rand >
double icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >::operator() ( double const  n)

Returns the new number of photoelectrons after fluctuation from n.

Definition at line 736 of file PMTsimulationAlg.cxx.

737 {
738  return fRandomGain
739  ? (fRandomGain->fire(n * fReferenceGain) / fReferenceGain): n;
740 }
std::optional< Rand > fRandomGain
Random gain extractor (optional).
double const fReferenceGain
Reference (average) gain.

Member Data Documentation

template<typename Rand >
std::optional<Rand> icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >::fRandomGain
private

Random gain extractor (optional).

Definition at line 557 of file PMTsimulationAlg.h.

template<typename Rand >
double const icarus::opdet::PMTsimulationAlg::GainFluctuator< Rand >::fReferenceGain = 0.0
private

Reference (average) gain.

Definition at line 558 of file PMTsimulationAlg.h.


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