DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter Struct Reference

#include <DUNEWIBEthTypeAdapter.hpp>

Public Types

using FrameType = dunedaq::fddetdataformats::WIBEthFrame
 

Public Member Functions

bool operator< (const DUNEWIBEthTypeAdapter &other) const
 
uint64_t get_timestamp () const
 
void set_timestamp (uint64_t ts)
 
void fake_timestamps (uint64_t first_timestamp, uint64_t=2048)
 
void fake_geoid (uint16_t crate_id, uint16_t slot_id, uint16_t stream_id)
 
void fake_adc_pattern (int channel)
 
void fake_frame_errors (std::vector< uint16_t > *)
 
FrameTypebegin ()
 
FrameTypeend ()
 
size_t get_payload_size ()
 
size_t get_num_frames ()
 
size_t get_frame_size ()
 

Public Attributes

char data [kDUNEWIBEthSize]
 

Static Public Attributes

static const constexpr size_t fixed_payload_size = 7200
 
static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kWIBEth
 
static const constexpr uint64_t expected_tick_difference = 2048
 
static const constexpr uint64_t samples_per_frame = 64
 
static const constexpr uint64_t samples_tick_difference = 32
 

Detailed Description

Definition at line 23 of file DUNEWIBEthTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

FrameType * dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::begin ( )
inline

Definition at line 74 of file DUNEWIBEthTypeAdapter.hpp.

75 {
76 return reinterpret_cast<FrameType*>(&data[0]); // NOLINT
77 }

◆ end()

FrameType * dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::end ( )
inline

Definition at line 79 of file DUNEWIBEthTypeAdapter.hpp.

80 {
81 return reinterpret_cast<FrameType*>(data + kDUNEWIBEthSize); // NOLINT
82 }
const constexpr std::size_t kDUNEWIBEthSize
For WIBEth the numbers are different. Header + (64 channels * 64 time slices) = 7200[Bytes].

◆ fake_adc_pattern()

void dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fake_adc_pattern ( int channel)
inline

Definition at line 62 of file DUNEWIBEthTypeAdapter.hpp.

62 {
63 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
64 // Set the ADC to the uint16 maximum value
65 // AAA: setting only the first time sample
66 frame->set_adc(channel, 0, 16383);
67 }
void set_adc(int i, int sample, uint16_t val)
Set the ith ADC value in the frame to val.

◆ fake_frame_errors()

void dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fake_frame_errors ( std::vector< uint16_t > * )
inline

Definition at line 69 of file DUNEWIBEthTypeAdapter.hpp.

70 {
71 // Set error bits in header
72 }

◆ fake_geoid()

void dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fake_geoid ( uint16_t crate_id,
uint16_t slot_id,
uint16_t stream_id )
inline

Definition at line 53 of file DUNEWIBEthTypeAdapter.hpp.

53 {
54 for (unsigned int i = 0; i < get_num_frames(); ++i) {
55 auto df = reinterpret_cast<FrameType*>((reinterpret_cast<uint8_t*>(&data)) + i * get_frame_size());
57 df->daq_header.slot_id = slot_id;
58 df->daq_header.stream_id = stream_id;
59 }
60 }
detdataformats::DAQEthHeader daq_header

◆ fake_timestamps()

void dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fake_timestamps ( uint64_t first_timestamp,
uint64_t = 2048 )
inline

Definition at line 47 of file DUNEWIBEthTypeAdapter.hpp.

48 {
49 auto wef = reinterpret_cast<FrameType*>(((uint8_t*)(&data))); // NOLINT
50 wef->set_timestamp(first_timestamp);
51 }
void set_timestamp(const uint64_t new_timestamp)
Set the starting 64-bit timestamp of the frame.

◆ get_frame_size()

size_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::get_frame_size ( )
inline

Definition at line 88 of file DUNEWIBEthTypeAdapter.hpp.

88{ return kDUNEWIBEthSize; }

◆ get_num_frames()

size_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::get_num_frames ( )
inline

Definition at line 86 of file DUNEWIBEthTypeAdapter.hpp.

86{ return 1; }

◆ get_payload_size()

size_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::get_payload_size ( )
inline

Definition at line 84 of file DUNEWIBEthTypeAdapter.hpp.

84{ return kDUNEWIBEthSize; }

◆ get_timestamp()

uint64_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::get_timestamp ( ) const
inline

Definition at line 36 of file DUNEWIBEthTypeAdapter.hpp.

37 {
38 return reinterpret_cast<const FrameType*>(&data)->get_timestamp(); // NOLINT
39 }

◆ operator<()

bool dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::operator< ( const DUNEWIBEthTypeAdapter & other) const
inline

Definition at line 29 of file DUNEWIBEthTypeAdapter.hpp.

30 {
31 auto thisptr = reinterpret_cast<const FrameType*>(&data); // NOLINT
32 auto otherptr = reinterpret_cast<const FrameType*>(&other.data); // NOLINT
33 return thisptr->get_timestamp() < otherptr->get_timestamp() ? true : false;
34 }
uint64_t get_timestamp() const
Get the starting 64-bit timestamp of the frame.

◆ set_timestamp()

void dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::set_timestamp ( uint64_t ts)
inline

Definition at line 41 of file DUNEWIBEthTypeAdapter.hpp.

42 {
43 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
44 frame->set_timestamp(ts);
45 }
PDS Frame with unphysical timestamp detected with ts

Member Data Documentation

◆ data

char dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::data[kDUNEWIBEthSize]

Definition at line 27 of file DUNEWIBEthTypeAdapter.hpp.

◆ expected_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::expected_tick_difference = 2048
staticconstexpr

Definition at line 93 of file DUNEWIBEthTypeAdapter.hpp.

◆ fixed_payload_size

const constexpr size_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fixed_payload_size = 7200
staticconstexpr

Definition at line 90 of file DUNEWIBEthTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::fragment_type = daqdataformats::FragmentType::kWIBEth
staticconstexpr

Definition at line 92 of file DUNEWIBEthTypeAdapter.hpp.

◆ samples_per_frame

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::samples_per_frame = 64
staticconstexpr

Definition at line 94 of file DUNEWIBEthTypeAdapter.hpp.

◆ samples_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::samples_tick_difference = 32
staticconstexpr

Definition at line 95 of file DUNEWIBEthTypeAdapter.hpp.

◆ subsystem

const constexpr daqdataformats::SourceID::Subsystem dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter::subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
staticconstexpr

Definition at line 91 of file DUNEWIBEthTypeAdapter.hpp.


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