DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NaiveThresholdProcessor.cpp
Go to the documentation of this file.
1
10
11namespace tpglibs {
12
13REGISTER_NAIVEPROCESSOR_CREATOR("NaiveThresholdProcessor", NaiveThresholdProcessor)
14
15void 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
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
#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.