Line data Source code
1 : /**
2 : * @file AVXFixedPedestalSubtractProcessor.cpp
3 : *
4 : * @copyright This is part of the DUNE DAQ Software Suite, copyright 2020.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 :
9 : #include "tpglibs/AVXFixedPedestalSubtractProcessor.hpp"
10 :
11 : namespace tpglibs {
12 :
13 15 : REGISTER_AVXPROCESSOR_CREATOR("AVXFixedPedestalSubtractProcessor", AVXFixedPedestalSubtractProcessor)
14 :
15 0 : void AVXFixedPedestalSubtractProcessor::configure(const nlohmann::json& config, const int16_t* plane_numbers) {
16 0 : AVXFrugalPedestalSubtractProcessor::configure(config, plane_numbers);
17 0 : m_start_period = config["start_period"];
18 0 : }
19 :
20 0 : __m256i AVXFixedPedestalSubtractProcessor::process(const __m256i& signal) {
21 0 : if (m_num_time_steps < m_start_period) {
22 0 : m_num_time_steps++;
23 0 : return AVXFrugalPedestalSubtractProcessor::process(signal);
24 : }
25 0 : return AVXProcessor::process(_mm256_sub_epi16(signal, m_pedestal));
26 : }
27 :
28 : } // namespace tpglibs
|