67{
68
70 JLimit_t& numberOfEvents = inputFile.getLimit();
73 double TMax_ns;
82
83
84 try {
85
86 JParser<> zap(
"Example program to examine rates as a function of time on ms-level timescales.");
87
93 zap[
'T'] =
make_field(TMax_ns,
"Time window for local coincidences (if 0 run in L0 mode)") = 0.0;
96 zap[
'D'] =
make_field(
mode2D,
"L1 mode: create 2D histogram with time differences of coincidences (heavy memory usage, ignored if TMax_ns = 0)");
101
102
104 }
105 catch(const exception &error) {
107 }
108
109
111 FATAL(
"Frame time must be an integer multiple of bin width");
112 }
113
115
116 try {
118 }
121 }
122
123
124
126
128
130
131 pts->configure(inputFile);
132
133 int fEnd =
pts->rbegin()->getFrameIndex();
134 int fStart =
pts->begin( )->getFrameIndex();
135
136 if (
fEnd > inputFile.getUpperLimit()) {
138 }
139
142
143 int runNumber =
pts->begin()->getRunNumber();
144
146
148
150
151
152
156
158
161
163
164
165
167
169
172
175
178
180
181
183
185
187
189 FATAL(
"2D histogram size not supported by ROOT file output; limit input size (-n) below " << floor(
max_size / 100.0) <<
endl);
190 }
191
193
196
197 }
198
199
200
201
202
204
205
206
208
209 if (
pts->hasNext()) {
211 ++counter;
212 } else {
213 FATAL(
"Input file is too short.");
214 }
215
216
217
218 for ( ;
pts->hasNext() && counter != inputFile.getLimit(); ++counter) {
219
221
223
224 const int ic =
curr.getFrameIndex();
225
227
229
230
231
233
237 }
238
239
240
241 for (JDAQTimeslice::const_iterator frame =
curr.begin(); frame !=
curr.end(); ++frame) {
242
243 const int moduleID = frame->getModuleID();
244 const JModule&
module = moduleRouter.getModule(moduleID);
246
248
250
251
252
253 if (frame->testHighRateVeto() || frame->testFIFOStatus()) {
255 veto[pmt] = ( frame->testHighRateVeto(pmt) || frame->testFIFOStatus(pmt) );
256 }
257 }
258
259
260
262
264
268 }
269 }
270
271 }
272
273
274
276
277
278
280
281 for (JSuperFrame2D_t::iterator i =
buffer2D.begin(); i !=
buffer2D.end(); ++i) {
282 if (
veto[i->getPMTAddress()]) {
283 i->reset();
284 }
285 }
286
288
289 JSuperFrame1D_t&
data = JSuperFrame1D_t::multiplex(
buffer2D);
290
291
292
293
294 if (
data.size() > 1) {
295
296
297
298 if (TMax_ns > 0) {
300 }
301
302
303
305
307
308 if (TMax_ns == 0.0) {
309
311
312 } else {
313
315
316 while (++q !=
data.end() && q->getT() - p->getT() <= TMax_ns) {}
317
319
321
323
325
327
329
331
333
335
336 }
337 }
338 }
339
340 }
341
342 p = (q - 1);
343
344 }
345
346 }
347 }
348 }
349
350
351
353
354
355
357
358 }
359
360
361
362
363
364
366
368
370
372
375
376 for (
int b = 1; b <= rt->GetXaxis()->
GetNbins(); b++) {
377
378 double r = rt->GetBinContent(b);
379 double t = rt->GetBinCenter( b);
380
381 RT_DET[
"SUM"]->Fill(t, r);
382
383 }
384
385
386 for (
int b = 1; b <= nc->GetXaxis()->
GetNbins(); b++) {
387
388 double n = nc->GetBinContent(b);
389 double t = nc->GetBinCenter( b);
390
392
393 }
394
395 } else {
396
398
399 }
400
401 }
402
404
406
408
410
413
415
418 }
419
421
423
424 NOTICE(
"Writing individual modules histograms" <<
endl);
425
429 }
430
432
433 out.Close();
434 }
435
436}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
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...
Reduced data structure for L0 hit.
int getFrameIndex() const
Get frame index.
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.
long long int factorial(const long long int n)
Determine factorial.
const unsigned int h2d_limit
double getFrameTime()
Get frame time duration.
double getTimeOfRTS(const JDAQChronometer &chronometer)
Get time of last RTS in ns since start of run for a given chronometer.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Transmission with position.
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.
Auxiliary class to select DAQ hits based on time-over-treshold value.
@ join_t
join consecutive hits according match criterion