DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData Struct Reference

#include <DAPHNEFrame.hpp>

Public Member Functions

bool is_found (int idx) const
 Get the Found value for a specific peak (channel) from the trailer. (Word 2*idx, bit 31).
void set_found (uint8_t val, int idx)
 Set the Found value for a specific peak (channel) in the trailer.
uint32_t get_adc_integral (int idx) const
 Get the ADC_Integral value for a specific peak. (Word 2*idx, bits [30:8]).
void set_adc_integral (uint32_t val, int idx)
 Set the ADC_Integral value for a specific peak.
uint8_t get_num_subpeaks (int idx) const
 Get the Num_SubPeaks value for a specific peak. (Word 2*idx, bits [3:0]).
void set_num_subpeaks (uint8_t val, int idx)
 Set the Num_SubPeaks value for a specific peak.
uint16_t get_samples_over_baseline (int idx) const
 Get the Time_Over_Baseline value for a specific peak. (Word 2*idx+1, bits [8:0]).
void set_samples_over_baseline (uint16_t val, int idx)
uint16_t get_sample_max (int idx) const
 Get the Time_Peak value for a specific peak. (Word 2*idx+1, bits [17:9]).
void set_sample_max (uint16_t val, int idx)
 Set the Time_Peak value for a specific peak.
uint16_t get_adc_max (int idx) const
 Get the ADC Max value for a specific peak. (Word 2*idx+1, bits [31:18]).
void set_adc_max (uint16_t val, int idx)
 Set the ADC Max value for a specific peak.
uint16_t get_sample_start (int idx) const
 Get the Time_Start value for a given index (0-4).
void set_sample_start (uint16_t val, int idx)
 Set the time_start field for Peak index 0–4 using bit shifts.
const word_tas_words () const
word_tas_words ()

Public Attributes

word_t num_subpeaks_0: 4
word_t reserved_0: 4
word_t adc_integral_0: 23
word_t found_0: 1
word_t adc_max_0: 14
word_t sample_max_0: 9
word_t samples_over_baseline_0: 9
word_t num_subpeaks_1: 4
word_t reserved_1: 4
word_t adc_integral_1: 23
word_t found_1: 1
word_t adc_max_1: 14
word_t sample_max_1: 9
word_t samples_over_baseline_1: 9
word_t num_subpeaks_2: 4
word_t reserved_2: 4
word_t adc_integral_2: 23
word_t found_2: 1
word_t adc_max_2: 14
word_t sample_max_2: 9
word_t samples_over_baseline_2: 9
word_t num_subpeaks_3: 4
word_t reserved_3: 4
word_t adc_integral_3: 23
word_t found_3: 1
word_t adc_max_3: 14
word_t sample_max_3: 9
word_t samples_over_baseline_3: 9
word_t num_subpeaks_4: 4
word_t reserved_4: 4
word_t adc_integral_4: 23
word_t found_4: 1
word_t adc_max_4: 14
word_t sample_max_4: 9
word_t samples_over_baseline_4: 9
word_t samples_start_2: 10
word_t samples_start_1: 10
word_t samples_start_0: 10
word_t reserved_5: 2
word_t reserved_6: 12
word_t samples_start_4: 10
word_t samples_start_3: 10
word_t trailer

Static Public Attributes

static const uint8_t max_peaks = 5

Detailed Description

Definition at line 53 of file DAPHNEFrame.hpp.

Member Function Documentation

◆ as_words() [1/2]

word_t * dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::as_words ( )
inline

Definition at line 234 of file DAPHNEFrame.hpp.

235 {
236 return reinterpret_cast<word_t*>(this); // NOLINT
237 }

◆ as_words() [2/2]

const word_t * dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::as_words ( ) const
inline

Definition at line 230 of file DAPHNEFrame.hpp.

231 {
232 return reinterpret_cast<const word_t*>(this); // NOLINT
233 }

◆ get_adc_integral()

uint32_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_adc_integral ( int idx) const
inline

Get the ADC_Integral value for a specific peak. (Word 2*idx, bits [30:8]).

Definition at line 43 of file DAPHNEFrame.hxx.

44{
45 if (idx < 0 || idx > 4)
46 throw std::out_of_range("Peak index out of range (must be 0-4)");
47 const word_t* tw = as_words();
48 return (tw[2 * idx] >> 8) & 0x7FFFFF; // Mask 23 bits // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
49}

◆ get_adc_max()

uint16_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_adc_max ( int idx) const
inline

