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

#include <TDEFrameTypeAdapter.hpp>

Collaboration diagram for dunedaq::fdreadoutlibs::types::TDEFrameTypeAdapter:
[legend]

Public Types

using FrameType = dunedaq::fddetdataformats::TDE16Frame
 

Public Member Functions

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

Public Attributes

FrameType data
 

Static Public Attributes

static const constexpr daqdataformats::SourceID::Subsystem subsystem = daqdataformats::SourceID::Subsystem::kDetectorReadout
 
static const constexpr daqdataformats::FragmentType fragment_type = daqdataformats::FragmentType::kTDE_AMC
 
static const constexpr uint64_t expected_tick_difference = dunedaq::fddetdataformats::ticks_between_adc_samples * dunedaq::fddetdataformats::tot_adc16_samples
 

Detailed Description

Definition at line 19 of file TDEFrameTypeAdapter.hpp.

Member Typedef Documentation

◆ FrameType

Member Function Documentation

◆ begin()

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

Definition at line 74 of file TDEFrameTypeAdapter.hpp.

75 {
76 return &data; // NOLINT
77 }

◆ end()

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

Definition at line 79 of file TDEFrameTypeAdapter.hpp.

80 {
81 return (reinterpret_cast<FrameType*>(reinterpret_cast<char*>(&data)+kTDEFrameSize)); // NOLINT
82 }
const constexpr std::size_t kTDEFrameSize
dunedaq::fddetdataformats::TDE16Frame FrameType

◆ fake_adc_pattern()

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

Definition at line 61 of file TDEFrameTypeAdapter.hpp.

61 {
62 }

◆ fake_frame_errors()

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

Definition at line 64 of file TDEFrameTypeAdapter.hpp.

65 {
66 }

◆ fake_geoid()

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

Definition at line 53 of file TDEFrameTypeAdapter.hpp.

53 {
54 for (unsigned int i = 0; i < get_num_frames(); ++i) {
55 auto df = reinterpret_cast<FrameType*>((reinterpret_cast<uint8_t*>(&data)) + i * get_frame_size());
57 df->get_daq_header()->slot_id = slot_id;
58 }
59 }
const detdataformats::DAQEthHeader * get_daq_header() const

◆ fake_timestamps()

void dunedaq::fdreadoutlibs::types::TDEFrameTypeAdapter::fake_timestamps ( uint64_t first_timestamp,
uint64_t  )
inline

Definition at line 48 of file TDEFrameTypeAdapter.hpp.

49 {
50 data.set_timestamp(first_timestamp);
51 }
void set_timestamp(const uint64_t new_timestamp)

◆ get_frame_size()

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

Definition at line 72 of file TDEFrameTypeAdapter.hpp.

72{ return sizeof(FrameType); }

◆ get_num_frames()

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

Definition at line 70 of file TDEFrameTypeAdapter.hpp.

70{ return 1; }

◆ get_payload_size()

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

Definition at line 68 of file TDEFrameTypeAdapter.hpp.

68{ return sizeof(FrameType); }

◆ get_timestamp()

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

Definition at line 38 of file TDEFrameTypeAdapter.hpp.

39 {
40 return data.get_timestamp(); // NOLINT
41 }

◆ operator<()

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

Definition at line 27 of file TDEFrameTypeAdapter.hpp.

28 {
29 uint64_t ts = data.get_timestamp();
30 uint32_t ch = data.get_channel();
31 uint64_t ots = other.data.get_timestamp();
32 //uint32_t och = 0xffff;
33 uint32_t och = other.data.get_channel();;
34
35 return std::tie(ts,ch) < std::tie(ots,och);
36 }
PDS Frame with unphysical timestamp detected with ch
PDS Frame with unphysical timestamp detected with ts

◆ set_timestamp()

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

Definition at line 43 of file TDEFrameTypeAdapter.hpp.

44 {
45 data.set_timestamp(ts); // NOLINT
46 }

Member Data Documentation

◆ data

FrameType dunedaq::fdreadoutlibs::types::TDEFrameTypeAdapter::data

Definition at line 25 of file TDEFrameTypeAdapter.hpp.

◆ expected_tick_difference

const constexpr uint64_t dunedaq::fdreadoutlibs::types::TDEFrameTypeAdapter::expected_tick_difference = dunedaq::fddetdataformats::ticks_between_adc_samples * dunedaq::fddetdataformats::tot_adc16_samples
staticconstexpr

Definition at line 86 of file TDEFrameTypeAdapter.hpp.

◆ fragment_type

const constexpr daqdataformats::FragmentType dunedaq::fdreadoutlibs::types::TDEFrameTypeAdapter::fragment_type = daqdataformats::FragmentType::kTDE_AMC
staticconstexpr

Definition at line 85 of file TDEFrameTypeAdapter.hpp.

◆ subsystem

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

Definition at line 84 of file TDEFrameTypeAdapter.hpp.


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