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

#include <DAPHNEStreamSuperChunkTypeAdapter.hpp>

Public Types

using FrameType = dunedaq::fddetdataformats::DAPHNEStreamFrame
 

Public Member Functions

bool operator< (const DAPHNEStreamSuperChunkTypeAdapter &other) const
 
uint64_t get_timestamp () const
 
void set_timestamp (uint64_t ts)
 
void fake_timestamps (uint64_t first_timestamp, uint64_t offset=64)
 
void fake_geoid (uint16_t, uint16_t, uint16_t)
 
void fake_adc_pattern (int)
 
void fake_frame_errors (std::vector< uint16_t > *)
 
FrameTypebegin ()
 
FrameTypeend ()
 
constexpr size_t get_payload_size () const
 
constexpr size_t get_num_frames () const
 
constexpr size_t get_frame_size () const
 

Public Attributes

char data [kDAPHNEStreamSuperChunkSize]
 

Static Public Attributes

static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kDAPHNEStream
 
static const constexpr uint64_t expected_tick_difference = 64
 

Detailed Description

Definition at line 20 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 69 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

70 {
71 return reinterpret_cast<FrameType*>(&data[0]); // NOLINT
72 }

◆ end()

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

Definition at line 74 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

75 {
76 return reinterpret_cast<FrameType*>(data + kDAPHNEStreamSuperChunkSize); // NOLINT
77 }
const constexpr std::size_t kDAPHNEStreamSuperChunkSize

◆ fake_adc_pattern()

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

Definition at line 60 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

60 {
61 }

◆ fake_frame_errors()

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

Definition at line 64 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

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

◆ fake_geoid()

void dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::fake_geoid ( uint16_t ,
uint16_t ,
uint16_t  )
inline

Definition at line 57 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

57 {
58 }

◆ fake_timestamps()

void dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::fake_timestamps ( uint64_t first_timestamp,
uint64_t offset = 64 )
inline

Definition at line 46 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

47 {
48 uint64_t ts_next = first_timestamp; // NOLINT(build/unsigned)
49 for (unsigned int i = 0; i < get_num_frames(); ++i) {
50 auto df = reinterpret_cast<FrameType*>((reinterpret_cast<uint8_t*>(&data)) + i * get_frame_size());
51 df->daq_header.timestamp_1 = ts_next;
52 df->daq_header.timestamp_2 = ts_next >> 32;
53 ts_next += offset;
54 }
55 }
double offset

◆ get_frame_size()

size_t dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::get_frame_size ( ) const
inlineconstexpr

Definition at line 83 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

83{ return kDAPHNEStreamFrameSize; }

◆ get_num_frames()

size_t dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::get_num_frames ( ) const
inlineconstexpr

Definition at line 81 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

81{ return kDAPHNEStreamNumFrames; }
const constexpr std::size_t kDAPHNEStreamNumFrames
For DAPHNE Stream the numbers are similar to DUNE-WIB 12[DAPHNE frames] x 472[Bytes] = 5664[Bytes]

◆ get_payload_size()

size_t dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::get_payload_size ( ) const
inlineconstexpr

Definition at line 79 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

79{ return get_num_frames() * get_frame_size(); } // 12*472 -> 5664

◆ get_timestamp()

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

Definition at line 34 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

35 {
36 return reinterpret_cast<const FrameType*>(&data)->daq_header.get_timestamp(); // NOLINT
37 }

◆ operator<()

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

Definition at line 27 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

28 {
29 auto thisptr = reinterpret_cast<const FrameType*>(&data); // NOLINT
30 auto otherptr = reinterpret_cast<const FrameType*>(&other.data); // NOLINT
31 return thisptr->get_timestamp() < otherptr->get_timestamp() ? true : false;
32 }

◆ set_timestamp()

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

Definition at line 39 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

40 {
41 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
42 frame->daq_header.timestamp_1 = ts;
43 frame->daq_header.timestamp_2 = ts >> 32;
44 }
PDS Frame with unphysical timestamp detected with ts

Member Data Documentation

◆ data

char dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::data[kDAPHNEStreamSuperChunkSize]

Definition at line 24 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

◆ expected_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::expected_tick_difference = 64
staticconstexpr

Definition at line 87 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::DAPHNEStreamSuperChunkTypeAdapter::fragment_type = daqdataformats::FragmentType::kDAPHNEStream
staticconstexpr

Definition at line 86 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.

◆ subsystem

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

Definition at line 85 of file DAPHNEStreamSuperChunkTypeAdapter.hpp.


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