Get the ADC Max value for a specific peak. (Word 2*idx+1, bits [31:18]).

Definition at line 128 of file DAPHNEFrame.hxx.

129{
130 if (idx < 0 || idx > 4)
131 throw std::out_of_range("Peak index out of range (must be 0-4)");
132 const word_t* tw = as_words();
133 // Even word for idx is at index 2*idx+1; ADC Max is in bits 13:0.
134 return static_cast<uint16_t>(tw[2 * idx + 1] & 0x3FFF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
135}

◆ get_num_subpeaks()

uint8_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_num_subpeaks ( int idx) const
inline

Get the Num_SubPeaks value for a specific peak. (Word 2*idx, bits [3:0]).

Definition at line 64 of file DAPHNEFrame.hxx.

65{
66 if (idx < 0 || idx > 4)
67 throw std::out_of_range("Peak index out of range (must be 0-4)");
68 const word_t* tw = as_words();
69 return static_cast<uint8_t>(tw[2 * idx] & 0xF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
70}

◆ get_sample_max()

uint16_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_sample_max ( int idx) const
inline

Get the Time_Peak value for a specific peak. (Word 2*idx+1, bits [17:9]).

Definition at line 106 of file DAPHNEFrame.hxx.

107{
108 if (idx < 0 || idx > 4)
109 throw std::out_of_range("Peak index out of range (must be 0-4)");
110 const word_t* tw = as_words();
111 return static_cast<uint16_t>((tw[2 * idx + 1] >> 14) & // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
112 0x1FF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
113}

◆ get_sample_start()

uint16_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_sample_start ( int idx) const
inline

Get the Time_Start value for a given index (0-4).

For indices 0,1,2 these are stored in trailer word 11 (index 10):

  • index 0: bits [9:0]
  • index 1: bits [19:10]
  • index 2: bits [29:20]

For indices 3,4 these are stored in trailer word 12 (index 11):

  • index 3: bits [9:0]
  • index 4: bits [19:10]

Definition at line 150 of file DAPHNEFrame.hxx.

151{
152 if (idx < 0 || idx > 4)
153 throw std::out_of_range("Time_Start index out of range (must be 0-4)");
154
155 const word_t* tw = as_words();
156 if (idx < 3) {
157 int shift = 22 - 10 * idx;
158 return static_cast<uint16_t>((tw[10] >> shift) & 0x3FF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
159 } else {
160 int shift = 22 - 10 * (idx - 3);
161 return static_cast<uint16_t>((tw[11] >> shift) & 0x3FF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
162 }
163}

◆ get_samples_over_baseline()

uint16_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::get_samples_over_baseline ( int idx) const
inline

Get the Time_Over_Baseline value for a specific peak. (Word 2*idx+1, bits [8:0]).

Definition at line 84 of file DAPHNEFrame.hxx.

85{
86 if (idx < 0 || idx > 4)
87 throw std::out_of_range("Peak index out of range (must be 0-4)");
88 const word_t* tw = as_words();
89 return static_cast<uint16_t>((tw[2 * idx + 1] >> 23) & // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
90 0x1FF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
91}

◆ is_found()

bool dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::is_found ( int idx) const
inline

Get the Found value for a specific peak (channel) from the trailer. (Word 2*idx, bit 31).

Definition at line 21 of file DAPHNEFrame.hxx.

22{
23 if (idx < 0 || idx > 4)
24 throw std::out_of_range("Peak index out of range (must be 0-4)");
25 const word_t* tw = as_words();
26 // In odd word, Found is in bit 31.
27 return static_cast<uint8_t>((tw[2 * idx] >> 31) & 0x1); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
28}

◆ set_adc_integral()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_adc_integral ( uint32_t val,
int idx )
inline

Set the ADC_Integral value for a specific peak.

Definition at line 52 of file DAPHNEFrame.hxx.

53{
54 if (idx < 0 || idx > 4)
55 throw std::out_of_range("Peak index out of range (must be 0-4)");
56 if (val > 0x7FFFFF)
57 throw std::out_of_range("ADC_Integral value out of range (must be 0-8388607)");
58 word_t* tw = as_words();
59 tw[2 * idx] = (tw[2 * idx] & ~(0x7FFFFFu << 8)) | // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
60 ((val & 0x7FFFFF) << 8); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
61}

◆ set_adc_max()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_adc_max ( uint16_t val,
int idx )
inline

Set the ADC Max value for a specific peak.

Definition at line 138 of file DAPHNEFrame.hxx.

139{
140 if (idx < 0 || idx > 4)
141 throw std::out_of_range("Peak index out of range (must be 0-4)");
142 if (val > 0x3FFF)
143 throw std::out_of_range("ADC Max value out of range (must be 0-16383)");
144 word_t* tw = as_words();
145 tw[2 * idx + 1] = // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
146 (tw[2 * idx + 1] & ~0x3FFFu) | (val & 0x3FFF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
147}

◆ set_found()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_found ( uint8_t val,
int idx )
inline

Set the Found value for a specific peak (channel) in the trailer.

Definition at line 31 of file DAPHNEFrame.hxx.

32{
33 if (idx < 0 || idx > 4)
34 throw std::out_of_range("peak index out of range (must be 0-4)");
35 if (val > 1)
36 throw std::out_of_range("Found value out of range (must be 0-1)");
37 word_t* tw = as_words();
38 tw[2 * idx] = // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
39 (tw[2 * idx] & ~(1u << 31)) | ((val & 0x1) << 31); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
40}

◆ set_num_subpeaks()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_num_subpeaks ( uint8_t val,
int idx )
inline

Set the Num_SubPeaks value for a specific peak.

Definition at line 73 of file DAPHNEFrame.hxx.

74{
75 if (idx < 0 || idx > 4)
76 throw std::out_of_range("Peak index out of range (must be 0-4)");
77 if (val > 0xF)
78 throw std::out_of_range("Num_SubPeaks value out of range (must be 0-15)");
79 word_t* tw = as_words();
80 tw[2 * idx] = (tw[2 * idx] & ~0xF) | (val & 0xF); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
81}

◆ set_sample_max()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_sample_max ( uint16_t val,
int idx )
inline

Set the Time_Peak value for a specific peak.

Definition at line 116 of file DAPHNEFrame.hxx.

117{
118 if (idx < 0 || idx > 4)
119 throw std::out_of_range("Peak index out of range (must be 0-4)");
120 if (val > 0x1FF)
121 throw std::out_of_range("Time_Peak value out of range (must be 0-511)");
122 word_t* tw = as_words();
123 tw[2 * idx + 1] = (tw[2 * idx + 1] & ~(0x1FFu << 14)) | // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
124 ((val & 0x1FF) << 14); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
125}

◆ set_sample_start()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_sample_start ( uint16_t val,
int idx )
inline

Set the time_start field for Peak index 0–4 using bit shifts.

Trailer word 11 (index 10):

  • idx 0: bits [31:22]
  • idx 1: bits [21:12]
  • idx 2: bits [11:2] Trailer word 12 (index 11):
  • idx 3: bits [31:22]
  • idx 4: bits [21:12]

Definition at line 166 of file DAPHNEFrame.hxx.

167{
168 if (idx < 0 || idx > 4)
169 throw std::out_of_range("Time_Start index out of range (must be 0–4)");
170 if (val > 0x3FF)
171 throw std::out_of_range("Time_Start value out of range (must be 0–1023)");
172
173 word_t* tw = as_words();
174 word_t mask = 0x3FFu;
175
176 if (idx < 3) {
177 int shift = 22 - 10 * idx;
178 tw[10] = // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
179 (tw[10] & ~(mask << shift)) | ((val & mask) << shift); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
180 } else {
181 int shift = 22 - 10 * (idx - 3);
182 tw[11] = // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
183 (tw[11] & ~(mask << shift)) | ((val & mask) << shift); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
184 }
185}

◆ set_samples_over_baseline()

void dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::set_samples_over_baseline ( uint16_t val,
int idx )
inline

Definition at line 94 of file DAPHNEFrame.hxx.

95{
96 if (idx < 0 || idx > 4)
97 throw std::out_of_range("Peak index out of range (must be 0-4)");
98 if (val > 0x1FF)
99 throw std::out_of_range("Time_Over_Baseline value out of range (must be 0-511)");
100 word_t* tw = as_words();
101 tw[2 * idx + 1] = (tw[2 * idx + 1] & ~(0x1FFu << 23)) | // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
102 ((val & 0x1FF) << 23); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
103}

Member Data Documentation

◆ adc_integral_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_integral_0

Definition at line 64 of file DAPHNEFrame.hpp.

◆ adc_integral_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_integral_1

Definition at line 79 of file DAPHNEFrame.hpp.

◆ adc_integral_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_integral_2

Definition at line 90 of file DAPHNEFrame.hpp.

◆ adc_integral_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_integral_3

Definition at line 101 of file DAPHNEFrame.hpp.

◆ adc_integral_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_integral_4

Definition at line 112 of file DAPHNEFrame.hpp.

◆ adc_max_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_max_0

Definition at line 72 of file DAPHNEFrame.hpp.

◆ adc_max_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_max_1

Definition at line 83 of file DAPHNEFrame.hpp.

◆ adc_max_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_max_2

Definition at line 94 of file DAPHNEFrame.hpp.

◆ adc_max_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_max_3

Definition at line 105 of file DAPHNEFrame.hpp.

◆ adc_max_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::adc_max_4

Definition at line 116 of file DAPHNEFrame.hpp.

◆ found_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::found_0

Definition at line 65 of file DAPHNEFrame.hpp.

◆ found_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::found_1

Definition at line 80 of file DAPHNEFrame.hpp.

◆ found_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::found_2

Definition at line 91 of file DAPHNEFrame.hpp.

◆ found_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::found_3

Definition at line 102 of file DAPHNEFrame.hpp.

◆ found_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::found_4

Definition at line 113 of file DAPHNEFrame.hpp.

◆ max_peaks

const uint8_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::max_peaks = 5
static

Definition at line 143 of file DAPHNEFrame.hpp.

◆ num_subpeaks_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::num_subpeaks_0

Definition at line 62 of file DAPHNEFrame.hpp.

◆ num_subpeaks_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::num_subpeaks_1

Definition at line 77 of file DAPHNEFrame.hpp.

◆ num_subpeaks_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::num_subpeaks_2

Definition at line 88 of file DAPHNEFrame.hpp.

◆ num_subpeaks_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::num_subpeaks_3

Definition at line 99 of file DAPHNEFrame.hpp.

◆ num_subpeaks_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::num_subpeaks_4

Definition at line 110 of file DAPHNEFrame.hpp.

◆ reserved_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_0

Definition at line 63 of file DAPHNEFrame.hpp.

◆ reserved_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_1

Definition at line 78 of file DAPHNEFrame.hpp.

◆ reserved_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_2

Definition at line 89 of file DAPHNEFrame.hpp.

◆ reserved_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_3

Definition at line 100 of file DAPHNEFrame.hpp.

◆ reserved_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_4

Definition at line 111 of file DAPHNEFrame.hpp.

◆ reserved_5

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_5

Definition at line 129 of file DAPHNEFrame.hpp.

◆ reserved_6

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::reserved_6

Definition at line 136 of file DAPHNEFrame.hpp.

◆ sample_max_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::sample_max_0

Definition at line 73 of file DAPHNEFrame.hpp.

◆ sample_max_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::sample_max_1

Definition at line 84 of file DAPHNEFrame.hpp.

◆ sample_max_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::sample_max_2

Definition at line 95 of file DAPHNEFrame.hpp.

◆ sample_max_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::sample_max_3

Definition at line 106 of file DAPHNEFrame.hpp.

◆ sample_max_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::sample_max_4

Definition at line 117 of file DAPHNEFrame.hpp.

◆ samples_over_baseline_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_over_baseline_0

Definition at line 74 of file DAPHNEFrame.hpp.

◆ samples_over_baseline_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_over_baseline_1

Definition at line 85 of file DAPHNEFrame.hpp.

◆ samples_over_baseline_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_over_baseline_2

Definition at line 96 of file DAPHNEFrame.hpp.

◆ samples_over_baseline_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_over_baseline_3

Definition at line 107 of file DAPHNEFrame.hpp.

◆ samples_over_baseline_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_over_baseline_4

Definition at line 118 of file DAPHNEFrame.hpp.

◆ samples_start_0

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_start_0

Definition at line 128 of file DAPHNEFrame.hpp.

◆ samples_start_1

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_start_1

Definition at line 127 of file DAPHNEFrame.hpp.

◆ samples_start_2

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_start_2

Definition at line 126 of file DAPHNEFrame.hpp.

◆ samples_start_3

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_start_3

Definition at line 138 of file DAPHNEFrame.hpp.

◆ samples_start_4

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::samples_start_4

Definition at line 137 of file DAPHNEFrame.hpp.

◆ trailer

word_t dunedaq::fddetdataformats::DAPHNEFrame::PeakDescriptorData::trailer

Definition at line 141 of file DAPHNEFrame.hpp.


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