DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tpglibs::NaiveThresholdProcessor Class Reference

Naive signal processor: Passes signals above a threshold. More...

#include <NaiveThresholdProcessor.hpp>

Inheritance diagram for tpglibs::NaiveThresholdProcessor:
[legend]
Collaboration diagram for tpglibs::NaiveThresholdProcessor:
[legend]

Public Member Functions

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.
 
- Public Member Functions inherited from tpglibs::NaiveProcessor
- Public Member Functions inherited from tpglibs::AbstractProcessor< std::array< int16_t, 16 > >
virtual ~AbstractProcessor ()=default
 
void set_next_processor (std::shared_ptr< AbstractProcessor< std::array< int16_t, 16 > > > next_processor)
 Setter for next processor.
 

Private Attributes

naive_array_t m_threshold
 Vector of thresholds to apply.
 

Additional Inherited Members

- Public Types inherited from tpglibs::NaiveProcessor
using naive_array_t = std::array<int16_t, 16>
 The naive version uses a standard array instead of __m256i.
 
- Public Types inherited from tpglibs::AbstractProcessor< std::array< int16_t, 16 > >
using signal_type_t
 Signal type to process on. General __m256i.
 

Detailed Description

Naive signal processor: Passes signals above a threshold.

Definition at line 17 of file NaiveThresholdProcessor.hpp.

Member Function Documentation

◆ configure()

void tpglibs::NaiveThresholdProcessor::configure ( const nlohmann::json & config,
const int16_t * plane_numbers )
overridevirtual

Configures thresholds according to plane numbers.

Parameters
configJSON containing thresholds for the 3 planes.
plane_numbersArray of plane numbers. Gives the channels to apply the appropriate thresholds.

Implements tpglibs::AbstractProcessor< std::array< int16_t, 16 > >.

Definition at line 15 of file NaiveThresholdProcessor.cpp.

15 {
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}
naive_array_t m_threshold
Vector of thresholds to apply.

◆ process()

NaiveThresholdProcessor::naive_array_t tpglibs::NaiveThresholdProcessor::process ( const naive_array_t & signal)
overridevirtual

Masks channels with signals below threshold.

Parameters
signalVector of channel signals to process.
Returns
A vector of channel signals. Signals that were below threshold are set to 0.

Reimplemented from tpglibs::NaiveProcessor.

Definition at line 24 of file NaiveThresholdProcessor.cpp.

24 {
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}
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.

Member Data Documentation

◆ m_threshold

naive_array_t tpglibs::NaiveThresholdProcessor::m_threshold
private

Vector of thresholds to apply.

Definition at line 19 of file NaiveThresholdProcessor.hpp.


The documentation for this class was generated from the following files: