11#ifndef FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_WIBFRAME_HPP_
12#define FDDETDATAFORMATS_INCLUDE_FDDETDATAFORMATS_WIBFRAME_HPP_
70 return o <<
"SOF:" << std::bitset<8>(
sof) <<
" version:" << std::bitset<5>(
version)
71 <<
" fiber:" << std::bitset<3>(
fiber_no) <<
" slot:" << std::bitset<5>(
slot_no)
72 <<
" crate:" << std::bitset<3>(
crate_no) <<
" mm:" << bool(
mm) <<
" oos:" << bool(
oos)
74 <<
" Z: " <<
z <<
'\n';
81 return o <<
"SOF:" << unsigned(h.
sof) <<
" version:" << unsigned(h.
version) <<
" fiber:" << unsigned(h.
fiber_no)
82 <<
" slot:" << unsigned(h.
slot_no) <<
" crate:" << unsigned(h.
crate_no) <<
" mm:" << unsigned(h.
mm)
83 <<
" oos:" << unsigned(h.
oos) <<
" wib_errors:" << unsigned(h.
wib_errors)
138 void set_hdr(
const uint8_t i,
const uint8_t new_hdr)
180 o <<
"s1_error:" << std::bitset<4>(
s1_error) <<
" s2_error:" << std::bitset<4>(
s2_error)
184 <<
" error_register:" << std::bitset<16>(
error_register) <<
" hdr_1:" << std::bitset<8>(
hdr_1)
185 <<
" hdr_2:" << std::bitset<8>(
hdr_2) <<
" hdr_3:" << std::bitset<8>(
hdr_3) <<
" hdr_4:" << std::bitset<8>(
hdr_4)
186 <<
" hdr_5:" << std::bitset<8>(
hdr_5) <<
" hdr_6:" << std::bitset<8>(
hdr_6) <<
" hdr_7:" << std::bitset<8>(
hdr_7)
187 <<
" hdr_8:" << std::bitset<8>(
hdr_8);
195 o <<
"s1_error:" << unsigned(hdr.
s1_error) <<
" s2_error:" << unsigned(hdr.
s2_error)
200 <<
" hdr_2:" << unsigned(hdr.
hdr_2) <<
" hdr_3:" << unsigned(hdr.
hdr_3) <<
" hdr_4:" << unsigned(hdr.
hdr_4)
201 <<
" hdr_5:" << unsigned(hdr.
hdr_5) <<
" hdr_6:" << unsigned(hdr.
hdr_6) <<
" hdr_7:" << unsigned(hdr.
hdr_7)
202 <<
" hdr_8:" << unsigned(hdr.
hdr_8);
232 }
else if (adc % 2 == 1) {
244 throw std::range_error(
"Supplied WIB channel index is out of the allowed range.");
248 void set_channel(
const uint8_t adc,
const uint8_t
ch,
const uint16_t new_val)
269 }
else if (adc % 2 == 1) {
311 void set_channel(
const uint8_t adc,
const uint8_t
ch,
const uint16_t new_val)
319 auto segment_id = (adc / 2) * 2 +
ch / 4;
322 throw std::out_of_range(
"ADC index out of range");
334 o <<
"\t\t0\t1\t2\t3\t4\t5\t6\t7\n";
335 for (
int adc = 0; adc < 8; adc++) {
336 o <<
"Stream " << adc <<
":\t";
337 for (
int ch = 0;
ch < 8;
ch++) {
340 o << std::dec <<
'\n';
381 uint16_t
get_channel(
const uint8_t block_num,
const uint8_t adc,
const uint8_t
ch)
const
400 const uint16_t new_val)
405 void set_channel(
const uint8_t block_num,
const uint8_t
ch,
const uint16_t new_val)
421 throw std::out_of_range(
"FEMB index out of range");
432 o <<
"Printing frame:" <<
'\n';
433 o << frame.
m_head <<
'\n';
PDS Frame with unphysical timestamp detected with ch