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

Struct for accessing/holding raw CRT data from the 'Bern' panels ProtoDUNE-II VD. More...

#include <CRTBernFrame.hpp>

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

Classes

struct  CRTBernData

Public Types

using word_t = uint64_t

Public Member Functions

uint16_t get_adc (int i_ch) const
 Get the adc value for channel i_ch.
void set_adc (int i_ch, uint16_t val)
 Set the adc value for channel i_ch 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 also set the underlying ts0 to be consistent.
uint16_t get_mac5 () const
void set_mac5 (const uint16_t new_mac5)
uint16_t get_flags () const
void set_flags (const uint16_t new_flags)
uint16_t get_lostcpu () const
 Get the lostcpu counter of the CRTBernData.
void set_lostcpu (const uint16_t new_lostcpu)
 Set the lostcpu counter of the CRTBernData.
uint16_t get_lostfpga () const
 Get the lostfpga counter of the CRTBernData.
void set_lostfpga (const uint16_t new_lostfpga)
 Set the lostfpga counter of the CRTBernData.
uint32_t get_ts0 () const
void set_ts0 (const uint32_t new_ts0)
uint32_t get_ts1 () const
void set_ts1 (const uint32_t new_ts1)
uint32_t get_coinc () const
void set_coinc (const uint32_t new_coinc)

Public Attributes

detdataformats::DAQEthHeader daq_header
uint16_t mac5
CRTBernData data

Static Public Attributes

static constexpr int s_num_channels = 32
static constexpr uint64_t s_DTS_ticks_per_second = 62'500'000
static constexpr uint64_t s_ns_per_DTS_tick = 16
static constexpr std::size_t s_expected_bytes

Detailed Description

Struct for accessing/holding raw CRT data from the 'Bern' panels ProtoDUNE-II VD.

Definition at line 37 of file CRTBernFrame.hpp.

Member Typedef Documentation

◆ word_t

Definition at line 40 of file CRTBernFrame.hpp.

Member Function Documentation

◆ get_adc()

uint16_t dunedaq::fddetdataformats::CRTBernFrame::get_adc ( int i_ch) const
inline

Get the adc value for channel i_ch.

Definition at line 65 of file CRTBernFrame.hpp.

66 {
67 if (i_ch < 0 || i_ch >= s_num_channels)
68 throw std::out_of_range("ADC channel index out of range");
69
70 return data.adc[i_ch];
71 }

◆ get_coinc()

uint32_t dunedaq::fddetdataformats::CRTBernFrame::get_coinc ( ) const
inline

Definition at line 122 of file CRTBernFrame.hpp.

122{ return data.coinc; }

◆ get_flags()

uint16_t dunedaq::fddetdataformats::CRTBernFrame::get_flags ( ) const
inline

Definition at line 98 of file CRTBernFrame.hpp.

98{ return data.flags; }

◆ get_lostcpu()

uint16_t dunedaq::fddetdataformats::CRTBernFrame::get_lostcpu ( ) const
inline

Get the lostcpu counter of the CRTBernData.

Definition at line 103 of file CRTBernFrame.hpp.

103{ return data.lostcpu; }

◆ get_lostfpga()

uint16_t dunedaq::fddetdataformats::CRTBernFrame::get_lostfpga ( ) const
inline

Get the lostfpga counter of the CRTBernData.

Definition at line 109 of file CRTBernFrame.hpp.

109{ return data.lostfpga; }

◆ get_mac5()

uint16_t dunedaq::fddetdataformats::CRTBernFrame::get_mac5 ( ) const
inline

Definition at line 94 of file CRTBernFrame.hpp.

◆ get_timestamp()

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

Get the starting 64-bit timestamp of the frame.

Definition at line 83 of file CRTBernFrame.hpp.

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

◆ get_ts0()

uint32_t dunedaq::fddetdataformats::CRTBernFrame::get_ts0 ( ) const
inline

Definition at line 114 of file CRTBernFrame.hpp.

114{ return data.ts0; }

◆ get_ts1()

uint32_t dunedaq::fddetdataformats::CRTBernFrame::get_ts1 ( ) const
inline

Definition at line 118 of file CRTBernFrame.hpp.

118{ return data.ts1; }

◆ set_adc()

void dunedaq::fddetdataformats::CRTBernFrame::set_adc ( int i_ch,
uint16_t val )
inline

