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)
 Set the Time_Over_Baseline value for a specific peak.
 
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 54 of file DAPHNEFrame.hpp.

Member Function Documentation

◆ as_words() [1/2]

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

Definition at line 173 of file DAPHNEFrame.hpp.

173 {
174 return reinterpret_cast<word_t*>(this);
175 }

◆ as_words() [2/2]

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

Definition at line 170 of file DAPHNEFrame.hpp.

170 {
171 return reinterpret_cast<const word_t*>(this);
172 }

◆ 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 312 of file DAPHNEFrame.hpp.

313{
314 if (idx < 0 || idx > 4)
315 throw std::out_of_range("Peak index out of range (must be 0-4)");
316 const word_t* tw = as_words();
317 return (tw[2*idx] >> 8) & 0x7FFFFF; // Mask 23 bits
318}

◆ 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 421 of file DAPHNEFrame.hpp.

422{
423 if (idx < 0 || idx > 4)
424 throw std::out_of_range("Peak index out of range (must be 0-4)");
425 const word_t* tw = as_words();
426 // Even word for idx is at index 2*idx+1; ADC Max is in bits 13:0.
427 return static_cast<uint16_t>(tw[2*idx+1] & 0x3FFF);
428}

◆ 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 339 of file DAPHNEFrame.hpp.

340{
341 if (idx < 0 || idx > 4)
342 throw std::out_of_range("Peak index out of range (must be 0-4)");
343 const word_t* tw = as_words();
344 return static_cast<uint8_t>(tw[2*idx] & 0xF);
345}

◆ 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 393 of file DAPHNEFrame.hpp.

394{
395 if (idx < 0 || idx > 4)
396 throw std::out_of_range("Peak index out of range (must be 0-4)");
397 const word_t* tw = as_words();
398 return static_cast<uint16_t>((tw[2*idx+1] >> 14) & 0x1FF);
399}

◆ 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 457 of file DAPHNEFrame.hpp.

458{
459 if (idx < 0 || idx > 4)
460 throw std::out_of_range("Time_Start index out of range (must be 0-4)");
461
462 const word_t* tw = as_words();
463 if (idx < 3) {
464 int shift = 22 - 10 * idx;
465 return static_cast<uint16_t>((tw[10] >> shift) & 0x3FF);
466 } else {
467 int shift = 22 - 10 * (idx - 3);
468 return static_cast<uint16_t>((tw[11] >> shift) & 0x3FF);
469 }
470}

◆ 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 366 of file DAPHNEFrame.hpp.

367{
368 if (idx < 0 || idx > 4)
369 throw std::out_of_range("Peak index out of range (must be 0-4)");
370 const word_t* tw = as_words();
371 return static_cast<uint16_t>((tw[2*idx+1] >> 23) & 0x1FF);
372}

◆ 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 284 of file DAPHNEFrame.hpp.

285{
286 if (idx < 0 || idx > 4)
287 throw std::out_of_range("Peak index out of range (must be 0-4)");
288 const word_t* tw = as_words();
289 // In odd word, Found is in bit 31.
290 return static_cast<uint8_t>((tw[2*idx] >> 31) & 0x1);
291}

◆ 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 324 of file DAPHNEFrame.hpp.

325{
326 if (idx < 0 || idx > 4)
327 throw std::out_of_range("Peak index out of range (must be 0-4)");
328 if (val > 0x7FFFFF)
329 throw std::out_of_range("ADC_Integral value out of range (must be 0-8388607)");
330 word_t* tw = as_words();
331 tw[2*idx] = (tw[2*idx] & ~(0x7FFFFFu << 8)) | ((val & 0x7FFFFF) << 8);
332}

◆ 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 434 of file DAPHNEFrame.hpp.

435{
436 if (idx < 0 || idx > 4)
437 throw std::out_of_range("Peak index out of range (must be 0-4)");
438 if (val > 0x3FFF)
439 throw std::out_of_range("ADC Max value out of range (must be 0-16383)");
440 word_t* tw = as_words();
441 tw[2*idx+1] = (tw[2*idx+1] & ~0x3FFFu) | (val & 0x3FFF);
442}

◆ 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 297 of file DAPHNEFrame.hpp.

298{
299 if (idx < 0 || idx > 4)
300 throw std::out_of_range("peak index out of range (must be 0-4)");
301 if (val > 1)
302 throw std::out_of_range("Found value out of range (must be 0-1)");
303 word_t* tw = as_words();
304 tw[2*idx] = (tw[2*idx] & ~(1u << 31)) | ((val & 0x1) << 31);
305}

◆ 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 351 of file DAPHNEFrame.hpp.

352{
353 if (idx < 0 || idx > 4)
354 throw std::out_of_range("Peak index out of range (must be 0-4)");
355 if (val > 0xF)
356 throw std::out_of_range("Num_SubPeaks value out of range (must be 0-15)");
357 word_t* tw = as_words();
358 tw[2*idx] = (tw[2*idx] & ~0xF) | (val & 0xF);
359}

◆ 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 406 of file DAPHNEFrame.hpp.

407{
408 if (idx < 0 || idx > 4)
409 throw std::out_of_range("Peak index out of range (must be 0-4)");
410 if (val > 0x1FF)
411 throw std::out_of_range("Time_Peak value out of range (must be 0-511)");
412 word_t* tw = as_words();
413 tw[2*idx+1] = (tw[2*idx+1] & ~(0x1FFu << 14)) | ((val & 0x1FF) << 14);
414}

◆ 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 484 of file DAPHNEFrame.hpp.

485{
486 if (idx < 0 || idx > 4)
487 throw std::out_of_range("Time_Start index out of range (must be 0–4)");
488 if (val > 0x3FF)
489 throw std::out_of_range("Time_Start value out of range (must be 0–1023)");
490
491 word_t* tw = as_words();
492 word_t mask = 0x3FFu;
493
494 if (idx < 3) {
495 int shift = 22 - 10 * idx;
496 tw[10] = (tw[10] & ~(mask << shift)) | ((val & mask) << shift);
497 } else {
498 int shift = 22 - 10 * (idx - 3);
499 tw[11] = (tw[11] & ~(mask << shift)) | ((val & mask) << shift);
500 }
501}

◆ set_samples_over_baseline()

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

Set the Time_Over_Baseline value for a specific peak.

Definition at line 378 of file DAPHNEFrame.hpp.

379{
380 if (idx < 0 || idx > 4)
381 throw std::out_of_range("Peak index out of range (must be 0-4)");
382 if (val > 0x1FF)
383 throw std::out_of_range("Time_Over_Baseline value out of range (must be 0-511)");
384 word_t* tw = as_words();
385 tw[2*idx+1] = (tw[2*idx+1] & ~(0x1FFu << 23)) | ((val & 0x1FF) << 23);
386}

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 file: