DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::fddetdataformats::WIBHeader Struct Reference

WIB header struct. More...

#include <WIBFrame.hpp>

Public Member Functions

uint64_t get_timestamp () const
 
uint16_t get_wib_counter () const
 
void set_timestamp (const uint64_t new_timestamp)
 
void set_wib_counter (const uint16_t new_wib_counter)
 
std::ostream & print_hex (std::ostream &o) const
 
std::ostream & print_bits (std::ostream &o) const
 

Public Attributes

word_t sof: 8
 
word_t version: 5
 
word_t fiber_no: 3
 
word_t crate_no: 5
 
word_t slot_no: 3
 
word_t reserved_1: 8
 
word_t mm: 1
 
word_t oos: 1
 
word_t reserved_2: 14
 
word_t wib_errors: 16
 
word_t timestamp_1
 
word_t timestamp_2: 16
 
word_t wib_counter_1: 15
 
word_t z: 1
 

Detailed Description

WIB header struct.

Definition at line 28 of file WIBFrame.hpp.

Member Function Documentation

◆ get_timestamp()

uint64_t dunedaq::fddetdataformats::WIBHeader::get_timestamp ( ) const
inline

Definition at line 35 of file WIBFrame.hpp.

36 {
37 uint64_t timestamp = timestamp_1 | (static_cast<uint64_t>(timestamp_2) << 32); // NOLINT(build/unsigned)
38 if (!z) {
39 timestamp |= static_cast<uint64_t>(wib_counter_1) << 48; // NOLINT(build/unsigned)
40 }
41 return timestamp;
42 }

◆ get_wib_counter()

uint16_t dunedaq::fddetdataformats::WIBHeader::get_wib_counter ( ) const
inline

Definition at line 43 of file WIBFrame.hpp.

43{ return z ? wib_counter_1 : 0; } // NOLINT(build/unsigned)

◆ print_bits()

std::ostream & dunedaq::fddetdataformats::WIBHeader::print_bits ( std::ostream & o) const
inline

Definition at line 68 of file WIBFrame.hpp.

69 {
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)
73 << " wib_errors:" << std::bitset<16>(wib_errors) << " timestamp: " << get_timestamp() << '\n'
74 << " Z: " << z << '\n';
75 }

◆ print_hex()

std::ostream & dunedaq::fddetdataformats::WIBHeader::print_hex ( std::ostream & o) const
inline

Definition at line 61 of file WIBFrame.hpp.

62 {
63 return o << std::hex << "SOF:" << sof << " version:" << version << " fiber:" << fiber_no << " slot:" << slot_no
64 << " crate:" << crate_no << " mm:" << mm << " oos:" << oos << " wib_errors:" << wib_errors
65 << " timestamp: " << get_timestamp() << std::dec << '\n';
66 }

◆ set_timestamp()

void dunedaq::fddetdataformats::WIBHeader::set_timestamp ( const uint64_t new_timestamp)
inline

Definition at line 45 of file WIBFrame.hpp.

46 {
47 timestamp_1 = new_timestamp;
48 timestamp_2 = new_timestamp >> 32;
49 if (!z) {
50 wib_counter_1 = new_timestamp >> 48;
51 }
52 }

◆ set_wib_counter()

void dunedaq::fddetdataformats::WIBHeader::set_wib_counter ( const uint16_t new_wib_counter)
inline

Definition at line 53 of file WIBFrame.hpp.

54 {
55 if (z) {
56 wib_counter_1 = new_wib_counter;
57 }
58 }

Member Data Documentation

◆ crate_no

word_t dunedaq::fddetdataformats::WIBHeader::crate_no

Definition at line 30 of file WIBFrame.hpp.

◆ fiber_no

word_t dunedaq::fddetdataformats::WIBHeader::fiber_no

Definition at line 30 of file WIBFrame.hpp.

◆ mm

word_t dunedaq::fddetdataformats::WIBHeader::mm

Definition at line 31 of file WIBFrame.hpp.

◆ oos

word_t dunedaq::fddetdataformats::WIBHeader::oos

Definition at line 31 of file WIBFrame.hpp.

◆ reserved_1

word_t dunedaq::fddetdataformats::WIBHeader::reserved_1

Definition at line 30 of file WIBFrame.hpp.

◆ reserved_2

word_t dunedaq::fddetdataformats::WIBHeader::reserved_2

Definition at line 31 of file WIBFrame.hpp.

◆ slot_no

word_t dunedaq::fddetdataformats::WIBHeader::slot_no

Definition at line 30 of file WIBFrame.hpp.

◆ sof

word_t dunedaq::fddetdataformats::WIBHeader::sof

Definition at line 30 of file WIBFrame.hpp.

◆ timestamp_1

word_t dunedaq::fddetdataformats::WIBHeader::timestamp_1

Definition at line 32 of file WIBFrame.hpp.

◆ timestamp_2

word_t dunedaq::fddetdataformats::WIBHeader::timestamp_2

Definition at line 33 of file WIBFrame.hpp.

◆ version

word_t dunedaq::fddetdataformats::WIBHeader::version

Definition at line 30 of file WIBFrame.hpp.

◆ wib_counter_1

word_t dunedaq::fddetdataformats::WIBHeader::wib_counter_1

Definition at line 33 of file WIBFrame.hpp.

◆ wib_errors

word_t dunedaq::fddetdataformats::WIBHeader::wib_errors

Definition at line 31 of file WIBFrame.hpp.

◆ z

word_t dunedaq::fddetdataformats::WIBHeader::z

Definition at line 33 of file WIBFrame.hpp.


The documentation for this struct was generated from the following file: