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 float samples_tick_difference = 32
 

Detailed Description

Definition at line 24 of file DUNEWIBEthTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 75 of file DUNEWIBEthTypeAdapter.hpp.

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

◆ end()

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

Definition at line 80 of file DUNEWIBEthTypeAdapter.hpp.

81 {
82 return reinterpret_cast<FrameType*>(data + kDUNEWIBEthSize); // NOLINT
83 }
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 63 of file DUNEWIBEthTypeAdapter.hpp.

63 {
64 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
65 // Set the ADC to the uint16 maximum value
66 // AAA: setting only the first time sample
67 frame->set_adc(channel, 0, 16383);
68 }
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 70 of file DUNEWIBEthTypeAdapter.hpp.

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

◆ 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 54 of file DUNEWIBEthTypeAdapter.hpp.

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

◆ fake_timestamps()

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

Definition at line 48 of file DUNEWIBEthTypeAdapter.hpp.

49 {
50 auto wef = reinterpret_cast<FrameType*>(((uint8_t*)(&data))); // NOLINT
51 wef->set_timestamp(first_timestamp);
52 }
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 89 of file DUNEWIBEthTypeAdapter.hpp.

89{ return kDUNEWIBEthSize; }

◆ get_num_frames()

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

Definition at line 87 of file DUNEWIBEthTypeAdapter.hpp.

87{ return 1; }

◆ get_payload_size()

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

Definition at line 85 of file DUNEWIBEthTypeAdapter.hpp.

85{ return kDUNEWIBEthSize; }

◆ get_timestamp()

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

Definition at line 37 of file DUNEWIBEthTypeAdapter.hpp.

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

◆ operator<()

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

Definition at line 30 of file DUNEWIBEthTypeAdapter.hpp.

31 {
32 auto thisptr = reinterpret_cast<const FrameType*>(&data); // NOLINT
33 auto otherptr = reinterpret_cast<const FrameType*>(&other.data); // NOLINT
34 return thisptr->get_timestamp() < otherptr->get_timestamp() ? true : false;
35 }
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 42 of file DUNEWIBEthTypeAdapter.hpp.

43 {
44 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
45 frame->set_timestamp(ts);
46 }

Member Data Documentation

◆ data

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

Definition at line 28 of file DUNEWIBEthTypeAdapter.hpp.

◆ expected_tick_difference

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

Definition at line 94 of file DUNEWIBEthTypeAdapter.hpp.

◆ fixed_payload_size

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

Definition at line 91 of file DUNEWIBEthTypeAdapter.hpp.

◆ fragment_type

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

Definition at line 93 of file DUNEWIBEthTypeAdapter.hpp.

◆ samples_per_frame

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

Definition at line 95 of file DUNEWIBEthTypeAdapter.hpp.

◆ samples_tick_difference

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

Definition at line 96 of file DUNEWIBEthTypeAdapter.hpp.

◆ subsystem

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

Definition at line 92 of file DUNEWIBEthTypeAdapter.hpp.


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