11 #include "fhiclcpp/ParameterSet.h"
14 #include "CLHEP/Random/RandFlat.h"
20 : LogLevel{pset.get<
int>(
"LogLevel")}
21 ,
SRTime{pset.get<
double>(
"SlowRisingTime", 0.0)}
22 ,
SDTime{pset.get<
double>(
"SlowDecayTime", 0.0)}
23 ,
FRTime{pset.get<
double>(
"FastRisingTime", 0.0)}
24 ,
FDTime{pset.get<
double>(
"FastDecayTime", 0.0)}
27 std::cout <<
"ScintTimeLAr Tool configure:" << std::endl;
29 <<
", Fast decay time: " <<
FDTime
30 <<
", Slow rising time: " <<
SRTime
31 <<
", Slow decay time: " <<
SDTime
39 return std::exp((-1.0 * t) / tau2) / tau2;
45 return (((
std::exp((-1.0 * t) / tau2) * (1.0 -
std::exp((-1.0 * t) / tau1))) / tau2) / tau2) * (tau1 + tau2);
68 CLHEP::RandFlat randflatscinttime{engine};
70 if ((tau1 < 1
e-8) || (tau1 == -1.0)) {
71 timing = -tau2 * std::log(randflatscinttime());
77 auto ran1 = randflatscinttime();
78 auto ran2 = randflatscinttime();
79 auto d = (tau1 + tau2) / tau2;
80 auto t = -tau2 * std::log(1 - ran1);
82 if (ran2 <=
bi_exp(t, tau1, tau2) /
g) {
double bi_exp(double t, double tau1, double tau2) const
void GenScintTime(bool is_fast, CLHEP::HepRandomEngine &engine)
ScintTimeLAr(fhicl::ParameterSet const &pset)
double single_exp(double t, double tau2) const
BEGIN_PROLOG could also be cout