Set the adc value for channel i_ch to val.

Definition at line 74 of file CRTBernFrame.hpp.

75 {
76 if (i_ch < 0 || i_ch >= s_num_channels)
77 throw std::out_of_range("ADC channel index out of range");
78
79 data.adc[i_ch] = val; // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
80 }

◆ set_coinc()

void dunedaq::fddetdataformats::CRTBernFrame::set_coinc ( const uint32_t new_coinc)
inline

Definition at line 124 of file CRTBernFrame.hpp.

124{ data.coinc = new_coinc; }

◆ set_flags()

void dunedaq::fddetdataformats::CRTBernFrame::set_flags ( const uint16_t new_flags)
inline

Definition at line 100 of file CRTBernFrame.hpp.

100{ data.flags = new_flags; }

◆ set_lostcpu()

void dunedaq::fddetdataformats::CRTBernFrame::set_lostcpu ( const uint16_t new_lostcpu)
inline

Set the lostcpu counter of the CRTBernData.

Definition at line 106 of file CRTBernFrame.hpp.

106{ data.lostcpu = new_lostcpu; }

◆ set_lostfpga()

void dunedaq::fddetdataformats::CRTBernFrame::set_lostfpga ( const uint16_t new_lostfpga)
inline

Set the lostfpga counter of the CRTBernData.

Definition at line 112 of file CRTBernFrame.hpp.

112{ data.lostfpga = new_lostfpga; }

◆ set_mac5()

void dunedaq::fddetdataformats::CRTBernFrame::set_mac5 ( const uint16_t new_mac5)
inline

Definition at line 96 of file CRTBernFrame.hpp.

96{ mac5 = new_mac5; }

◆ set_timestamp()

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

Set the starting 64-bit timestamp of the frame also set the underlying ts0 to be consistent.

Definition at line 88 of file CRTBernFrame.hpp.

89 {
90 daq_header.timestamp = new_timestamp;
91 data.ts0 = (new_timestamp % s_DTS_ticks_per_second) * s_ns_per_DTS_tick;
92 }
static constexpr uint64_t s_ns_per_DTS_tick
static constexpr uint64_t s_DTS_ticks_per_second

◆ set_ts0()

void dunedaq::fddetdataformats::CRTBernFrame::set_ts0 ( const uint32_t new_ts0)
inline

Definition at line 116 of file CRTBernFrame.hpp.

116{ data.ts0 = new_ts0; }

◆ set_ts1()

void dunedaq::fddetdataformats::CRTBernFrame::set_ts1 ( const uint32_t new_ts1)
inline

Definition at line 120 of file CRTBernFrame.hpp.

120{ data.ts1 = new_ts1; }

Member Data Documentation

◆ daq_header

detdataformats::DAQEthHeader dunedaq::fddetdataformats::CRTBernFrame::daq_header

Definition at line 126 of file CRTBernFrame.hpp.

◆ data

CRTBernData dunedaq::fddetdataformats::CRTBernFrame::data

Definition at line 128 of file CRTBernFrame.hpp.

◆ mac5

uint16_t dunedaq::fddetdataformats::CRTBernFrame::mac5

Definition at line 127 of file CRTBernFrame.hpp.

◆ s_DTS_ticks_per_second

uint64_t dunedaq::fddetdataformats::CRTBernFrame::s_DTS_ticks_per_second = 62'500'000
staticconstexpr

Definition at line 43 of file CRTBernFrame.hpp.

◆ s_expected_bytes

std::size_t dunedaq::fddetdataformats::CRTBernFrame::s_expected_bytes
staticconstexpr
Initial value:
{ sizeof(detdataformats::DAQEthHeader) + sizeof(uint16_t) +
DAQEthHeader is a versioned and unified structure for every FE electronics.

Definition at line 61 of file CRTBernFrame.hpp.

61 { sizeof(detdataformats::DAQEthHeader) + sizeof(uint16_t) +

◆ s_ns_per_DTS_tick

uint64_t dunedaq::fddetdataformats::CRTBernFrame::s_ns_per_DTS_tick = 16
staticconstexpr

Definition at line 44 of file CRTBernFrame.hpp.

◆ s_num_channels

int dunedaq::fddetdataformats::CRTBernFrame::s_num_channels = 32
staticconstexpr

Definition at line 42 of file CRTBernFrame.hpp.


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