Generate hits.
172 {
175
176 const size_t N = module.size();
177
178
179
180
181 for (size_t pmt = 0; pmt != N; ++pmt) {
182
184
185 if (rateL0_Hz > 0.0) {
186
187 const bool asap = (output[pmt].size() != 0);
188
189 const double t_ns = 1.0e9 / rateL0_Hz;
190
191 for (double t1 = period.getLowerLimit() + gRandom->Exp(t_ns); t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
193 }
194
195 if (asap) {
196 output[pmt].sort();
197 }
198 }
199 }
200
201
202
203
204 double totalRateL1_Hz = 0.0;
205
206
207
209
210 for (size_t i = 0; i != N; ++i) {
212 }
213
214 if (totalRateL1_Hz > 0.0) {
215
217
218 cdf_type<pair_type> probablityL1;
219
220 const double t_ns = 1.0e9 / totalRateL1_Hz;
221
222 double t1 = period.getLowerLimit() + gRandom->Exp(t_ns);
223
224 if (t1 < period.getUpperLimit()) {
225
226
227
228 for (size_t pmt1 = 0; pmt1 != N; ++pmt1) {
229 for (size_t pmt2 = 0; pmt2 != pmt1; ++pmt2) {
230
233
234 probablityL1.put({pmt1, pmt2}, p);
235 }
236 }
237
238 for ( ; t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
239
240 try {
241
242
243
245
248
249
250
251 size_t M = 0;
252
253 for (double R = totalRateL1_Hz * gRandom->Rndm(); M != N && (R -= rateL1_Hz[M]) > 0.0; ++M) {}
254
255 if (M != 0) {
256
258
259 for ( ; M != 0; --M) {
260
262
263 double P = 0.0;
264
265 for (size_t i = 0; i != N; ++i) {
266
267 if (buffer.count(i) == 0) {
268
270
272
274 }
275
276 P += probability1D[i];
277
278 } else {
279
280 probability1D[i] = 0.0;
281 }
282 }
283
284 if (P > 0.0) {
285
286 size_t pmt = 0;
287
288 for (P *= gRandom->Rndm(); pmt != N && (P -= probability1D[pmt]) > 0.0; ++pmt) {}
289
290 if (pmt != N) {
291
293
294 buffer.insert(pmt);
295 }
296
297 } else {
298
299 break;
300 }
301 }
302 }
303 }
305 }
306 }
307 }
308 }
static double getSigma()
Get intrinsic time smearing of K40 coincidences.
virtual double getSinglesRate(const JPMTIdentifier &pmt) const =0
Get singles rate as a function of PMT.
virtual double getMultiplesRate(const JModuleIdentifier &module, const int M) const =0
Get multiples rate as a function of optical module.
virtual double getProbability(const double ct) const =0
Get probability of coincidence.
Exception for numerical precision error.
JDirection3D getDirection(const Vec &dir)
Get direction.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for PMT analogue signal.