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

Class for accessing raw WIB eth frames, as used in ProtoDUNE-II. More...

#include <TDEEthFrame.hpp>

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

Classes

struct  TDEEthHeader

Public Types

using word_t = uint64_t

Public Member Functions

uint16_t get_adc (int i_channel, int i_sample=0) const
 Get the i_channel-th ADC value in the i_sample-th time sample.
void set_adc (int i_channel, int i_sample, uint16_t val)
 Set the i_channel-th ADC value in the i_sample-th time sample 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.

Public Attributes

detdataformats::DAQEthHeader daq_header
TDEEthHeader header
word_t adc_words [s_time_samples_per_frame][s_num_adc_words_per_ts]

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_time_samples_per_frame = 64
static constexpr int s_channels_per_half_femb = 64
static constexpr int s_half_fembs_per_frame = 1
static constexpr int s_num_channels = s_channels_per_half_femb * s_half_fembs_per_frame
static constexpr int s_num_adc_words_per_ts = s_num_channels * s_bits_per_adc / s_bits_per_word

Detailed Description

Class for accessing raw WIB eth frames, as used in ProtoDUNE-II.

The canonical definition of the WIB format is given in EDMS document 2088713: https://edms.cern.ch/document/2088713

Definition at line 38 of file TDEEthFrame.hpp.

Member Typedef Documentation

◆ word_t

Definition at line 42 of file TDEEthFrame.hpp.

Member Function Documentation

◆ get_adc()

uint16_t dunedaq::fddetdataformats::TDEEthFrame::get_adc ( int i_channel,
int i_sample = 0 ) const
inline

Get the i_channel-th ADC value in the i_sample-th time sample.

The order is: 64 channels repeated for 64 time samples The ADC words are 14 bits long

Definition at line 5 of file TDEEthFrame.hxx.

6{
7
8 // Note the generic get_adc_2d function takes the channel and the sample (timeslice) in reverse order
9 // Also note that the value returned by get_adc_2d is stored in a uint64_t (TDEEthFrame::word_t) but is
10 // guaranteed to be storable in a uint16_t since TDEEthFrame::s_bits_per_adc < 16.
11
12 return static_cast<uint16_t>(
16 TDEEthFrame::s_bits_per_adc>(i_sample, i_channel, adc_words));
17}
static constexpr int s_time_samples_per_frame
static constexpr int s_num_adc_words_per_ts
word_t adc_words[s_time_samples_per_frame][s_num_adc_words_per_ts]
WordType get_adc_2d(const int i_sample, const int i_adc, const WordType(&adc_matrix)[Rows][Columns])
Definition Utils.hpp:179

◆ get_channel()

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

Get the channel identifier of the frame.

Definition at line 86 of file TDEEthFrame.hpp.

86{ return header.channel; }

◆ get_timestamp()

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

Get the starting 64-bit timestamp of the frame.

Definition at line 80 of file TDEEthFrame.hpp.

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

◆ set_adc()

void dunedaq::fddetdataformats::TDEEthFrame::set_adc ( int i_channel,
int i_sample,
uint16_t val )
inline

Set the i_channel-th ADC value in the i_sample-th time sample to val.

Definition at line 20 of file TDEEthFrame.hxx.

21{
25 TDEEthFrame::s_bits_per_adc>(i_sample, i_channel, adc_val, adc_words);
26}
void set_adc_2d(const int i_sample, const int i_adc, WordType adc_val, WordType(&adc_matrix)[Rows][Columns])
Definition Utils.hpp:216

◆ set_channel()

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

Set the channel identifier of the frame.

Definition at line 89 of file TDEEthFrame.hpp.

89{ header.channel = new_channel; }

◆ set_timestamp()

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

Set the starting 64-bit timestamp of the frame.

Definition at line 83 of file TDEEthFrame.hpp.

83{ daq_header.timestamp = new_timestamp; }

Member Data Documentation

◆ adc_words

word_t dunedaq::fddetdataformats::TDEEthFrame::adc_words[s_time_samples_per_frame][s_num_adc_words_per_ts]

Definition at line 65 of file TDEEthFrame.hpp.

◆ daq_header

detdataformats::DAQEthHeader dunedaq::fddetdataformats::TDEEthFrame::daq_header

Definition at line 63 of file TDEEthFrame.hpp.

◆ header

TDEEthHeader dunedaq::fddetdataformats::TDEEthFrame::header

Definition at line 64 of file TDEEthFrame.hpp.

◆ s_bits_per_adc

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

Definition at line 44 of file TDEEthFrame.hpp.

◆ s_bits_per_word

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

Definition at line 45 of file TDEEthFrame.hpp.

◆ s_channels_per_half_femb

int dunedaq::fddetdataformats::TDEEthFrame::s_channels_per_half_femb = 64
staticconstexpr

Definition at line 47 of file TDEEthFrame.hpp.

◆ s_half_fembs_per_frame

int dunedaq::fddetdataformats::TDEEthFrame::s_half_fembs_per_frame = 1
staticconstexpr

Definition at line 48 of file TDEEthFrame.hpp.

◆ s_num_adc_words_per_ts

int dunedaq::fddetdataformats::TDEEthFrame::s_num_adc_words_per_ts = s_num_channels * s_bits_per_adc / s_bits_per_word
staticconstexpr

Definition at line 50 of file TDEEthFrame.hpp.

◆ s_num_channels

int dunedaq::fddetdataformats::TDEEthFrame::s_num_channels = s_channels_per_half_femb * s_half_fembs_per_frame
staticconstexpr

Definition at line 49 of file TDEEthFrame.hpp.

◆ s_time_samples_per_frame

int dunedaq::fddetdataformats::TDEEthFrame::s_time_samples_per_frame = 64
staticconstexpr

Definition at line 46 of file TDEEthFrame.hpp.


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