DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
fddetdataformats
include
fddetdataformats
detail
DAPHNEEthStreamFrame.hxx
Go to the documentation of this file.
1
2
namespace
dunedaq::fddetdataformats
{
3
4
inline
uint8_t
5
DAPHNEEthStreamFrame::get_channel
(
const
int
i_channel)
const
6
{
7
if
(i_channel >=
s_num_channels
) {
8
throw
std::out_of_range(
9
std::format(
"Requested channel index of {} is outside of allowed range 0-{}"
, i_channel,
s_num_channels
- 1));
10
}
11
12
return
header
.channel_words[i_channel].channel;
// NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
13
}
14
15
inline
void
16
DAPHNEEthStreamFrame::set_channel
(
const
int
i_channel,
const
uint8_t new_channel_val)
17
{
18
if
(i_channel >=
s_num_channels
) {
19
throw
std::out_of_range(
20
std::format(
"Requested channel index of {} is outside of allowed range 0-{}"
, i_channel,
s_num_channels
- 1));
21
}
22
23
header
.channel_words[i_channel].channel =
// NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
24
new_channel_val;
25
}
26
27
inline
uint16_t
28
DAPHNEEthStreamFrame::get_adc
(
int
i_adc,
int
i_channel)
const
29
{
30
return
static_cast<
uint16_t
>
(
31
dunedaq::fddetdataformats::
32
get_adc_2d_as_1d<word_t, s_num_adc_words, s_bits_per_adc, s_adcs_per_channel, s_num_channels>
(
33
i_adc, i_channel,
adc_words
));
34
}
35
36
inline
void
37
DAPHNEEthStreamFrame::set_adc
(
int
i_adc,
int
i_channel, uint16_t val)
38
{
39
dunedaq::fddetdataformats::
40
set_adc_2d_as_1d<word_t, s_num_adc_words, s_bits_per_adc, s_adcs_per_channel, s_num_channels>
(
41
i_adc, i_channel, val,
adc_words
);
42
}
43
44
}
// namespace dunedaq::fddetdataformats
dunedaq::fddetdataformats
Definition
CRTBernFrame.hpp:29
dunedaq::fddetdataformats::get_adc_2d_as_1d
WordType get_adc_2d_as_1d(const int i_adc, const int i_channel, const WordType(&adc_matrix)[NWords])
Definition
Utils.hpp:41
dunedaq::fddetdataformats::set_adc_2d_as_1d
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:95
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::header
Header header
Definition
DAPHNEEthStreamFrame.hpp:108
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::adc_words
word_t adc_words[s_num_adc_words]
Definition
DAPHNEEthStreamFrame.hpp:109
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::s_num_channels
static constexpr int s_num_channels
Definition
DAPHNEEthStreamFrame.hpp:53
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::get_channel
uint8_t get_channel(const int i_channel) const
Get the channel identifier of the frame.
Definition
DAPHNEEthStreamFrame.hxx:5
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::set_channel
void set_channel(const int i_channel, const uint8_t new_channel_val)
Set the channel identifier of the frame.
Definition
DAPHNEEthStreamFrame.hxx:16
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::get_adc
uint16_t get_adc(int i_adc, int i_channel) const
Get the i_adc-th ADC value of i_channel-th channel in the frame.
Definition
DAPHNEEthStreamFrame.hxx:28
dunedaq::fddetdataformats::DAPHNEEthStreamFrame::set_adc
void set_adc(int i_adc, int i_channel, uint16_t val)
Set the i_adc-th ADC value of i_channel-th channel in the frame to val.
Definition
DAPHNEEthStreamFrame.hxx:37
Generated on
for DUNE-DAQ by
1.17.0