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

#include <DAPHNEStreamFrame.hpp>

Collaboration diagram for dunedaq::fddetdataformats::DAPHNEStreamFrame:
[legend]

Classes

struct  Header
struct  Trailer

Public Types

using word_t = uint32_t

Public Member Functions

uint64_t get_timestamp () const
void set_timestamp (const uint64_t new_timestamp)
 Set the 64-bit timestamp of the frame.
uint16_t get_adc (int i_adc, int i_channel) const
 Get the i ADC value of chn in the frame.
void set_adc (int i, int i_channel, uint16_t val)
 Set the i ADC value of chn in the frame to val.
uint8_t get_channel0 () const
uint8_t get_channel1 () const
uint8_t get_channel2 () const
uint8_t get_channel3 () const
bool operator< (const DAPHNEStreamFrame &other) const

Public Attributes

detdataformats::DAQHeader daq_header
Header header
word_t adc_words [s_num_adc_words]
Trailer trailer

Static Public Attributes

static constexpr int s_bits_per_adc = 14
static constexpr int s_bits_per_word = 8 * sizeof(word_t)
static constexpr int s_channels_per_frame = 4
static constexpr int s_adcs_per_channel = 64
static constexpr int s_daphnes_per_frame = 1
static constexpr int s_num_adc_words = s_channels_per_frame * s_adcs_per_channel * s_bits_per_adc / s_bits_per_word
static constexpr std::size_t s_expected_bytes

Detailed Description

Definition at line 34 of file DAPHNEStreamFrame.hpp.

Member Typedef Documentation

◆ word_t

Member Function Documentation

◆ get_adc()

uint16_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_adc ( int i_adc,
int i_channel ) const
inline

Get the i ADC value of chn in the frame.

Definition at line 5 of file DAPHNEStreamFrame.hxx.

6{
7 return static_cast<uint16_t>(
10 i_adc, i_channel, adc_words));
11}
WordType get_adc_2d_as_1d(const int i_adc, const int i_channel, const WordType(&adc_matrix)[NWords])
Definition Utils.hpp:41

◆ get_channel0()

uint8_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_channel0 ( ) const
inline

Definition at line 78 of file DAPHNEStreamFrame.hpp.

◆ get_channel1()

uint8_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_channel1 ( ) const
inline

Definition at line 80 of file DAPHNEStreamFrame.hpp.

80{ return header.channel_1; }

◆ get_channel2()

uint8_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_channel2 ( ) const
inline

Definition at line 82 of file DAPHNEStreamFrame.hpp.

82{ return header.channel_2; }

◆ get_channel3()

uint8_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_channel3 ( ) const
inline

Definition at line 84 of file DAPHNEStreamFrame.hpp.

84{ return header.channel_3; }

◆ get_timestamp()

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

Definition at line 63 of file DAPHNEStreamFrame.hpp.

63{ return daq_header.get_timestamp(); }

◆ operator<()

bool dunedaq::fddetdataformats::DAPHNEStreamFrame::operator< ( const DAPHNEStreamFrame & other) const
inline

Definition at line 86 of file DAPHNEStreamFrame.hpp.

86 {
87 return this->get_timestamp() < other.get_timestamp();
88 }

◆ set_adc()

void dunedaq::fddetdataformats::DAPHNEStreamFrame::set_adc ( int i,
int i_channel,
uint16_t val )
inline

Set the i ADC value of chn in the frame to val.

Definition at line 14 of file DAPHNEStreamFrame.hxx.

15{
18 i_adc, i_channel, val, adc_words);
19}
void set_adc_2d_as_1d(const int i_adc, const int i_channel, const WordType adc_val, WordType(&adc_matrix)[NWords])
Definition Utils.hpp:95

◆ set_timestamp()

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

Set the 64-bit timestamp of the frame.

Definition at line 66 of file DAPHNEStreamFrame.hpp.

67 {
68 daq_header.timestamp_1 = new_timestamp;
69 daq_header.timestamp_2 = new_timestamp >> 32;
70 }

Member Data Documentation

◆ adc_words

word_t dunedaq::fddetdataformats::DAPHNEStreamFrame::adc_words[s_num_adc_words]

Definition at line 92 of file DAPHNEStreamFrame.hpp.

◆ daq_header

detdataformats::DAQHeader dunedaq::fddetdataformats::DAPHNEStreamFrame::daq_header

Definition at line 90 of file DAPHNEStreamFrame.hpp.

◆ header

Header dunedaq::fddetdataformats::DAPHNEStreamFrame::header

Definition at line 91 of file DAPHNEStreamFrame.hpp.

◆ s_adcs_per_channel

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_adcs_per_channel = 64
staticconstexpr

Definition at line 42 of file DAPHNEStreamFrame.hpp.

◆ s_bits_per_adc

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_bits_per_adc = 14
staticconstexpr

Definition at line 39 of file DAPHNEStreamFrame.hpp.

◆ s_bits_per_word

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_bits_per_word = 8 * sizeof(word_t)
staticconstexpr

Definition at line 40 of file DAPHNEStreamFrame.hpp.

◆ s_channels_per_frame

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_channels_per_frame = 4
staticconstexpr

Definition at line 41 of file DAPHNEStreamFrame.hpp.

◆ s_daphnes_per_frame

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_daphnes_per_frame = 1
staticconstexpr

Definition at line 43 of file DAPHNEStreamFrame.hpp.

◆ s_expected_bytes

std::size_t dunedaq::fddetdataformats::DAPHNEStreamFrame::s_expected_bytes
staticconstexpr

◆ s_num_adc_words

int dunedaq::fddetdataformats::DAPHNEStreamFrame::s_num_adc_words = s_channels_per_frame * s_adcs_per_channel * s_bits_per_adc / s_bits_per_word
staticconstexpr

Definition at line 44 of file DAPHNEStreamFrame.hpp.

◆ trailer

Trailer dunedaq::fddetdataformats::DAPHNEStreamFrame::trailer

Definition at line 93 of file DAPHNEStreamFrame.hpp.


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