DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
AVXFrugalPedestalSubtractProcessor.hpp
Go to the documentation of this file.
1
11#include <atomic>
12#include <memory>
13
14#ifndef TPGLIBS_AVXFRUGALPEDESTALSUBTRACTPROCESSOR_HPP_
15#define TPGLIBS_AVXFRUGALPEDESTALSUBTRACTPROCESSOR_HPP_
16
17namespace tpglibs {
18
26 protected:
28 __m256i m_pedestal = _mm256_set1_epi16(0x4000); // Set initial start to 14-bit max. Prevents garbage TPs at start.
29
31 __m256i m_accum = _mm256_setzero_si256();
32
34 int16_t m_accum_limit{10};
35
37 uint64_t m_sample_period{512};
38 uint64_t m_samples{0};
40
41 private:
43 // Initialize always to buffer 0 to make it safe, always points to one of buffer 0 and 1
44 std::atomic<ProcessorMetricArray<__m256i>*> m_active_buffer = &m_metric_store_buffers[0];
45
46 std::atomic<uint16_t>seq{0};
47
48 public:
53
59 __m256i process(const __m256i& signal) override;
60
66 void configure(const nlohmann::json& config, const int16_t* plane_numbers) override;
67
69 void save_metric_to_store_buffer() override;
70
75 virtual std::vector<std::string> get_metric_items() override;
76
79};
80
81} // namespace tpglibs
82
83#endif // TPGLIBS_AVXFRUGALPEDESTALSUBTRACTPROCESSOR_HPP_
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.
__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.
int16_t m_accum_limit
Count limit before committing to a pedestal shift.
__m256i m_accum
Vector of counts that a channel's signal was above or below m_pedestal.
AVX typed abstract signal processor.
Dynamic array of processor metrics, templated on signal type.