99{
103
105 JLimit_t & numberOfEvents = inputFile.getLimit();
108 int N;
109 double rate_Hz;
111
112 try {
113
114 JParser<> zap(
"Example program to check timeslice data for errors.");
115
120 zap[
'N'] =
make_field(N,
"number of rows to print") = 10;
121 zap[
'R'] =
make_field(rate_Hz,
"high-rate veto [Hz]") = 0.0;
123
124 zap(argc, argv);
125 }
126 catch(const exception& error) {
127 FATAL(error.what() << endl);
128 }
129
130
132
133
134 if (rate_Hz > 0.0) {
136 }
137
140
142
143 const Long64_t nx = frame_index.
second - frame_index.
first + 1;
144 const Double_t xmin = (Double_t) frame_index.
first - 0.5;
145 const Double_t xmax = (Double_t) frame_index.second + 0.5;
146
148
149 for (
counter_type counter = 0; in.hasNext(); ++counter) {
150
151 STATUS(
"event: " << setw(10) << counter <<
'\r');
DEBUG(endl);
152
154
155 for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
156
158
160
162 misses[frame->getModuleID()] += 1;
163 }
164 }
165
167
168 errors[error->type] += 1;
169
170 H1[error->type]->Fill((Double_t) frame->getFrameIndex());
171 }
172
174
176
177 if (error->pos >= 0) {
178
179 const int pmt = (*frame)[error->pos].getPMT();
180
181 cout << "Module "
182 << setw(10) << frame->getModuleID() << '.' << setw(2) << setfill('0') << pmt << setfill(' ') << ' '
183 << setw(8) << frame->getFrameIndex() << ' '
184 << setw(6) << error->pos << '/' << setw(8) << frame->size() << ' '
185 << setw(2) << error->type << ' ';
186
187 if (pmt < NUMBER_OF_PMTS) {
188 cout << setw(1) << frame->testHighRateVeto(pmt)
189 << setw(1) << frame->testFIFOStatus (pmt) << ' ';
190 }
191
192 cout << setw(4) << frame->getUDPNumberOfReceivedPackets() << '/'
193 << setw(4) << frame->getUDPMaximalSequenceNumber();
194
195 cout << " ";
196
197 print(cout, error->type);
198
199 cout << endl << endl;
200
201 deque<JDAQHit> buffer;
202
203 for (
int i = error->pos - 1,
n = 0; i >= 0 &&
n <= N; --i) {
204 if ((*frame)[i].getPMT() == (*frame)[error->pos].getPMT()) {
205 buffer.push_front((*frame)[i]);
207 }
208 }
209
210 for (deque<JDAQHit>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
211 print(cout, *i); cout << endl;
212 }
213
214 print(cout, (*frame)[error->pos]);
215
216 cout << " <<< " << endl;
217
218 for (
int i = error->pos + 1,
n = 0; i < frame->size() &&
n <= N; ++i) {
219 if ((*frame)[i].getPMT() == (*frame)[error->pos].getPMT()) {
220 print(cout, (*frame)[i]); cout << endl;
222 }
223 }
224
225 } else {
226
227 cout << "Module "
228 << setw(10) << frame->getModuleID() << ' ' << setw(2) << ' ' << ' '
229 << setw(8) << frame->getFrameIndex() << ' '
230 << setw(6) << error->pos << '/' << setw(8) << frame->size() << ' '
231 << setw(2) << error->type << ' ';
232
233 cout << setw(1) << ' '
234 << setw(1) << ' ' << ' ';
235
236 cout << setw(4) << frame->getUDPNumberOfReceivedPackets() << '/'
237 << setw(4) << frame->getUDPMaximalSequenceNumber();
238
239 cout << " ";
240
241 print(cout, error->type);
242
243 cout << endl << endl;
244 }
245 }
246 }
247 }
248 }
250
252
253 print(cout, i->first);
254
255 cout << ' ' << setw(8) << i->second << endl;
256 }
257
258 int ns = 0;
259
261
262 cout << "misses " << setw(10) << i->first << ' ' << setw(8) << i->second << endl;
263
264 ns += i->second;
265 }
266 {
267 cout << "misses " << setw(10) << "total" << ' ' << setw(8) << ns << endl;
268 }
269
271}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for multiplexing object iterators.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
Object reading from a list of files.
std::ostream & print(std::ostream &out, const JTestSummary &summary, T __begin, T __end, const bool useColors=true, const JFormat_t &formatting=JFormat_t(18, 3, std::ios::fixed))
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::set< JROOTClassSelector > getROOTClassSelection(const bool option=false)
Get ROOT class selection.
Long64_t counter_type
Type definition for counter.
JFrameIndexRange getFrameIndexRange(JTreeScannerInterface< T, KM3NETDAQ::JDAQEvaluator > &in)
Get range of frame indices.
static const JChecksum checksum
Function object to perform check-sum of raw data.
static int MAXIMAL_FRAME_SIZE
Maximal frame size.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
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 data structure for result of checksum.
@ EPMT_t
PMT number error.
@ TIME_t
Time order error.
result_type::const_iterator const_iterator