DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
AVX signal processor: Estimates the pedestal and subtracts. More...
#include <AVXFrugalPedestalSubtractProcessor.hpp>
Public Member Functions | |
AVXFrugalPedestalSubtractProcessor () | |
Allocate and initialize dual buffers. | |
~AVXFrugalPedestalSubtractProcessor () noexcept | |
Release buffer memory. | |
__m256i | process (const __m256i &signal) override |
Estimate the pedestal using the given signal and subtract. | |
void | configure (const nlohmann::json &config, const int16_t *plane_numbers) override |
Configure the accumulation limit according to plane number. | |
void | save_metric_to_store_buffer () override |
Save metrics to store buffer. | |
virtual std::vector< std::string > | get_metric_items () override |
returns the metrics being recorded and can be read by this processor | |
ProcessorMetricArray< __m256i > | read_from_metric_store_buffer () override |
Read metrics from store buffer. | |
![]() | |
void | save_metric_to_store_buffer () override |
Save metrics to store buffer; no-op for basic AVXProcessor. | |
ProcessorMetricArray< __m256i > | read_from_metric_store_buffer () override |
Read metrics from store buffer; returns empty for basic AVXProcessor. | |
![]() | |
virtual | ~AbstractProcessor ()=default |
void | set_next_processor (std::shared_ptr< AbstractProcessor< __m256i > > next_processor) |
Setter for next processor. | |
virtual void | attach_to_metric_collector (ProcessorMetricCollector< signal_type_t > &collector, size_t pipeline_id) |
Register this processor and next processor with the metric collector. | |
Protected Attributes | |
__m256i | m_pedestal = _mm256_set1_epi16(0x4000) |
Vector of estimated pedestals for each channel. | |
__m256i | m_accum = _mm256_setzero_si256() |
Vector of counts that a channel's signal was above or below m_pedestal. | |
int16_t | m_accum_limit {10} |
Count limit before committing to a pedestal shift. | |
uint64_t | m_sample_period {512} |
Adjustable period for storing metric to buffer, in terms of number of time process happens (sampling period) | |
uint64_t | m_samples {0} |
bool | m_collect_metric_flag {false} |
Private Attributes | |
ProcessorMetricArray< __m256i > | m_metric_store_buffers [2] {} |
std::atomic< ProcessorMetricArray< __m256i > * > | m_active_buffer = &m_metric_store_buffers[0] |
std::atomic< uint16_t > | seq {0} |
Additional Inherited Members | |
![]() | |
using | signal_type_t |
Signal type to process on. General __m256i. | |
AVX signal processor: Estimates the pedestal and subtracts.
Given a history of signals, this estimates the pedestal by shifting the current estimate when it is wrong in the same direction m_accum_limit times. For example, if the input signal is greater (less) than the estimated pedestal 10 (configurable) times in a row, then increment (decrement) the pedestal.
Definition at line 25 of file AVXFrugalPedestalSubtractProcessor.hpp.
tpglibs::AVXFrugalPedestalSubtractProcessor::AVXFrugalPedestalSubtractProcessor | ( | ) |
Allocate and initialize dual buffers.
Definition at line 17 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
noexcept |
Release buffer memory.
Definition at line 27 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
overridevirtual |
Configure the accumulation limit according to plane number.
config | JSON config for the accumulation limits per plane. |
plane_numbers | Array of plane numbers. Gives the channels to apply the accumulation limit. |
Implements tpglibs::AbstractProcessor< __m256i >.
Definition at line 33 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
overridevirtual |
returns the metrics being recorded and can be read by this processor
Reimplemented from tpglibs::AbstractProcessor< __m256i >.
Definition at line 109 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
overridevirtual |
Estimate the pedestal using the given signal and subtract.
signal | A vector of channel signals. |
Reimplemented from tpglibs::AVXProcessor.
Definition at line 39 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
overridevirtual |
Read metrics from store buffer.
Reimplemented from tpglibs::AbstractProcessor< __m256i >.
Definition at line 90 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
overridevirtual |
Save metrics to store buffer.
Reimplemented from tpglibs::AbstractProcessor< __m256i >.
Definition at line 73 of file AVXFrugalPedestalSubtractProcessor.cpp.
|
protected |
Vector of counts that a channel's signal was above or below m_pedestal.
Definition at line 31 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
protected |
Count limit before committing to a pedestal shift.
Definition at line 34 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
private |
Definition at line 44 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
protected |
Definition at line 39 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
private |
Definition at line 42 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
protected |
Vector of estimated pedestals for each channel.
Definition at line 28 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
protected |
Adjustable period for storing metric to buffer, in terms of number of time process happens (sampling period)
Definition at line 37 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
protected |
Definition at line 38 of file AVXFrugalPedestalSubtractProcessor.hpp.
|
private |
Definition at line 46 of file AVXFrugalPedestalSubtractProcessor.hpp.