DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
tpglibs
src
NaiveThresholdProcessor.cpp
Go to the documentation of this file.
1
8
9
#include "
tpglibs/NaiveThresholdProcessor.hpp
"
10
11
namespace
tpglibs
{
12
13
REGISTER_NAIVEPROCESSOR_CREATOR
(
"NaiveThresholdProcessor"
,
NaiveThresholdProcessor
)
14
15
void
16
NaiveThresholdProcessor::configure
(
const
nlohmann::json& config,
const
int16_t* plane_numbers)
17
{
18
int16_t config_thresholds[3] = { config[
"plane0"
], config[
"plane1"
], config[
"plane2"
] };
19
20
// Messy. Assumes plane numbers are in {0, 1, 2}.
21
for
(
int
i = 0; i < 16; i++) {
22
m_threshold
[i] = config_thresholds[plane_numbers[i]];
23
}
24
}
25
26
NaiveThresholdProcessor::naive_array_t
27
NaiveThresholdProcessor::process
(
const
naive_array_t
& signal)
28
{
29
naive_array_t
above_threshold;
30
for
(
int
i = 0; i < 16; i++) {
31
if
(signal[i] >
m_threshold
[i])
32
above_threshold[i] = signal[i];
33
}
34
return
NaiveProcessor::process
(above_threshold);
35
}
36
37
}
// namespace tpglibs
REGISTER_NAIVEPROCESSOR_CREATOR
#define REGISTER_NAIVEPROCESSOR_CREATOR(processor_name, processor_class)
Factory registration macro.
Definition
NaiveFactory.hpp:18
NaiveThresholdProcessor.hpp
tpglibs::NaiveProcessor::process
virtual naive_array_t process(const naive_array_t &signal) override
Simple signal pass-through on naive type.
Definition
NaiveProcessor.hpp:26
tpglibs::NaiveProcessor::naive_array_t
std::array< int16_t, 16 > naive_array_t
The naive version uses a standard array instead of __m256i.
Definition
NaiveProcessor.hpp:23
tpglibs::NaiveThresholdProcessor
Naive signal processor: Passes signals above a threshold.
Definition
NaiveThresholdProcessor.hpp:18
tpglibs::NaiveThresholdProcessor::m_threshold
naive_array_t m_threshold
Vector of thresholds to apply.
Definition
NaiveThresholdProcessor.hpp:20
tpglibs::NaiveThresholdProcessor::process
naive_array_t process(const naive_array_t &signal) override
Masks channels with signals below threshold.
Definition
NaiveThresholdProcessor.cpp:27
tpglibs::NaiveThresholdProcessor::configure
void configure(const nlohmann::json &config, const int16_t *plane_numbers) override
Configures thresholds according to plane numbers.
Definition
NaiveThresholdProcessor.cpp:16
tpglibs
Definition
AbstractFactory.hpp:20
Generated on
for DUNE-DAQ by
1.18.0