24 EXCEPTION_RAISE(
"RandomSeedException",
25 "Noise generator was not seeded before use");
27 ldmx_log(trace) <<
"Empty channels: " << emptyChannels;
36 ldmx_log(trace) <<
"Integral: " << integral;
38 double noise_hit_count =
random_->Binomial(emptyChannels, integral);
39 ldmx_log(trace) <<
"# Noise hits_: " << noise_hit_count;
41 std::vector<double> noise_hits;
42 for (
int hit_index = 0; hit_index < noise_hit_count; ++hit_index) {
43 double rand =
random_->Uniform();
44 ldmx_log(trace) <<
"Rand: " << rand;
45 double draw = integral * rand;
46 ldmx_log(trace) <<
"Draw: " << draw;
48 double cumulative_prob = 1.0 - integral + draw;
49 ldmx_log(trace) <<
"Cumulative probability: " << cumulative_prob;
51 double value_above_threshold;
53 value_above_threshold =
54 ROOT::Math::gaussian_quantile(cumulative_prob,
noise_);
56 value_above_threshold =
59 ldmx_log(trace) <<
"Noise value: " << value_above_threshold;
61 noise_hits.push_back(value_above_threshold);