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

Struct for accessing raw DAPHNE eth frames. More...

#include <DAPHNEEthFrame.hpp>

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

Classes

struct  Header

Public Types

using word_t = uint64_t

Public Member Functions

uint16_t get_adc (int i) const
 Get the ith ADC value in the frame.
void set_adc (int i, uint16_t val)
 Set the ith ADC value in the frame to val.
uint64_t get_timestamp () const
 Get the starting 64-bit timestamp of the frame.
void set_timestamp (const uint64_t new_timestamp)
 Set the starting 64-bit timestamp of the frame.
uint8_t get_channel () const
 Get the channel identifier of the frame.
void set_channel (const uint8_t new_channel)
 Set the channel identifier of the frame.
bool operator< (const DAPHNEEthFrame &other) const

Public Attributes

detdataformats::DAQEthHeader daq_header
Header header
word_t adc_words [s_num_adc_words]

Static Public Attributes

static constexpr uint8_t version = 1
static constexpr int s_bits_per_adc = 14
static constexpr int s_bits_per_word = 8 * sizeof(word_t)
static constexpr int s_num_adcs = 1024
static constexpr int s_num_adc_words = s_num_adcs * s_bits_per_adc / s_bits_per_word
static constexpr size_t s_expected_bytes = sizeof(detdataformats::DAQEthHeader) + Header::s_expected_bytes + s_num_adc_words * sizeof(word_t)

Detailed Description

Struct for accessing raw DAPHNE eth frames.

The canonical definition of the DAPHNE format is given in EDMS document 2088726: https://edms.cern.ch/document/2088726/XXX, (XXX a stand-in for the doc version, e.g. 5)

Definition at line 41 of file DAPHNEEthFrame.hpp.

Member Typedef Documentation

◆ word_t

Definition at line 44 of file DAPHNEEthFrame.hpp.

Member Function Documentation

◆ get_adc()

uint16_t dunedaq::fddetdataformats::DAPHNEEthFrame::get_adc ( int i) const
inline

Get the ith ADC value in the frame.

The ADC words are 14 bits long, stored packed in the data structure. The order is:

  • 1024 adc values from one daphne channel

Definition at line 5 of file DAPHNEEthFrame.hxx.

6{
7
8 // We're static_casting the returned DAPHNEEthFrame::word_t to a uint16_t, which is fine since
9 // the ADC value is guaranteed to be storable in 16 bits
10
14}
WordType get_adc_1d(const int i_adc, const WordType(&adc_array)[NWords])
Definition Utils.hpp:157

◆ get_channel()

uint8_t dunedaq::fddetdataformats::DAPHNEEthFrame::get_channel ( ) const
inline

Get the channel identifier of the frame.

Definition at line 98 of file DAPHNEEthFrame.hpp.

◆ get_timestamp()

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

Get the starting 64-bit timestamp of the frame.

Definition at line 92 of file DAPHNEEthFrame.hpp.

92{ return daq_header.get_timestamp(); }
detdataformats::DAQEthHeader daq_header

◆ operator<()

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

Definition at line 103 of file DAPHNEEthFrame.hpp.

103 {
104 return std::tuple(this->get_timestamp(), this->get_channel()) < std::tuple(other.get_timestamp(), other.get_channel());
105 }
uint64_t get_timestamp() const
Get the starting 64-bit timestamp of the frame.
uint8_t get_channel() const
Get the channel identifier of the frame.

◆ set_adc()

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

Set the ith ADC value in the frame to val.

Definition at line 17 of file DAPHNEEthFrame.hxx.

18{ // NOLINT
19
23}
void set_adc_1d(const int i_adc, WordType adc_val, WordType(&adc_array)[NWords])
Definition Utils.hpp:196

◆ set_channel()

void dunedaq::fddetdataformats::DAPHNEEthFrame::set_channel ( const uint8_t new_channel)
inline

Set the channel identifier of the frame.

Definition at line 101 of file DAPHNEEthFrame.hpp.

101{ header.channel = new_channel; }

◆ set_timestamp()

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

Set the starting 64-bit timestamp of the frame.

Definition at line 95 of file DAPHNEEthFrame.hpp.

95{ daq_header.timestamp = new_timestamp; }

Member Data Documentation

◆ adc_words

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

Definition at line 109 of file DAPHNEEthFrame.hpp.

◆ daq_header

detdataformats::DAQEthHeader dunedaq::fddetdataformats::DAPHNEEthFrame::daq_header

Definition at line 107 of file DAPHNEEthFrame.hpp.

◆ header

Header dunedaq::fddetdataformats::DAPHNEEthFrame::header

Definition at line 108 of file DAPHNEEthFrame.hpp.

◆ s_bits_per_adc

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

Definition at line 49 of file DAPHNEEthFrame.hpp.

◆ s_bits_per_word

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

Definition at line 50 of file DAPHNEEthFrame.hpp.

◆ s_expected_bytes

size_t dunedaq::fddetdataformats::DAPHNEEthFrame::s_expected_bytes = sizeof(detdataformats::DAQEthHeader) + Header::s_expected_bytes + s_num_adc_words * sizeof(word_t)
staticconstexpr

Definition at line 77 of file DAPHNEEthFrame.hpp.

◆ s_num_adc_words

int dunedaq::fddetdataformats::DAPHNEEthFrame::s_num_adc_words = s_num_adcs * s_bits_per_adc / s_bits_per_word
staticconstexpr

Definition at line 52 of file DAPHNEEthFrame.hpp.

◆ s_num_adcs

int dunedaq::fddetdataformats::DAPHNEEthFrame::s_num_adcs = 1024
staticconstexpr

Definition at line 51 of file DAPHNEEthFrame.hpp.

◆ version

uint8_t dunedaq::fddetdataformats::DAPHNEEthFrame::version = 1
staticconstexpr

Definition at line 47 of file DAPHNEEthFrame.hpp.


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