246 <<
"-------------------- Testing fragment -------------------" <<
'\n' 247 <<
"SequenceID: " << frag.sequenceID()
248 <<
" fragmentID: " << frag.fragmentID()
249 <<
" fragmentType: " << (unsigned)frag.type()
250 <<
" Timestamp: " << frag.timestamp()
251 <<
" Crate number: " << (
int)flxfrag.crate_no()
252 <<
" Slot number: " << (
int)flxfrag.slot_no()
253 <<
" Fiber number: " << (
int)flxfrag.fiber_no() <<
"\n\n";
257 bool meta_failed =
false;
271 <<
"Metadata error." <<
'\n' 272 <<
" This fragment's metadata: " <<
'\n' 274 <<
" Version: " << meta->
version 280 <<
" Expected metadata: " <<
'\n' 290 <<
"Metadata test successful." <<
"\n\n";
295 bool timestamp_failed =
false;
298 timestamp_failed =
true;
300 <<
"First timestamp matching error." <<
'\n' 301 <<
" This fragment's timestamp: " << frag.timestamp()
302 <<
" First frame's timestamp: " << flxfrag.timestamp(0)
304 <<
" Offset: " << frag.timestamp() - flxfrag.timestamp(0) <<
"\n\n";
308 timestamp_failed =
true;
310 <<
"Trigger window error." <<
'\n' 311 <<
" This fragment's expected number of frames: " << meta->
window_frames 312 <<
" Number of frames available: " << flxfrag.timestamp(0) <<
"\n\n";
315 for(
unsigned fi = 1; fi < flxfrag.total_frames(); ++fi) {
317 timestamp_failed =
true;
319 <<
"Timestamp increase error." <<
'\n' 320 <<
" Timestamp of frame " << fi - 1 <<
": " << flxfrag.timestamp(fi-1)
321 <<
" Timestamp of frame " << fi <<
": " << flxfrag.timestamp(fi)
322 <<
" Difference: " << flxfrag.timestamp(fi) - flxfrag.timestamp(fi-1) <<
"\n\n";
326 if(!timestamp_failed) {
328 <<
"Timestamp test successful." <<
"\n\n";
332 bool convert_count_failed =
false;
334 for(
unsigned fi = 1; fi < flxfrag.total_frames(); ++fi) {
336 for(
int bi = 0; bi < 2; ++bi) {
337 if(flxfrag.coldata_convert_count(fi, 2*bi) != flxfrag.coldata_convert_count(fi, 2*bi + 1)
338 || (flxfrag.coldata_convert_count(fi, bi) - flxfrag.coldata_convert_count(fi - 1, bi)
340 && flxfrag.coldata_convert_count(fi, bi) - flxfrag.coldata_convert_count(fi - 1, bi)
342 convert_count_failed =
true;
344 <<
"COLDATA convert count increase error in frame " << fi <<
".\n" 345 <<
" Count 1 of frame " << fi - 1 <<
": " << flxfrag.coldata_convert_count(fi-1, 0)
346 <<
" Count 2 of frame " << fi - 1 <<
": " << flxfrag.coldata_convert_count(fi-1, 1)
347 <<
" Count 3 of frame " << fi - 1 <<
": " << flxfrag.coldata_convert_count(fi-1, 2)
348 <<
" Count 4 of frame " << fi - 1 <<
": " << flxfrag.coldata_convert_count(fi-1, 3) <<
'\n' 349 <<
" Count 1 of frame " << fi <<
": " << flxfrag.coldata_convert_count(fi, 0)
350 <<
" Count 2 of frame " << fi <<
": " << flxfrag.coldata_convert_count(fi, 1)
351 <<
" Count 3 of frame " << fi <<
": " << flxfrag.coldata_convert_count(fi, 2)
352 <<
" Count 4 of frame " << fi <<
": " << flxfrag.coldata_convert_count(fi, 3) <<
'\n' 354 << flxfrag.coldata_convert_count(fi, 0) - flxfrag.coldata_convert_count(fi-1, 0) <<
"\n\n";
358 if(convert_count_failed)
break;
360 if(!convert_count_failed) {
362 <<
"COLDATA convert count test successful." <<
"\n\n";
366 bool error_field_failed =
false;
396 outem.sequenceID = frag.sequenceID();
397 outem.fragmentID = frag.fragmentID();
398 outem.type = frag.type();
399 outem.timestamp = frag.timestamp();
400 outem.crate_no = flxfrag.crate_no();
401 outem.slot_no = flxfrag.slot_no();
402 outem.fiber_no = flxfrag.fiber_no();
404 outem.meta_err = meta_failed;
405 outem.timestamp_err = timestamp_failed;
406 outem.convert_count_err = convert_count_failed;
407 outem.error_fields_set = error_field_failed;
409 outem.bad = timestamp_failed || convert_count_failed || error_field_failed;
dune::FelixFragmentBase::Metadata run_meta
const uint64_t timestamp_increase
const uint16_t convert_count_increase