DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NaiveThresholdProcessor.cpp
Go to the documentation of this file.
1
8
10
11namespace tpglibs {
12
14
15void
16NaiveThresholdProcessor::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
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
#define REGISTER_NAIVEPROCESSOR_CREATOR(processor_name, processor_class)
Factory registration macro.
virtual naive_array_t process(const naive_array_t &signal) override
Simple signal pass-through on naive type.
std::array< int16_t, 16 > naive_array_t
The naive version uses a standard array instead of __m256i.
Naive signal processor: Passes signals above a threshold.
naive_array_t m_threshold
Vector of thresholds to apply.
naive_array_t process(const naive_array_t &signal) override
Masks channels with signals below threshold.
void configure(const nlohmann::json &config, const int16_t *plane_numbers) override
Configures thresholds according to plane numbers.