53{
57
58
59
60
61
63 JLimit_t& numberOfEvents = inputFile.getLimit();
76
77 try {
78
79 JParser<> zap(
"Auxiliary program to estimate PMT and hit multiplicities.");
80
95
97 }
98 catch(const exception &error) {
100 }
101
102
103
104
105
106
109
110 try {
112 NOTICE(
"Get trigger parameters from input." <<
endl);
113 }
115 ERROR(
"No trigger parameters from input." <<
endl);
117
118 }
119
120
121 int prescale = 1;
122
124
125
126
127 if (parameters.writeL1.prescale > 0 && (selector == "JDAQTimeslice" || selector == "JDAQTimesliceL1") &&
128 parameters.TMaxLocal_ns < TMax_ns) {
129 FATAL(
"TMax_ns (-T) " << TMax_ns <<
" ns is larger than in the trigger " << parameters.TMaxLocal_ns <<
" ns." <<
endl);
130 }
131
132 if (selector == "JDAQTimeslice") {
133
134 prescale = (parameters.writeL1.prescale != 0) ? parameters.writeL1.prescale : parameters.writeL0.prescale;
135 }
136
137 if (selector == "JDAQTimesliceL0") {
138 prescale = parameters.writeL0.prescale;
139 }
140
141 if (selector == "JDAQTimesliceL1") {
142 prescale = parameters.writeL1.prescale;
143 }
144
145 if (selector == "JDAQTimesliceSN") {
146 prescale = parameters.writeSN.prescale;
147 }
148
149 }
150
151 if (prescale == 0) {
152 FATAL(
"[R] According to trigger parameters, the " << selector <<
" stream should be empty.");
153 } else {
154 NOTICE(
"[R] Prescale factor is " << prescale <<
endl);
155 }
156
159 }
160
161
162
163
164
166
167 try {
169 }
172 }
173
176
179
181
183
185
186
187
188
189
190
195 NOTICE(
"[R] Timeslice stream " << selector <<
endl);
197
198
199
200
201
202
204
210 }
211 }
212
213 h_livetime->GetYaxis()->SetTitle(
"Livetime (s)");
214
215
216
218 const double xmin = -0.5;
219 const double xmax =
nx - 0.5;
220
225
227
228 TH2D*
CO_proto =
new TH2D(
"%_CO",
NULL, NUMBER_OF_PMTS, 0.5, 0.5 + NUMBER_OF_PMTS, NUMBER_OF_PMTS, -0.5, -0.5 + NUMBER_OF_PMTS);
229
233 }
234
236
237
239 TH1D*
time_distr =
new TH1D(
"T_distr",
"Coincidence (M > 6) distribution in timeslice", 100, 0, 1
e8);
240
241
242
243
244
245
247
248
249
253
255
256
257
258
259
261
263
265
269
271
272
277
279
280 try {
282 }
285 }
286
294 } else {
295 NOTICE(
"[R] aanet header found but mupage live time is zero. Likely not a mupage file.");
296 }
297 }
298
299
300
301 int runNumber = 0;
302
304 runNumber =
summaryFile.getEntry(0)->getRunNumber();
305 NOTICE(
"[R] Processing run #" << runNumber <<
endl);
307 }
308
309
310
311
312
313 for ( ; in.hasNext() && counter != inputFile.getLimit(); ++counter) {
314
315 STATUS(
"Entry: " <<
setw(10) << counter <<
'\r');
316
320
322
323
324 if (summary !=
NULL) {
327 ERROR(
"[R>T] Frame indices do not match [counter=" << counter <<
", timeslice=" << timeslice->
getFrameIndex() <<
", summaryslice=" << summary->
getFrameIndex() <<
"]" <<
endl);
329 FATAL(
"ROOT TTrees not aligned. Run #" << runNumber <<
endl);
330 }
331 continue;
332 }
333 }
334
335
336
337
339
340
341
342
343
345
346 if (!router.hasModule(moduleID)) {
347
348 continue;
349 }
350
352
353
354
355
356
359
360 if (summary ==
NULL) {
361 WARNING(
"[R>T>F] Missing summary for timeslice." <<
endl);
362
365 }
366
367
369
370 } else {
371
372
373
375
379 } else {
381 }
382
383
386 }
387
388
390
391 }
392
393
394
395
396
397
400 continue;
401 }
402
405
406
408 if ((*r) > 0) {
410 }
411 }
412
416
420 }
421 }
422
426
428
429
432 fill(
veto.begin(),
veto.end(),
true);
436 }
437 }
438
439
440
442
443
448
451 fill(
veto.begin(),
veto.end(),
false);
452 }
453
455
456 }
457
458
460 const JModule&
module = detector.getModule(address);
462
463
466 }
467
468
469
470
471
472 JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*
super_frame, router.getModule(
super_frame->getModuleID()));
473
475 for (JSuperFrame2D_t::iterator i = buffer.begin(); i != buffer.end(); ++i) {
476 i->join(match);
477 }
478 }
479
480 JSuperFrame1D_t&
data = JSuperFrame1D_t::multiplex(buffer);
481
483
485
486 const int pmt = h->getPMT();
487
488
493 }
494 }
495
496
497
499
502
505
507
508
509
510
512
514
515
516 while (++q !=
filteredData.end() && q->getT() - p->getT() <= TMax_ns ) {}
517
518
523
524
527
534 }
535 }
536 }
537
543 }
544 }
545
546
549 }
550
551 p = q;
552
553 }
554
555 }
556
557 }
558
559 }
560
561 NOTICE(
"[R] " << counter <<
" timeslices processed." <<
endl);
562
565 }
566
567
570
571 out.cd();
572
574
576
577
578
579
580 P.Write(out);
581
584 }
585
588 }
589
591
599 NOTICE(
"[R] " <<
H.size() <<
" DOMs were active in the run." <<
endl);
601
603
604 out.Close();
605
607
608 return (counter ? 0 : 1);
609
610}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Lookup table for PMT addresses in detector.
Lookup table for PMT addresses in optical module.
Address of module in detector data structure.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Data structure for PMT physical address.
std::string toString() const
Convert PMT physical address to string.
Template definition of a multi-dimensional oscillation probability interpolation table.
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
int getFrameIndex() const
Get frame index.
bool testFIFOStatus() const
Test FIFO status.
int countHighRateVeto() const
Count high-rate veto status.
int countFIFOStatus() const
Count FIFO status.
bool testHighRateVeto() const
Test high-rate veto status.
bool testDAQStatus() const
Test DAQ status of packets.
Data storage class for rate measurements of all PMTs in one module.
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
void setAxisLabels(TAxis *axis, const JModuleAddressMap &memo)
Set axis with PMT address labels.
long long int factorial(const long long int n)
Determine factorial.
static const double H
Planck constant [eV s].
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
static const JModuleCounter getNumberOfModules
Function object to count unique modules.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Auxiliary class to select ROOT class based on class name.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.