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

#include <DAPHNESuperChunkTypeAdapter.hpp>

Public Types

using FrameType = dunedaq::fddetdataformats::DAPHNEFrame
 

Public Member Functions

bool operator< (const DAPHNESuperChunkTypeAdapter &other) const
 
uint64_t get_timestamp () const
 
void set_timestamp (uint64_t ts)
 
void fake_timestamps (uint64_t first_timestamp, uint64_t offset=expected_tick_difference)
 
void fake_geoid (uint16_t crate_id, uint16_t slot_id, uint16_t link_id)
 
void fake_adc_pattern (int)
 
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 [kDAPHNESuperChunkSize]
 

Static Public Attributes

static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kDAPHNE
 
static const constexpr uint64_t expected_tick_difference = 1024
 

Detailed Description

Definition at line 25 of file DAPHNESuperChunkTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 79 of file DAPHNESuperChunkTypeAdapter.hpp.

80 {
81 return reinterpret_cast<FrameType*>(&data[0]); // NOLINT
82 }

◆ end()

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

Definition at line 84 of file DAPHNESuperChunkTypeAdapter.hpp.

85 {
86 return reinterpret_cast<FrameType*>(data + kDAPHNESuperChunkSize); // NOLINT
87 }
const constexpr std::size_t kDAPHNESuperChunkSize

◆ fake_adc_pattern()

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

Definition at line 71 of file DAPHNESuperChunkTypeAdapter.hpp.

71 {
72 }

◆ fake_frame_errors()

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

Definition at line 74 of file DAPHNESuperChunkTypeAdapter.hpp.

75 {
76 // Set frame error bits in header
77 }

◆ fake_geoid()

void dunedaq::fdreadoutlibs::types::DAPHNESuperChunkTypeAdapter::fake_geoid ( uint16_t crate_id,
uint16_t slot_id,
uint16_t link_id )
inline

Definition at line 62 of file DAPHNESuperChunkTypeAdapter.hpp.

62 {
63 for (unsigned int i = 0; i < get_num_frames(); ++i) {
64 auto df = reinterpret_cast<FrameType*>((reinterpret_cast<uint8_t*>(&data)) + i * get_frame_size());
65 df->daq_header.slot_id = slot_id;
66 df->daq_header.link_id = link_id;
67 df->daq_header.crate_id = crate_id;
68 }
69 }
detdataformats::DAQHeader daq_header

◆ fake_timestamps()

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

Definition at line 51 of file DAPHNESuperChunkTypeAdapter.hpp.

52 {
53 uint64_t ts_next = first_timestamp; // NOLINT(build/unsigned)
54 for (unsigned int i = 0; i < get_num_frames(); ++i) {
55 auto df = reinterpret_cast<dunedaq::fddetdataformats::DAPHNEFrame*>(((uint8_t*)(&data)) + i * get_frame_size()); // NOLINT
56 df->daq_header.timestamp_1 = ts_next;
57 df->daq_header.timestamp_2 = ts_next >> 32;
58 ts_next += offset;
59 }
60 }
double offset

◆ get_frame_size()

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

Definition at line 93 of file DAPHNESuperChunkTypeAdapter.hpp.

93{ return kDAPHNEFrameSize; }
const constexpr std::size_t kDAPHNEFrameSize

◆ get_num_frames()

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

Definition at line 91 of file DAPHNESuperChunkTypeAdapter.hpp.

91{ return kDAPHNENumFrames; }
const constexpr std::size_t kDAPHNENumFrames
For DAPHNE the numbers are different. 12[DAPHNE frames] x 454[32-bit words] x 4[Bytes per word] = 217...

◆ get_payload_size()

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

Definition at line 89 of file DAPHNESuperChunkTypeAdapter.hpp.

89{ return get_num_frames() * get_frame_size(); }

◆ get_timestamp()

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

Definition at line 39 of file DAPHNESuperChunkTypeAdapter.hpp.

◆ operator<()

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

Definition at line 31 of file DAPHNESuperChunkTypeAdapter.hpp.

32 {
33 auto thisptr = reinterpret_cast<const dunedaq::fddetdataformats::DAPHNEFrame*>(&data); // NOLINT
34 auto otherptr = reinterpret_cast<const dunedaq::fddetdataformats::DAPHNEFrame*>(&other.data); // NOLINT
35
36 return std::forward_as_tuple(thisptr->get_timestamp(), thisptr->get_channel()) < std::forward_as_tuple(otherptr->get_timestamp(), otherptr->get_channel());
37 }

◆ set_timestamp()

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

Definition at line 44 of file DAPHNESuperChunkTypeAdapter.hpp.

45 {
46 auto frame = reinterpret_cast<dunedaq::fddetdataformats::DAPHNEFrame*>(&data); // NOLINT
47 frame->daq_header.timestamp_1 = ts;
48 frame->daq_header.timestamp_2 = ts >> 32;
49 }
PDS Frame with unphysical timestamp detected with ts

Member Data Documentation

◆ data

char dunedaq::fdreadoutlibs::types::DAPHNESuperChunkTypeAdapter::data[kDAPHNESuperChunkSize]

Definition at line 29 of file DAPHNESuperChunkTypeAdapter.hpp.

◆ expected_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::DAPHNESuperChunkTypeAdapter::expected_tick_difference = 1024
staticconstexpr

Definition at line 97 of file DAPHNESuperChunkTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::DAPHNESuperChunkTypeAdapter::fragment_type = daqdataformats::FragmentType::kDAPHNE
staticconstexpr

Definition at line 96 of file DAPHNESuperChunkTypeAdapter.hpp.

◆ subsystem

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

Definition at line 95 of file DAPHNESuperChunkTypeAdapter.hpp.


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