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

#include <CRTBernTypeAdapter.hpp>

Public Types

using FrameType = dunedaq::fddetdataformats::CRTBernFrame
 

Public Member Functions

bool operator< (const CRTBernTypeAdapter &other) const
 
uint64_t get_timestamp () const
 
void set_timestamp (uint64_t ts)
 
void fake_timestamps (uint64_t first_timestamp, uint64_t=expected_tick_difference)
 
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 [kCRTBernFrameSize]
 

Static Public Attributes

static const constexpr size_t fixed_payload_size = kCRTBernFrameSize
 
static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kCRTBern
 
static const constexpr uint64_t expected_tick_difference = 64
 

Detailed Description

Definition at line 20 of file CRTBernTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 66 of file CRTBernTypeAdapter.hpp.

67 {
68 return reinterpret_cast<FrameType*>(&data[0]); // NOLINT
69 }
dunedaq::fddetdataformats::CRTBernFrame FrameType

◆ end()

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

Definition at line 71 of file CRTBernTypeAdapter.hpp.

72 {
73 return reinterpret_cast<FrameType*>(data + kCRTBernFrameSize); // NOLINT
74 }
const constexpr std::size_t kCRTBernFrameSize

◆ fake_adc_pattern()

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

Definition at line 56 of file CRTBernTypeAdapter.hpp.

56 {
57 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
58 frame->set_adc(channel,0xbeef);
59 }
void set_adc(int i_ch, uint16_t val)
Set the adc value for channel i_ch to val.

◆ fake_frame_errors()

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

Definition at line 61 of file CRTBernTypeAdapter.hpp.

62 {
63 // Set frame error bits in header
64 }

◆ fake_geoid()

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

Definition at line 49 of file CRTBernTypeAdapter.hpp.

49 {
50 auto df = reinterpret_cast<FrameType*>(reinterpret_cast<uint8_t*>(&data));
51 df->daq_header.slot_id = slot_id;
52 df->daq_header.stream_id = stream_id;
53 df->daq_header.crate_id = crate_id;
54 }
detdataformats::DAQEthHeader daq_header

◆ fake_timestamps()

void dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter::fake_timestamps ( uint64_t first_timestamp,
uint64_t = expected_tick_difference )
inline

Definition at line 44 of file CRTBernTypeAdapter.hpp.

45 {
46 set_timestamp(first_timestamp);
47 }

◆ get_frame_size()

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

Definition at line 80 of file CRTBernTypeAdapter.hpp.

80{ return kCRTBernFrameSize; }

◆ get_num_frames()

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

Definition at line 78 of file CRTBernTypeAdapter.hpp.

78{ return 1; }

◆ get_payload_size()

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

◆ get_timestamp()

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

Definition at line 33 of file CRTBernTypeAdapter.hpp.

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

◆ operator<()

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

Definition at line 26 of file CRTBernTypeAdapter.hpp.

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

◆ set_timestamp()

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

Definition at line 38 of file CRTBernTypeAdapter.hpp.

39 {
40 auto frame = reinterpret_cast<FrameType*>(&data); // NOLINT
41 frame->set_timestamp(ts);
42 }
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.
PDS Frame with unphysical timestamp detected with ts

Member Data Documentation

◆ data

char dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter::data[kCRTBernFrameSize]

Definition at line 24 of file CRTBernTypeAdapter.hpp.

◆ expected_tick_difference

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

Definition at line 85 of file CRTBernTypeAdapter.hpp.

◆ fixed_payload_size

const constexpr size_t dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter::fixed_payload_size = kCRTBernFrameSize
staticconstexpr

Definition at line 82 of file CRTBernTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter::fragment_type = daqdataformats::FragmentType::kCRTBern
staticconstexpr

Definition at line 84 of file CRTBernTypeAdapter.hpp.

◆ subsystem

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

Definition at line 83 of file CRTBernTypeAdapter.hpp.


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