10 #include "fhiclcpp/ParameterSet.h"
11 #include "messagefacility/MessageLogger/MessageLogger.h"
12 #include "art/Utilities/ToolMacros.h"
13 #include "art/Utilities/make_tool.h"
14 #include "art/Utilities/ToolConfigTable.h"
15 #include "nurandom/RandomUtils/NuRandomService.h"
16 #include "CLHEP/Random/RandPoissonQ.h"
17 #include "fhiclcpp/types/Atom.h"
18 #include "fhiclcpp/types/Sequence.h"
26 class PMTGainFluctuations1Dynode;
40 Comment(
"Gain at each stage is proportional to pow(Voltage,DynodeK)")
49 Name(
"VoltageDistribution"),
50 Comment(
"PMT voltage distribution ratio at each dynode")
58 double GainFluctuation(
unsigned int npe, CLHEP::HepRandomEngine* eng)
override;
73 : fDynodeK { config().dynodeK() }
74 , fGain { config().gain() }
75 , fVoltageDistribution { config().voltageDistribution() }
76 , fDynodeGain { DynodeGain(1) }
83 for(
double rho: fVoltageDistribution) prodRho *= rho;
84 double const aVk = std::pow(fGain / std::pow(prodRho, fDynodeK), 1.0/static_cast<double>(fVoltageDistribution.size()));
85 return aVk * std::pow(fVoltageDistribution.at(dynstage - 1), fDynodeK);
90 return CLHEP::RandPoissonQ::shoot(eng, npe*fDynodeGain)/fDynodeGain;
PMTGainFluctuations1Dynode(art::ToolConfigTable< Config > const &config)
std::vector< double > fVoltageDistribution
fhicl::Atom< double > dynodeK
double GainFluctuation(unsigned int npe, CLHEP::HepRandomEngine *eng) override
fhicl::Sequence< double > voltageDistribution
BEGIN_PROLOG vertical distance to the surface Name
double DynodeGain(unsigned int dynstage)
fhicl::Atom< double > gain