34{
38
39 string inputFile;
42 Long64_t prescale;
44
45 try {
46
47 JParser<> zap(
"Example program to histogram various data profiles.");
48
54
55 zap(argc, argv);
56 }
57 catch(const exception& error) {
58 FATAL(error.what() << endl);
59 }
60
61
62 NOTICE(
"Determine frame index range... " << flush);
63
65
67
68 const Long64_t NX = frame_index.
second - frame_index.
first + 1;
69 const Long64_t nx = (NX + prescale - 1) / prescale;
71 const Double_t
xmax = frame_index.
first + nx * prescale;
72
73
75
77
78 JManager_t m_summary(new TH1D("Summary[%]", NULL, nx, xmin, xmax));
79 JManager_t m_trigger(new TH1D("Trigger[%]", NULL, nx, xmin, xmax));
80 JManager_t m_status (new TH1D("Status[%]", NULL, NUMBER_OF_PMTS, -0.5, NUMBER_OF_PMTS - 0.5));
81
82 TH1D hu("#N [all]", NULL, nx, xmin, xmax);
83 TH1D hv("#M [UDP]", NULL, nx, xmin, xmax);
84 TH1D hw("#L [HRV]", NULL, nx, xmin, xmax);
85 TH1D ha("L0 [all]", NULL, nx, xmin, xmax);
86 TH1D hb("L0 [HRV]", NULL, nx, xmin, xmax);
87 TH1D h1("WR", NULL, nx, xmin, xmax);
88 TH1D h2("trigger", NULL, nx, xmin, xmax);
89 TH1D h3("PMT", NULL, nx, xmin, xmax);
90
91 h2.Sumw2();
92
94
95 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
96
98
100
101 Double_t U = summary->size();
102 Double_t V = 0.0;
103 Double_t W = 0.0;
104 Double_t Y[] = { 0.0, 0.0 };
105 Double_t Z = 0.0;
106
107 for (JDAQSummaryslice::const_iterator frame = summary->begin(); frame != summary->end(); ++frame) {
108
110
111 if (frame->testDAQStatus()) {
112
113 V += 1.0;
114
116
117 if (frame->testHighRateVeto(pmt) || frame->testFIFOStatus(pmt))
118 m_status[frame->getModuleID()]->Fill((Double_t) pmt);
119 else
121
122 y += frame->getRate(pmt) * 1e-3;
123 }
124 }
125
126 m_summary[frame->getModuleID()]->Fill(x, y);
127
129
130 Y[0] += frame->getRate(pmt) * 1e-3;
131
132 if (!frame->testHighRateVeto(pmt) && !frame->testFIFOStatus(pmt)) {
133 Y[1] += frame->getRate(pmt) * 1e-3;
134 }
135 }
136
137 if (frame->testWhiteRabbitStatus()) {
138 Z += 1.0;
139 }
140 }
141
142 Y[0] /= (summary->size() * NUMBER_OF_PMTS);
143 Y[1] /= (summary->size() * NUMBER_OF_PMTS);
144 Z /= summary->size();
145
146 hu.Fill(x, U / prescale);
147 hv.Fill(x, V / prescale);
148 hw.Fill(x, W / prescale);
149 ha.Fill(x, Y[0] / prescale);
150 hb.Fill(x, Y[1] / prescale);
151 h1.Fill(x, Z / prescale);
152 }
154
156
157 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
158
160
161 const Double_t
x =
event->getFrameIndex();
163
164 h2.Fill(x, y);
165
167
168
170 m_trigger[hit->getModuleID()]->Fill(x);
171 }
172 }
174
175 m_summary.Write(out);
176 m_trigger.Write(out);
177 m_status .Write(out);
178
179 out.Write();
180 out.Close();
181}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
int getFrameIndex() const
Get frame index.
JTriggerCounter_t next()
Increment trigger counter.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JFrameIndexRange getFrameIndexRange(JTreeScannerInterface< T, KM3NETDAQ::JDAQEvaluator > &in)
Get range of frame indices.
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 set-up Hit.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.