Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JTriggerEfficiency.cc File Reference

Auxiliary program to trigger Monte Carlo events. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include "TH1D.h"
#include "TRandom3.h"
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/MultiHead.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "km3net-dataformat/offline/Hit.hh"
#include "km3net-dataformat/definitions/pmt_status.hh"
#include "km3net-dataformat/definitions/weightlist.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDAQ/JDAQToolkit.hh"
#include "JTimeslice/JEventTimeslice.hh"
#include "JSummaryslice/JSummaryslice.hh"
#include "JAAnet/JHead.hh"
#include "JAAnet/JHeadToolkit.hh"
#include "JAAnet/JAAnetToolkit.hh"
#include "JPhysics/JK40Rates.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JDetectorSimulator.hh"
#include "JDetector/JModuleMapper.hh"
#include "JDetector/JPMTRouter.hh"
#include "JDetector/JTimeRange.hh"
#include "JDetector/JPMTParametersMap.hh"
#include "JDetector/JK40DefaultSimulator.hh"
#include "JDetector/JPMTDefaultSimulator.hh"
#include "JDetector/JCLBDefaultSimulator.hh"
#include "JGeometry3D/JCylinder3D.hh"
#include "JTrigger/JHit.hh"
#include "JTrigger/JHitToolkit.hh"
#include "JTrigger/JTimeslice.hh"
#include "JTrigger/JSuperFrame1D.hh"
#include "JTrigger/JSuperFrame2D.hh"
#include "JTrigger/JHitL0.hh"
#include "JTrigger/JHitL1.hh"
#include "JTrigger/JBuildL1.hh"
#include "JTrigger/JBuildL2.hh"
#include "JTrigger/JTrigger3DShower.hh"
#include "JTrigger/JTriggerMXShower.hh"
#include "JTrigger/JTrigger3DMuon.hh"
#include "JTrigger/JTriggerBits.hh"
#include "JTrigger/JEventOverlap.hh"
#include "JTrigger/JTimesliceRouter.hh"
#include "JTrigger/JTriggeredEvent.hh"
#include "JTrigger/JTimesliceL1.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JTrigger/JEventToolkit.hh"
#include "JTrigger/JSummaryRouter.hh"
#include "JTrigger/JTriggerToolkit.hh"
#include "JTrigger/JK40RunByRunSimulator.hh"
#include "JTrigger/JPMTRunByRunSimulator.hh"
#include "JTrigger/JCLBRunByRunSimulator.hh"
#include "JSirene/JVisibleEnergyToolkit.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMonteCarloFileSupportkit.hh"
#include "JSupport/JTriggerParametersSupportkit.hh"
#include "JSupport/JSupportToolkit.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JMeta.hh"
#include "JROOT/JRandom.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to trigger Monte Carlo events.

The options

  • -a refers to the detector configuration that is used to convert Monte Carlo true information to raw data; and
  • -b refers to the detector configuration that is used to convert raw data to calibrated data.

The event counter of the triggered events, as returned by KM3NETDAQ::JDAQEvent::getCounter(), is set to the corresponding index of the Monte Carlo event in the output.
This allows for correlating the DAQ event to the Monte Carlo event.
The time of the DAQ hits can be correlated to the time of the Monte Carlo hits using the frame index and the time of the Monte Carlo event (Evt::mc_t), respectively (see also time_converter).
The universal time of the DAQ event is set to the universal time of the Monte Carlo event with a correction for the time of the event (read hits) within the time slice.
In run-by-run mode, the trigger parameters as well as the singles rates and status of the PMTs are read from the given raw data file.
The two-fold (and higher) coincidence rates should still be provided on the command line.

Author
mdejong

Definition in file JTriggerEfficiency.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 139 of file JTriggerEfficiency.cc.

