Class for accessing raw WIB eth frames, as used in ProtoDUNE-II.
More...
#include <TDEEthFrame.hpp>
|
uint16_t | get_adc (int i, int sample=0) const |
| Get the ith ADC value in the frame.
|
|
void | set_adc (int i, int sample, 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.
|
|
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/XXX
Definition at line 33 of file TDEEthFrame.hpp.
◆ word_t
◆ get_adc()
uint16_t dunedaq::fddetdataformats::TDEEthFrame::get_adc |
( |
int | i, |
|
|
int | sample = 0 ) const |
|
inline |
Get the ith ADC value in the frame.
The ADC words are 14 bits long; wrod_t stored packed in the data structure. The order is: 64 channels repeated for 64 time samples
Definition at line 83 of file TDEEthFrame.hpp.
84 {
86 throw std::out_of_range("ADC index out of range");
87
88
91
93
95
96 uint16_t adc =
adc_words[sample][word_index] >> first_bit_position;
97
100
101 adc |=
adc_words[sample][word_index + 1] << bits_from_first_word;
102 }
103
104 return adc & 0x3FFFu;
105 }
◆ get_channel()
uint8_t dunedaq::fddetdataformats::TDEEthFrame::get_channel |
( |
| ) |
const |
|
inline |
◆ get_timestamp()
uint64_t dunedaq::fddetdataformats::TDEEthFrame::get_timestamp |
( |
| ) |
const |
|
inline |
Get the starting 64-bit timestamp of the frame.
Definition at line 136 of file TDEEthFrame.hpp.
◆ set_adc()
void dunedaq::fddetdataformats::TDEEthFrame::set_adc |
( |
int | i, |
|
|
int | sample, |
|
|
uint16_t | val ) |
|
inline |
Set the ith ADC value in the frame to val
.
Definition at line 110 of file TDEEthFrame.hpp.
111 {
113 throw std::out_of_range("ADC index out of range");
115 throw std::out_of_range("ADC value out of range");
116
117
120
122
124 uint64_t
mask = (
static_cast<uint64_t
>(1) << first_bit_position) - 1;
125 adc_words[sample][word_index] = ((
static_cast<uint64_t
>(val) << first_bit_position) & ~mask) | (
adc_words[sample][word_index] & mask);
126
130 adc_words[sample][word_index + 1] = ((val >> bits_in_first_word) &
mask) | (
adc_words[sample][word_index + 1] & ~mask);
131 }
132 }
◆ set_channel()
void dunedaq::fddetdataformats::TDEEthFrame::set_channel |
( |
const uint8_t | new_channel | ) |
|
|
inline |
◆ 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 143 of file TDEEthFrame.hpp.
◆ adc_words
◆ daq_header
◆ header
◆ s_bits_per_adc
int dunedaq::fddetdataformats::TDEEthFrame::s_bits_per_adc = 14 |
|
staticconstexpr |
◆ s_bits_per_word
int dunedaq::fddetdataformats::TDEEthFrame::s_bits_per_word = 8 * sizeof(word_t) |
|
staticconstexpr |
◆ s_channels_per_half_femb
int dunedaq::fddetdataformats::TDEEthFrame::s_channels_per_half_femb = 64 |
|
staticconstexpr |
◆ s_half_fembs_per_frame
int dunedaq::fddetdataformats::TDEEthFrame::s_half_fembs_per_frame = 1 |
|
staticconstexpr |
◆ s_num_adc_words
◆ s_num_adc_words_per_ts
◆ s_num_channels
◆ s_time_samples_per_frame
int dunedaq::fddetdataformats::TDEEthFrame::s_time_samples_per_frame = 64 |
|
staticconstexpr |
The documentation for this class was generated from the following file:
- /github/workspace/dunedaq/sourcecode/fddetdataformats/include/fddetdataformats/TDEEthFrame.hpp