16 : LogLevel{pset.
get<
int>(
"LogLevel")}
17 ,
SRTime{pset.get<
double>(
"SlowRisingTime", 0.)}
18 ,
SDTime{pset.get<
double>(
"SlowDecayTime", 0.)}
19 ,
FRTime{pset.get<
double>(
"FastRisingTime", 0.)}
20 ,
FDTime{pset.get<
double>(
"FastDecayTime", 0.)}
25 std::cout <<
"ScintTimeLAr Tool configure:" << std::endl;
26 std::cout <<
"Fast rising time: " <<
FRTime <<
", Fast decay time: " <<
FDTime 27 <<
", Slow rising time: " <<
SRTime <<
", Slow decay time: " <<
SDTime << std::endl;
33 fUniformGen = std::make_unique<CLHEP::RandFlat>(engine);
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) *
55 double d = (tau1 + tau2) / tau2;
59 double t = -tau2 * std::log(1 - ran1);
61 if (ran2 <=
bi_exp(t, tau1, tau2) / g) {
return t; }
85 CLHEP::RandFlat randflatscinttime{engine};
87 if ((tau1 < 1
e-8) || (tau1 == -1.0)) {
88 timing = -tau2 * std::log(randflatscinttime());
94 auto ran1 = randflatscinttime();
95 auto ran2 = randflatscinttime();
96 auto d = (tau1 + tau2) / tau2;
97 auto t = -tau2 * std::log(1 - ran1);
99 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)
const bool fNoSlowRisingTime
T get(std::string const &key) const
std::unique_ptr< CLHEP::RandFlat > fUniformGen
void initRand(CLHEP::HepRandomEngine &engine)
General LArSoft Utilities.
double single_exp(double t, double tau2) const
const bool fNoFastRisingTime
double with_rising_time(double tau1, double tau2)