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
NaiveThresholdProcessor
::
configure
(const nlohmann::json& config, const int16_t* plane_numbers) {
16
int16_t config_thresholds[3] = {config[
"plane0"
], config[
"plane1"
], config[
"plane2"
]};
17
18
// Messy. Assumes plane numbers are in {0, 1, 2}.
19
for
(
int
i = 0; i < 16; i++) {
20
m_threshold
[i] = config_thresholds[plane_numbers[i]];
21
}
22
}
23
24
NaiveThresholdProcessor::naive_array_t
NaiveThresholdProcessor::process
(
const
naive_array_t
& signal) {
25
naive_array_t
above_threshold;
26
for
(
int
i = 0; i < 16; i++) {
27
if
(signal[i] >
m_threshold
[i])
28
above_threshold[i] = signal[i];
29
}
30
return
NaiveProcessor::process
(above_threshold);
31
}
32
33
}
// namespace tpglibs
REGISTER_NAIVEPROCESSOR_CREATOR
#define REGISTER_NAIVEPROCESSOR_CREATOR(processor_name, processor_class)
Factory registration macro.
Definition
NaiveFactory.hpp:16
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:25
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:22
tpglibs::NaiveThresholdProcessor
Naive signal processor: Passes signals above a threshold.
Definition
NaiveThresholdProcessor.hpp:17
tpglibs::NaiveThresholdProcessor::m_threshold
naive_array_t m_threshold
Vector of thresholds to apply.
Definition
NaiveThresholdProcessor.hpp:19
tpglibs::NaiveThresholdProcessor::process
naive_array_t process(const naive_array_t &signal) override
Masks channels with signals below threshold.
Definition
NaiveThresholdProcessor.cpp:24
tpglibs::NaiveThresholdProcessor::configure
void configure(const nlohmann::json &config, const int16_t *plane_numbers) override
Configures thresholds according to plane numbers.
Definition
NaiveThresholdProcessor.cpp:15
tpglibs
Definition
AbstractFactory.hpp:20
Generated on
for DUNE-DAQ by
1.17.0