140{
141 using namespace std;
142 using namespace JPP;
143 using namespace KM3NETDAQ;
144
146
149 JLimit_t& numberOfEvents = inputFile.getLimit();
150 string detectorFileA;
151 string detectorFileB;
152 double margin_m;
153 int run;
154 JTriggerParameters parameters;
155 bool triggeredEventsOnly;
156 JPMTParametersMap pmtParameters;
157 JK40Rates rates_Hz;
158 JMixedK40Rates mixed_Hz;
159 string runbyrun;
160 double sigma_ns;
161 JRandom seed;
162 int debug;
163
164 try {
165
166 JParser<> zap("Auxiliary program to trigger Monte Carlo events.");
167
168 zap['f'] = make_field(inputFile, "input file (output of detector simulation)");
169 zap['o'] = make_field(outputFile, "output file") = "trigger_efficieny.root";
170 zap['n'] = make_field(numberOfEvents) = JLimit::max();
171 zap['a'] = make_field(detectorFileA, "detector used for conversion from Monte Carlo truth to raw data.");
172 zap['b'] = make_field(detectorFileB, "detector used for conversion of raw data to calibrated data.") = "";
173 zap['m'] = make_field(margin_m, "margin to the can for the computation of visible energy [m]") = 20.0;
174 zap['R'] = make_field(run, "run number") = -1;
175 zap['r'] = make_field(runbyrun, "DAQ file for run-by-run mode") = JPARSER::initialised();
176 zap['@'] = make_field(parameters, "Trigger parameters (or corresponding file name)") = JPARSER::initialised();
177 zap['O'] = make_field(triggeredEventsOnly, "optionally write only triggered events.");
178 zap['P'] = make_field(pmtParameters, "PMT simulation data (or corresponding file name)") = JPARSER::initialised();
179 zap['B'] = make_field(rates_Hz, "background rates [Hz]") = JPARSER::initialised();
180 zap['X'] = make_field(mixed_Hz, "mixed-L1/L0 background rates [Hz]") = JPARSER::initialised();
181 zap['s'] = make_field(sigma_ns, "intrinsic time smearing of K40 coincidences [ns]") = JK40DefaultSimulatorInterface::getSigma();
182 zap['S'] = make_field(seed, "seed") = 0;
183 zap['d'] = make_field(debug, "debug") = 0;
184
185 zap(argc, argv);
186 }
187 catch(const exception &error) {
188 FATAL(error.what() << endl);
189 }
190
191 seed.set(gRandom);
192
194
196
197 if (detectorFileB == "") {
198 detectorFileB = detectorFileA;
199 }
200
201
202 JDetector detectorA;
203 JDetector detectorB;
204
205 try {
206 load(detectorFileA, detectorA);
207 load(detectorFileB, detectorB);
208 }
209 catch(const JException& error) {
210 FATAL(error);
211 }
212
213 const double TA_ns = getT0(detectorA);
214 const double TB_ns = getT0(detectorB);
215
217
218 if (!pmtParameters.is_valid()) {
219 FATAL("Invalid PMT parameters " << pmtParameters << endl);
220 }
221
222 if (pmtParameters.getQE() != 1.0) {
223
224 WARNING("Correct background rates with global efficiency " << pmtParameters.getQE() << endl);
225
226 rates_Hz.correct(pmtParameters.getQE());
227 }
228
229 Head header;
230
231 try {
232 header = getHeader(inputFile);
233 }
234 catch(const JException& error) {
235 FATAL(error);
236 }
237
238 const JModuleRouter moduleRouter(detectorB);
239 JDetectorSimulator simbad (detectorA);
240 JSummaryRouter summaryRouter;
241
243
244 set<int> fs; // frame indices of summary data already written
245
246 JDAQUTCExtended UTC = JDAQUTCExtended::getInstance(); // start of run
247
248 if (runbyrun != "") {
249
250 NOTICE("Using run-by-run: " << runbyrun << endl);
251
252 scanner.configure(runbyrun);
253
254 if (!scanner.empty()) {
255 UTC = scanner.begin()->getTimesliceStart();
256 } else {
257 FATAL("Run-by-run simulation misses summary data." << endl);
258 }
259
260 try {
261 simbad.reset(new JK40RunByRunSimulator(summaryRouter, rates_Hz, mixed_Hz));
262 simbad.reset(new JPMTRunByRunSimulator(summaryRouter, pmtParameters, detectorA));
263 simbad.reset(new JCLBRunByRunSimulator(summaryRouter));
264 }
265 catch(const JException& error) {
266 FATAL(error.what() << endl);
267 }
268
269 try {
270
271 parameters = getTriggerParameters(runbyrun);
272
273 NOTICE("Set trigger parameters from run-by-run input." << endl);
274 }
275 catch(const JException& error) {
276 WARNING("No trigger parameters from run-by-run input;\nrun with default/user input." << endl);
277 }
278
279 // set live time
280
281 JHead buffer(header);
282
283 buffer.DAQ.livetime_s = getTimeDuration(getUTCTimeRange(scanner));
284 buffer.push(&JHead::DAQ);
285
286 copy(buffer, header);
287
288 } else {
289
290 NOTICE("Using fixed rates [Hz]: " << rates_Hz << endl);
291
292 try {
293 simbad.reset(new JK40DefaultSimulator(rates_Hz, mixed_Hz));
294 simbad.reset(new JPMTDefaultSimulator(pmtParameters, detectorA));
295 simbad.reset(new JCLBDefaultSimulator());
296 }
297 catch(const JException& error) {
298 FATAL(error.what() << endl);
299 }
300 }
301
302 // detector
303
304 if (parameters.disableHighRateVeto) {
305
306 NOTICE("Disabling high-rate veto of all PMTs." << endl);
307
309 }
310
311 parameters.set(getMaximalDistance(detectorB));
312
313 DEBUG("Trigger:" << endl << parameters << endl);
314 DEBUG("PMT parameters:" << endl << pmtParameters << endl);
315
316 const double Tmax = max(getMaximalTime(detectorA),
317 getMaximalTime(detectorB));
318
319 const JTimeRange period(-(Tmax + parameters.TMaxLocal_ns),
320 +(Tmax + parameters.TMaxLocal_ns));
321
322 const JTimeRange frame_time(0.0, getFrameTime());
323
324 // hit type should be identical to that in JDataFilter.cc
325
326 typedef double hit_type;
327
328 typedef JSuperFrame1D<hit_type> JSuperFrame1D_t;
329 typedef JSuperFrame2D<hit_type> JSuperFrame2D_t;
330 typedef JTimeslice <hit_type> JTimeslice_t;
331 typedef JBuildL1 <hit_type> JBuildL1_t;
332 typedef JBuildL2 <hit_type> JBuildL2_t;
333
334 const JBuildL1_t buildL1(parameters);
335 const JBuildL2_t buildL2(parameters.L2);
336 const JBuildL2_t buildSN(parameters.SN);
337
338 JTimesliceRouter timesliceRouter(parameters.numberOfBins);
339
340 const JTrigger3DMuon trigger3DMuon (parameters);
341 const JTrigger3DShower trigger3DShower(parameters);
342 const JTriggerMXShower triggerMXShower(parameters, detectorB);
343
344
345 TH1D h1("Trigger bits", NULL, NUMBER_OF_TRIGGER_BITS, -0.5, NUMBER_OF_TRIGGER_BITS - 0.5);
346
347
348 outputFile.open();
349
350 if (!outputFile.is_open()) {
351 FATAL("Error opening file " << outputFile << endl);
352 }
353
354 outputFile.put(*gRandom);
355 outputFile.put(JMeta(argc, argv));
356 outputFile.put(header);
357 outputFile.put(parameters);
358
359 JHead head;
360 int trigger_counter = 0;
361
362 JCylinder3D can(detectorA.begin(), detectorA.end());
363 can.addMargin(margin_m);
364
365 for (string file_name; inputFile.hasNext(); ) {
366
367 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
368
369 Evt* event = inputFile.next();
370
371 DEBUG(*event << endl);
372
373 if (has_primary(*event)) {
374
375 if (event->w.size() <= WEIGHTLIST_VISIBLE_ENERGY_HADRON) {
376 event->w.resize(WEIGHTLIST_VISIBLE_ENERGY_HADRON + 1, 0.0);
377 }
378
379 const double Evis = getVisibleEnergy (*event, can);
380 const double Elep = (has_leading_lepton(*event) ? getVisibleEnergyLeadingLepton(*event, can) : 0.0);
381 const double Ehad = Evis - Elep;
382
383 event->w[WEIGHTLIST_VISIBLE_ENERGY_LEPTON] = Elep;
384 event->w[WEIGHTLIST_VISIBLE_ENERGY_HADRON] = Ehad;
385 }
386
387 if (file_name != inputFile.getFilename()) {
388
389 file_name = inputFile.getFilename();
390 head = getHeader(file_name);
391 }
392
393 event->mc_run_id = head.start_run.run_id;
394
395 if (run == -1) {
396 run = event->mc_run_id;
397 }
398
399 bool trigger = false;
400 int frame_index = inputFile.getCounter() + 1; // event / slice
401 double t1 = gRandom->Rndm() * getFrameTime(); // time of event within time slice
402
403 JDAQUTCExtended utc(UTC.getTimeNanoSecond() + getTimeOfFrame(frame_index));
404
405 if (runbyrun != "") {
406
407 if (event->mc_event_time == TTimeStamp(0)) {
408 FATAL("Monte Carlo event time undefined." << endl);
409 }
410
411 utc = getDAQUTCExtended(event->mc_event_time);
412 t1 = getTimeDifference(summaryRouter.getTimesliceStart(), utc) * 1.0e9;
413
414 if (!frame_time(t1)) {
415
416 const Long64_t index = scanner.find(utc);
417 JDAQSummaryslice* p = scanner.getEntry(index);
418
419 if (getTimeDifference(p->getTimesliceStart(), utc) < 0.0 && index != 0) {
420 p = scanner.getEntry(index - 1);
421 }
422
423 summaryRouter.update(p);
424 summaryRouter.correct(dynamic_cast<const JPMTDefaultSimulatorInterface&>(simbad.getPMTSimulator()));
425 }
426
427 t1 = getTimeDifference(summaryRouter.getTimesliceStart(), utc) * 1.0e9;
428
429 run = summaryRouter.getRunNumber();
430 frame_index = summaryRouter.getFrameIndex();
431 utc = summaryRouter.getTimesliceStart();
432
433 DEBUG("event: "
434 << FIXED(15,3) << event->mc_event_time.AsDouble() << " [s] "
435 << utc << ' '
436 << FIXED(12,0) << t1 << " [ns] "
437 << frame_time(t1) << endl);
438 }
439
440 if (!event->mc_hits.empty() && frame_time(t1)) {
441
442 JTimeRange timeRange = getTimeRange(*event, period);
443
444 double t0 = 0.5 * (timeRange.getLowerLimit() + timeRange.getUpperLimit());
445
446 DEBUG("Start time: " << FIXED(12,2) << t0 << ' ' << FIXED(12,2) << t1 << ' ' << FIXED(9,2) << TA_ns << endl);
447
448 t1 += TA_ns; // add time offset of detector
449
450 event->mc_t = getTimeOfFrame(frame_index) + t1 - t0; // set to time since start of data taking run
451
452 timeRange.add(event->mc_t);
453 timeRange.add(period);
454
455 const JDAQChronometer chronometer(detectorB.getID(), run, frame_index, utc);
456
457 const JEventTimeslice timeslice(chronometer, simbad, *event, period);
458
459 DEBUG(timeslice << endl);
460
461
462 timesliceRouter.configure(timeslice);
463
464 JTimeslice_t timesliceL0(timeslice.getDAQChronometer());
465 JTimeslice_t timesliceL1(timeslice.getDAQChronometer());
466 JTimeslice_t timesliceL2(timeslice.getDAQChronometer());
467 JTimeslice_t timesliceSN(timeslice.getDAQChronometer());
468
469 for (JDAQTimeslice::const_iterator super_frame = timeslice.begin(); super_frame != timeslice.end(); ++super_frame) {
470
471 if (moduleRouter.hasModule(super_frame->getModuleID())) {
472
473 // calibration
474
475 const JModule& module = moduleRouter.getModule(super_frame->getModuleID());
476 const JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*super_frame, module);
477
478 // L0
479
480 timesliceL0.push_back(JSuperFrame1D_t(buffer));
481
482 DEBUG("L0 " << setw(8) << timesliceL0.rbegin()->getModuleID() << ' ' << setw(8) << timesliceL0.rbegin()->size() << LAMBDA([ps = timesliceL0.rbegin()](ostream& out) { for (const auto& i : *ps) { out << " " << i; } }) << endl);
483
484 // L1
485
486 timesliceL1.push_back(JSuperFrame1D_t(super_frame->getDAQChronometer(),
487 super_frame->getModuleIdentifier(),
488 module.getPosition()));
489
490 buildL1(*timesliceL0.rbegin(), back_inserter(*timesliceL1.rbegin()));
491
492 DEBUG("L1 " << setw(8) << timesliceL1.rbegin()->getModuleID() << ' ' << setw(8) << timesliceL1.rbegin()->size() << LAMBDA([ps = timesliceL1.rbegin()](ostream& out) { for (const auto& i : *ps) { out << " " << i; } }) << endl);
493
494 // L2
495
496 timesliceL2.push_back(JSuperFrame1D_t(super_frame->getDAQChronometer(),
497 super_frame->getModuleIdentifier(),
498 module.getPosition()));
499
500 buildL2(buffer, *timesliceL1.rbegin(), back_inserter(*timesliceL2.rbegin()));
501
502 DEBUG("L2 " << setw(8) << timesliceL2.rbegin()->getModuleID() << ' ' << setw(8) << timesliceL2.rbegin()->size() << LAMBDA([ps = timesliceL2.rbegin()](ostream& out) { for (const auto& i : *ps) { out << " " << i; } }) << endl);
503
504 // SN
505 {
506 JTimeslice_t::value_type tv(super_frame->getDAQChronometer(),
507 super_frame->getModuleIdentifier(),
508 module.getPosition());
509
510 buildSN(buffer, *timesliceL1.rbegin(), back_inserter(tv));
511
512 if (!tv.empty()) {
513
514 timesliceSN.push_back(tv);
515
516 DEBUG("SN " << setw(8) << timesliceSN.rbegin()->getModuleID() << ' ' << setw(8) << timesliceSN.rbegin()->size() << endl);
517 DEBUG("L2 " << setw(8) << timesliceL2.rbegin()->getModuleID() << ' ' << setw(8) << timesliceL2.rbegin()->size() << LAMBDA([ps = timesliceL2.rbegin()](ostream& out) { for (const auto& i : *ps) { out << " " << i; } }) << endl);
518 }
519 }
520 }
521 }
522
523
524 // Trigger
525
526 JTriggerInput trigger_input(timesliceL2);
527 JTriggerOutput trigger_output;
528
529 trigger3DMuon (trigger_input, back_inserter(trigger_output));
530 trigger3DShower(trigger_input, back_inserter(trigger_output));
531 triggerMXShower(trigger_input, timesliceL0, back_inserter(trigger_output));
532
533 trigger_output.merge(JEventOverlap(parameters.TMaxEvent_ns));
534
535 for (JTriggerOutput::const_iterator to = trigger_output.begin(); to != trigger_output.end(); ++to) {
536
537 for (int i = 0; i != h1.GetNbinsX(); ++i) {
538 if (to->hasTriggerBit(i)) {
539 h1.Fill((double) i);
540 }
541 }
542
543 JTimeRange eventTime = getTimeRange(*to).add(getTimeOfRTS(*to));
544
545 eventTime.add(TA_ns);
546 eventTime.sub(TB_ns);
547
548 if (debug >= status_t) {
549 cout << "Event time: "
550 << to->getFrameIndex() << ' '
551 << eventTime << ' '
552 << timeRange << ' '
553 << (timeRange.overlap(eventTime) ? "Y" : "N") << endl;
554 }
555
556 if (timeRange.overlap(eventTime)) {
557
558 JTriggeredEvent tev(*to,
559 timesliceRouter,
560 moduleRouter,
561 parameters.TMaxLocal_ns,
562 getTimeRange(parameters));
563
564 tev.setCounter(trigger_counter); // set the event counter to the index of the Monte Carlo event in the output.
565
566 outputFile.put(tev);
567
568 trigger = true;
569 }
570 }
571
572
573 if (!triggeredEventsOnly || trigger) {
574
575 if (parameters.writeL0()) {
576 outputFile.put(timeslice);
577 }
578
579 if (parameters.writeL1()) {
580 outputFile.put(JTimesliceL1<JDAQTimesliceL1>(timesliceL1, timesliceRouter, moduleRouter, parameters.TMaxLocal_ns));
581 }
582
583 if (parameters.writeL2()) {
584 outputFile.put(JTimesliceL1<JDAQTimesliceL2>(timesliceL2, timesliceRouter, moduleRouter, parameters.L2.TMaxLocal_ns));
585 }
586
587 if (parameters.writeSN()) {
588 outputFile.put(JTimesliceL1<JDAQTimesliceSN>(timesliceSN, timesliceRouter, moduleRouter, parameters.SN.TMaxLocal_ns));
589 }
590
591 if (parameters.writeSummary()) {
592
593 if (fs.count(chronometer.getFrameIndex()) == 0) {
594
595 outputFile.put(JSummaryslice(chronometer,simbad));
596
597 fs.insert(chronometer.getFrameIndex());
598 }
599 }
600 }
601 }
602
603 if (!triggeredEventsOnly || trigger) {
604
605 outputFile.put(*event);
606
607 ++trigger_counter;
608 }
609 }
610 STATUS(endl);
611
612 {
614
615 io >> outputFile;
616 }
617
618 outputFile.put(h1);
619 outputFile.put(*gRandom);
620 outputFile.close();
621}
string outputFile
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define WARNING(A)
Definition JMessage.hh:65
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2107
Monte Carlo run header.
Definition JHead.hh:1236
JAANET::start_run start_run
Definition JHead.hh:1601
JAANET::DAQ DAQ
Definition JHead.hh:1625
void merge(const JMatch_t &match)
Merge events.
Detector data structure.
Definition JDetector.hh:96
void setPMTStatus(const int bit)
Set status of all PMTs.
Definition JDetector.hh:207
static double getSigma()
Get intrinsic time smearing of K40 coincidences.
static void setSigma(const double sigma)
Set intrinsic time smearing of K40 coincidences.
Default implementation of the simulation of K40 background.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Definition JModule.hh:76
Auxiliary class for map of PMT parameters.
double getQE(const JPMTIdentifier &id) const
Get QE of given PMT.
bool is_valid() const
Check validity of PMT parameters.
const JPosition3D & getPosition() const
Get position.
General exception.
Definition JException.hh:25
virtual const char * what() const override
Get error message.
Definition JException.hh:65
int getID() const
Get identifier.
Definition JObjectID.hh:63
static void Throw(const bool option)
Enable/disable throw option.
Definition JThrow.hh:37
Utility class to parse command line options.
Definition JParser.hh:1664
Object writing to file.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
const std::string & getFilename() const
Get current file name.
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
void update(const JDAQSummaryslice *ps)
Update router.
Template definition for direct access of elements in ROOT TChain.
bool overlap(const range_type &range) const
Test overlap with given range.
Definition JRange.hh:382
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
range_type & sub(argument_type x)
Subtract offset.
Definition JRange.hh:460
range_type & add(argument_type x)
Add offset.
Definition JRange.hh:446
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213
CLB simulation based on run-by-run information.
K40 simulation based on run-by-run information.
PMT simulation based on run-by-run information.
1-dimensional frame with time calibrated data from one optical module.
2-dimensional frame with time calibrated data from one optical module.
Auxiliary class to build JDAQTimeslice for L1 timeslice.
Data structure for input to trigger algorithm.
Auxiliary class to build KM3NETDAQ::JDAQEvent for a triggered event.
int getRunNumber() const
Get run number.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
int getFrameIndex() const
Get frame index.
Data structure for UTC time.
static const JDAQUTCExtended & getInstance()
Get arbitrary offset (e.g.
double getTimeNanoSecond() const
Get time (limited to 16 ns cycles).
bool has_primary(const Evt &evt)
Auxiliary function to check if an event contains a primary track.
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
bool has_leading_lepton(const Evt &event)
Auxiliary function to check if an event contains the leading lepton of a neutrino interaction.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition JHead.cc:163
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
@ status_t
status
Definition JMessage.hh:30
@ debug_t
debug
Definition JMessage.hh:29
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getVisibleEnergyLeadingLepton(const Trk &, const JCylinder3D &)
double getVisibleEnergy(const Trk &, const JCylinder3D &)
Get the visible energy of a track.
double getTimeDuration(const JDAQUTCTimeRange &utc)
Get time duration of given UTC time range.
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
double getFrameTime()
Get frame time duration.
Definition JDAQClock.hh:162
void setDAQLongprint(const bool option)
Set DAQ print option.
Definition JDAQPrint.hh:28
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
Definition JDAQClock.hh:185
double getMaximalTime(const double R_Hz)
Get maximal time for given rate.
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.
JDAQUTCExtended getDAQUTCExtended(const TTimeStamp &t0, const double t1=0.0)
Get DAQ UTC time.
static const int HIGH_RATE_VETO_DISABLE
Enable (disable) use of high-rate veto test if this status bit is 0 (1);.
Definition pmt_status.hh:14
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition Evt.hh:21
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition Head.hh:65
The cylinder used for photon tracking.
Definition JHead.hh:575
int run_id
MC run number.
Definition JHead.hh:143
Match of two events considering overlap in time and position.
Transmission with position.
Definition JBillabong.cc:70
Type list.
Definition JTypeList.hh:23
Template definition of random value generator.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:66
Auxiliary class for K40 rates.
Definition JK40Rates.hh:41
void correct(const double QE)
Correct rates for global efficiency,.
Definition JK40Rates.hh:130
Auxiliary class for mixed-L1/L0 K40 rates.
Definition JK40Rates.hh:229
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72
Router for fast addressing of hits in KM3NETDAQ::JDAQTimeslice data structure as a function of the op...
Timeslice with Monte Carlo event.
Auxiliary class to create summary data.
Auxiliary data structure to convert (lambda) function to printable object.
Definition JManip.hh:726
static const int WEIGHTLIST_VISIBLE_ENERGY_HADRON
visible energy from the hadron deposited inside the instrumented volume [GeV] see JVisibleEnergyToolk...
Definition weightlist.hh:21
static const int WEIGHTLIST_VISIBLE_ENERGY_LEPTON
visible energy from the lepton deposited inside the instrumented volume [GeV] see JVisibleEnergyToolk...
Definition weightlist.hh:20