14#ifndef TPGLIBS_AVXFRUGALPEDESTALSUBTRACTPROCESSOR_HPP_
15#define TPGLIBS_AVXFRUGALPEDESTALSUBTRACTPROCESSOR_HPP_
46 std::atomic<uint16_t>
seq{0};
59 __m256i
process(const __m256i& signal) override;
66 void configure(const nlohmann::json& config, const int16_t* plane_numbers) override;
AVX signal processor: Estimates the pedestal and subtracts.
void save_metric_to_store_buffer() override
Save metrics to store buffer.
uint64_t m_sample_period
Adjustable period for storing metric to buffer, in terms of number of time process happens (sampling ...
void configure(const nlohmann::json &config, const int16_t *plane_numbers) override
Configure the accumulation limit according to plane number.
__m256i process(const __m256i &signal) override
Estimate the pedestal using the given signal and subtract.
ProcessorMetricArray< __m256i > read_from_metric_store_buffer() override
Read metrics from store buffer.
~AVXFrugalPedestalSubtractProcessor() noexcept
Release buffer memory.
__m256i m_pedestal
Vector of estimated pedestals for each channel.
std::atomic< ProcessorMetricArray< __m256i > * > m_active_buffer
virtual std::vector< std::string > get_metric_items() override
returns the metrics being recorded and can be read by this processor
AVXFrugalPedestalSubtractProcessor()
Allocate and initialize dual buffers.
ProcessorMetricArray< __m256i > m_metric_store_buffers[2]
int16_t m_accum_limit
Count limit before committing to a pedestal shift.
bool m_collect_metric_flag
__m256i m_accum
Vector of counts that a channel's signal was above or below m_pedestal.
std::atomic< uint16_t > seq
AVX typed abstract signal processor.
Dynamic array of processor metrics, templated on signal type.