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

#include <DAPHNEEthTypeAdapter.hpp>

Public Types

using FrameType = dunedaq::fddetdataformats::DAPHNEEthFrame
 

Public Member Functions

bool operator< (const DAPHNEEthTypeAdapter &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_frame_errors (std::vector< uint16_t > *)
 
void fake_adc_pattern (int)
 
FrameTypebegin ()
 
FrameTypeend ()
 
size_t get_payload_size ()
 
size_t get_num_frames ()
 
size_t get_frame_size ()
 

Public Attributes

char data [kDAPHNEEthSize]
 

Static Public Attributes

static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kDAPHNEEth
 
static const constexpr uint64_t expected_tick_difference = 1
 

Detailed Description

Definition at line 25 of file DAPHNEEthTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 72 of file DAPHNEEthTypeAdapter.hpp.

73 {
74 return reinterpret_cast<FrameType*>(&data[0]); // NOLINT
75 }
dunedaq::fddetdataformats::DAPHNEEthFrame FrameType

◆ end()

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

Definition at line 77 of file DAPHNEEthTypeAdapter.hpp.

78 {
79 return reinterpret_cast<FrameType*>(data + kDAPHNEEthSize); // NOLINT
80 }
const constexpr std::size_t kDAPHNEEthSize
For DAPHNEEth the numbers are different. Header + (64 channels * 64 time slices) = 233[Bytes].

◆ fake_adc_pattern()

void dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter::fake_adc_pattern ( int )
inline

Definition at line 69 of file DAPHNEEthTypeAdapter.hpp.

69 {
70 }

◆ fake_frame_errors()

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

Definition at line 64 of file DAPHNEEthTypeAdapter.hpp.

65 {
66 // Set error bits in header
67 }

◆ fake_geoid()

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

Definition at line 55 of file DAPHNEEthTypeAdapter.hpp.

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

◆ fake_timestamps()

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

Definition at line 49 of file DAPHNEEthTypeAdapter.hpp.

50 {
51 auto wef = reinterpret_cast<FrameType*>(((uint8_t*)(&data))); // NOLINT
52 wef->set_timestamp(first_timestamp);
53 }
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::DAPHNEEthTypeAdapter::get_frame_size ( )
inline

Definition at line 86 of file DAPHNEEthTypeAdapter.hpp.

86{ return kDAPHNEEthSize; }

◆ get_num_frames()

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

Definition at line 84 of file DAPHNEEthTypeAdapter.hpp.

84{ return 1; }

◆ get_payload_size()

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

Definition at line 82 of file DAPHNEEthTypeAdapter.hpp.

82{ return kDAPHNEEthSize; }

◆ get_timestamp()

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

Definition at line 38 of file DAPHNEEthTypeAdapter.hpp.

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

◆ operator<()

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

Definition at line 30 of file DAPHNEEthTypeAdapter.hpp.

31 {
32 auto thisptr = reinterpret_cast<const dunedaq::fddetdataformats::DAPHNEEthFrame*>(&data); // NOLINT
33 auto otherptr = reinterpret_cast<const dunedaq::fddetdataformats::DAPHNEEthFrame*>(&other.data); // NOLINT
34
35 return std::forward_as_tuple(thisptr->get_timestamp(), thisptr->get_channel()) < std::forward_as_tuple(otherptr->get_timestamp(), otherptr->get_channel());
36 }
Class for accessing raw WIB eth frames, as used in ProtoDUNE-II.

◆ set_timestamp()

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

Definition at line 43 of file DAPHNEEthTypeAdapter.hpp.

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

Member Data Documentation

◆ data

char dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter::data[kDAPHNEEthSize]

Definition at line 28 of file DAPHNEEthTypeAdapter.hpp.

◆ expected_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter::expected_tick_difference = 1
staticconstexpr

Definition at line 90 of file DAPHNEEthTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter::fragment_type = daqdataformats::FragmentType::kDAPHNEEth
staticconstexpr

Definition at line 89 of file DAPHNEEthTypeAdapter.hpp.

◆ subsystem

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

Definition at line 88 of file DAPHNEEthTypeAdapter.hpp.


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