Class for accessing raw WIB v2 frames, as used in ProtoDUNE-SP-II.
More...
#include <WIB2Frame.hpp>
|
| 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 64-bit timestamp of the frame.
|
| void | set_timestamp (const uint64_t new_timestamp) |
| | Set the 64-bit timestamp of the frame.
|
Class for accessing raw WIB v2 frames, as used in ProtoDUNE-SP-II.
The canonical definition of the WIB format is given in EDMS document 2088713: https://edms.cern.ch/document/2088713/4
Definition at line 30 of file WIB2Frame.hpp.
◆ word_t
◆ get_adc()
| uint16_t dunedaq::fddetdataformats::WIB2Frame::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:
- 40 values from FEMB0 U channels
- 40 values from FEMB0 V channels
- 48 values from FEMB0 X channels (collection)
- 40 values from FEMB1 U channels
- 40 values from FEMB1 V channels
- 48 values from FEMB1 X channels (collection)
Definition at line 88 of file WIB2Frame.hpp.
89 {
91 throw std::out_of_range("ADC index out of range");
92
93
96
98
100 uint16_t adc =
adc_words[word_index] >> first_bit_position;
101
104 adc |=
adc_words[word_index + 1] << bits_from_first_word;
105 }
106
107 return adc & 0x3FFFu;
108 }
◆ get_timestamp()
| uint64_t dunedaq::fddetdataformats::WIB2Frame::get_timestamp |
( |
| ) |
const |
|
inline |
Get the 64-bit timestamp of the frame.
Definition at line 139 of file WIB2Frame.hpp.
140 {
141 return (uint64_t)
header.timestamp_1 | ((uint64_t)
header.timestamp_2 << 32);
142 }
◆ set_adc()
| void dunedaq::fddetdataformats::WIB2Frame::set_adc |
( |
int | i, |
|
|
uint16_t | val ) |
|
inline |
Set the ith ADC value in the frame to val.
Definition at line 113 of file WIB2Frame.hpp.
114 {
116 throw std::out_of_range("ADC index out of range");
118 throw std::out_of_range("ADC value out of range");
119
120
123
125
127 uint32_t
mask = (1 << (first_bit_position)) - 1;
128 adc_words[word_index] = ((val << first_bit_position) & ~mask) | (
adc_words[word_index] & mask);
129
134 }
135 }
◆ set_timestamp()
| void dunedaq::fddetdataformats::WIB2Frame::set_timestamp |
( |
const uint64_t | new_timestamp | ) |
|
|
inline |
Set the 64-bit timestamp of the frame.
Definition at line 146 of file WIB2Frame.hpp.
147 {
148 header.timestamp_1 = new_timestamp;
149 header.timestamp_2 = new_timestamp >> 32;
150 }
◆ adc_words
◆ header
| Header dunedaq::fddetdataformats::WIB2Frame::header |
◆ s_bits_per_adc
| int dunedaq::fddetdataformats::WIB2Frame::s_bits_per_adc = 14 |
|
staticconstexpr |
◆ s_bits_per_word
| int dunedaq::fddetdataformats::WIB2Frame::s_bits_per_word = 8 * sizeof(word_t) |
|
staticconstexpr |
◆ s_channels_per_femb
◆ s_fembs_per_frame
| int dunedaq::fddetdataformats::WIB2Frame::s_fembs_per_frame = 2 |
|
staticconstexpr |
◆ s_num_adc_words
◆ s_num_ch_per_frame
◆ s_num_channels
◆ s_u_channels_per_femb
| int dunedaq::fddetdataformats::WIB2Frame::s_u_channels_per_femb = 40 |
|
staticconstexpr |
◆ s_v_channels_per_femb
| int dunedaq::fddetdataformats::WIB2Frame::s_v_channels_per_femb = 40 |
|
staticconstexpr |
◆ s_x_channels_per_femb
| int dunedaq::fddetdataformats::WIB2Frame::s_x_channels_per_femb = 48 |
|
staticconstexpr |
◆ trailer
| Trailer dunedaq::fddetdataformats::WIB2Frame::trailer |
The documentation for this class was generated from the following file:
- /github/workspace/dunedaq/sourcecode/fddetdataformats/include/fddetdataformats/WIB2Frame.hpp