DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::fddetdataformats::DAPHNEStreamFrame Class 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 (uint i_adc, uint i_channel) const
 Get the i ADC value of chn in the frame.
void set_adc (uint i, uint chn, uint16_t val)
 Set the i ADC value of chn in the frame to val.
uint8_t get_channel0 () const
 Get the channel 0 from the DAPHNE Stream frame header.
uint8_t get_channel1 () const
 Get the channel 1 from the DAPHNE Stream frame header.
uint8_t get_channel2 () const
 Get the channel 2 from the DAPHNE Stream frame header.
uint8_t get_channel3 () const
 Get the channel 3 from the DAPHNE Stream frame header.

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

Detailed Description

Definition at line 33 of file DAPHNEStreamFrame.hpp.

Member Typedef Documentation

◆ word_t

Member Function Documentation

◆ get_adc()

uint16_t dunedaq::fddetdataformats::DAPHNEStreamFrame::get_adc ( uint i_adc,
uint 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 static_cast<int>(i_adc), static_cast<int>(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:40

◆ get_channel0()

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

Get the channel 0 from the DAPHNE Stream frame header.

Definition at line 80 of file DAPHNEStreamFrame.hpp.

◆ get_channel1()

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

Get the channel 1 from the DAPHNE Stream frame header.

Definition at line 83 of file DAPHNEStreamFrame.hpp.

83{ return header.channel_1; }

◆ get_channel2()

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

Get the channel 2 from the DAPHNE Stream frame header.

Definition at line 86 of file DAPHNEStreamFrame.hpp.

86{ return header.channel_2; }

◆ get_channel3()

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

Get the channel 3 from the DAPHNE Stream frame header.

Definition at line 89 of file DAPHNEStreamFrame.hpp.

89{ return header.channel_3; }

◆ get_timestamp()

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

Definition at line 64 of file DAPHNEStreamFrame.hpp.

64{ return daq_header.get_timestamp(); }

◆ set_adc()

void dunedaq::fddetdataformats::DAPHNEStreamFrame::set_adc ( uint i,
uint chn,
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 static_cast<int>(i_adc), static_cast<int>(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:94

◆ 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 67 of file DAPHNEStreamFrame.hpp.

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

Member Data Documentation

◆ adc_words

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

Definition at line 61 of file DAPHNEStreamFrame.hpp.

◆ daq_header

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

Definition at line 59 of file DAPHNEStreamFrame.hpp.

◆ header

Header dunedaq::fddetdataformats::DAPHNEStreamFrame::header

Definition at line 60 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_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 62 of file DAPHNEStreamFrame.hpp.


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