37 using namespace KM3NETDAQ;
47 JParser<> zap(
"Example program to histogram various data profiles.");
51 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
57 catch(
const exception& error) {
58 FATAL(error.what() << endl);
65 NOTICE(
"Determine frame index range... " << flush);
67 JFrameIndexRange frame_index = getFrameIndexRange<JDAQSummaryslice>(inputFile);
69 NOTICE(
"= (" << frame_index.first <<
"," << frame_index.second <<
")" << endl);
71 const Long64_t NX = frame_index.second - frame_index.first + 1;
72 const Long64_t nx = (NX + prescale - 1) / prescale;
73 const Double_t xmin = (Double_t) frame_index.first - 0.5;
74 const Double_t xmax = (Double_t) frame_index.second + 0.5;
81 JManager_t map_summary(
new TH1D(
"Summary[%]", NULL, NX, xmin, xmax));
82 JManager_t map_trigger(
new TH1D(
"Trigger[%]", NULL, nx, xmin, xmax));
85 TH1D h0(
"L0", NULL, NX, xmin, xmax);
86 TH1D h1(
"WR", NULL, NX, xmin, xmax);
87 TH1D h2(
"trigger", NULL, nx, xmin, xmax);
91 for (JMultipleFileScanner<JDAQSummaryslice> in(inputFile, numberOfEvents); in.hasNext(); ) {
93 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
100 for (JDAQSummaryslice::const_iterator frame = summaryslice->begin(); frame != summaryslice->end(); ++frame) {
102 if (frame->testHighRateVeto()) {
106 if (frame->testHighRateVeto(pmt)) {
107 map_status[frame->getModuleID()]->Fill((Double_t) pmt);
115 if (!frame->testHighRateVeto(pmt)) {
116 y += frame->getRate(pmt) * 1e-3;
120 map_summary[frame->getModuleID()]->Fill(x, y);
126 for (JDAQSummaryslice::const_iterator frame = summaryslice->begin(); frame != summaryslice->end(); ++frame) {
129 y += frame->getRate(pmt) * 1e-3;
132 h1.Fill(x, (frame->testWhiteRabbitStatus() ? 1.0 : 0.0));
140 for (JMultipleFileScanner<JDAQEvent> in(inputFile, numberOfEvents); in.hasNext(); ) {
142 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
146 const Double_t x =
event->getFrameIndex();
155 map_trigger[hit->getModuleID()]->Fill(x);
160 map_summary.Write(out);
161 map_trigger.Write(out);
162 map_status .Write(out);
Utility class to parse command line options.
JTOOLS::JRange< int > JFrameIndexRange
Type definition for frame index range.
Auxiliary class to manage set of histograms.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
int getFrameIndex() const
Get frame index.
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getFrameTime()
Get frame time duration.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
JTriggerCounter_t next()
Increment trigger counter.
#define DEBUG(A)
Message macros.