Generate hits.
137 {
140
141
142
143
144 const size_t N = module.size();
145 const size_t M = (N * (N - 1)) / 2;
146
149
150
151
152
153 for (size_t pmt = 0; pmt != N; ++pmt) {
154
156
157 if (rateL0_Hz > 0.0) {
158
159 const double t_ns = 1.0e9 / rateL0_Hz;
160
161 for (double t1 = period.getLowerLimit() + gRandom->Exp(t_ns); t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
163 }
164 }
165 }
166
167
168
169
170 double totalRateL1_Hz = 0.0;
171
172 for (size_t i = 0; i != N; ++i) {
174 }
175
176 if (totalRateL1_Hz > 0.0) {
177
178 const double t_ns = 1.0e9 / totalRateL1_Hz;
179
180 double t1 = period.getLowerLimit() + gRandom->Exp(t_ns);
181
182 if (t1 < period.getUpperLimit()) {
183
184
185
187
188 size_t i = 0;
189 double P = 0.0;
190
191 for (size_t pmt1 = 0; pmt1 != N; ++pmt1) {
192 for (size_t pmt2 = 0; pmt2 != pmt1; ++pmt2) {
193
196
197 i += 1;
198 P += p;
199
201 }
202 }
203
204 for ( ; t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
205
206 try {
207
208
209
211
214
215
216
217 size_t M = 0;
218
219 for (
double R = totalRateL1_Hz * gRandom->Rndm(); M != N && (R -=
rateL1_Hz[M]) > 0.0; ++M) {}
220
221 if (M != 0) {
222
224
225 for ( ; M != 0; --M) {
226
228
229 double P = 0.0;
230
231 for (size_t i = 0; i != N; ++i) {
232
233 if (buffer.count(i) == 0) {
234
236
238
240 }
241
242 P += probability1D[i];
243
244 } else {
245
246 probability1D[i] = 0.0;
247 }
248 }
249
250 if (P > 0.0) {
251
252 size_t pmt = 0;
253
254 for (P *= gRandom->Rndm(); pmt != N && (P -= probability1D[pmt]) > 0.0; ++pmt) {}
255
256 if (pmt != N) {
257
259
260 buffer.insert(pmt);
261 }
262
263 } else {
264
265 break;
266 }
267 }
268 }
269 }
271 }
272 }
273 }
274 }
static double getSigma()
Get intrinsic time smearing of K40 coincidences.
std::vector< double > rateL1_Hz
Multiples rate as a function of the multiplicity.
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 JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for PMT analogue signal.