DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tpglibs::TPGPipeline< T, U > Class Template Referenceabstract

Abstract class for the TPG pipeline. More...

#include <TPGPipeline.hpp>

Public Types

using processor_t = T
 Processor type to use. Generally AVX.
using signal_t = U
 Signal type to use. Generally __m256i.

Public Member Functions

virtual ~TPGPipeline ()=default
virtual void configure (const std::vector< std::pair< std::string, nlohmann::json > > configs, const std::vector< std::pair< dunedaq::trgdataformats::channel_t, int16_t > > channel_plane_numbers)
 Configure the pieces to the pipeline.
virtual std::vector< dunedaq::trgdataformats::TriggerPrimitiveprocess (const signal_t &signal)
 Process a signal through the pipeline.
virtual bool check_for_tps (const signal_t &tp_mask)=0
 Pure virtual function that will check if any TPs can be generated.
virtual signal_t save_state (const signal_t &processed_signal)=0
 Pure virtual function that will save the state of the generation.
virtual std::vector< dunedaq::trgdataformats::TriggerPrimitivegenerate_tps (const signal_t &tp_mask)=0
 Pure virtual function that will generate TPs given a mask to draw from.
virtual std::vector< std::shared_ptr< AbstractProcessor< signal_t > > > get_all_processor_references ()
 Return reference to all processors in this pipeline.
virtual void set_sot_minima (const std::vector< uint16_t > &sot_minima)
 Set the samples over threshold minimum values.

Protected Attributes

signal_t m_adc_integral_lo {}
 The on-going ADC integral for channels that are considered active.
signal_t m_adc_integral_hi {}
signal_t m_adc_peak {}
 The ADC peak for channels that are considered active.
signal_t m_samples_over_threshold {}
 The samples over threshold for channels that are considered active.
signal_t m_samples_to_peak {}
 The number of samples from time_start to the ADC peak.
std::array< dunedaq::trgdataformats::channel_t, 16 > m_channels
 Detector channel numbers for the 16 channels that are being processed.
std::array< int16_t, 16 > m_plane_numbers
 Detector plane numbers for the 16 channels that are being processed.
std::array< uint16_t, 3 > m_sot_minima
 The samples over threshold minimum that a TP from plane i must have.
std::shared_ptr< AbstractFactory< processor_t > > m_factory = AbstractFactory<processor_t>::get_instance()
 Processor factory singleton.
std::shared_ptr< processor_tm_processor_head
 Processor head to start from.

Detailed Description

template<typename T, typename U>
class tpglibs::TPGPipeline< T, U >

Abstract class for the TPG pipeline.

Definition at line 30 of file TPGPipeline.hpp.

Member Typedef Documentation

◆ processor_t

template<typename T, typename U>
using tpglibs::TPGPipeline< T, U >::processor_t = T

Processor type to use. Generally AVX.

Definition at line 33 of file TPGPipeline.hpp.

◆ signal_t

template<typename T, typename U>
using tpglibs::TPGPipeline< T, U >::signal_t = U

Signal type to use. Generally __m256i.

Definition at line 35 of file TPGPipeline.hpp.

Constructor & Destructor Documentation

◆ ~TPGPipeline()

template<typename T, typename U>
virtual tpglibs::TPGPipeline< T, U >::~TPGPipeline ( )
virtualdefault

Member Function Documentation

◆ check_for_tps()

template<typename T, typename U>
virtual bool tpglibs::TPGPipeline< T, U >::check_for_tps ( const signal_t & tp_mask)
pure virtual

Pure virtual function that will check if any TPs can be generated.

Implemented in tpglibs::AVXPipeline.

◆ configure()

template<typename T, typename U>
virtual void tpglibs::TPGPipeline< T, U >::configure ( const std::vector< std::pair< std::string, nlohmann::json > > configs,
const std::vector< std::pair< dunedaq::trgdataformats::channel_t, int16_t > > channel_plane_numbers )
inlinevirtual

Configure the pieces to the pipeline.

Parameters
configsVector of processors and configurations to be used.
channel_plane_numbersVector of channel numbers and their plane numbers.

Definition at line 45 of file TPGPipeline.hpp.

45 {
47
48 for (int i = 0; i < 16; i++) {
51 }
52
53 for (const auto& name_config : configs) {
54 // Get the requested processor.
56
57 // Configure it.
59
60 // If it's the first one, make it the head.
61 if (!prev_processor) {
64 continue;
65 }
66
67 // Otherwise, start linking the chain.
68 prev_processor->set_next_processor(processor);
70 }
71 }
Abstract class for the TPG pipeline.
std::array< int16_t, 16 > m_plane_numbers
Detector plane numbers for the 16 channels that are being processed.
std::array< dunedaq::trgdataformats::channel_t, 16 > m_channels
Detector channel numbers for the 16 channels that are being processed.
std::shared_ptr< processor_t > m_processor_head
Processor head to start from.
std::shared_ptr< AbstractFactory< processor_t > > m_factory
Processor factory singleton.
virtual void configure(const std::vector< std::pair< std::string, nlohmann::json > > configs, const std::vector< std::pair< dunedaq::trgdataformats::channel_t, int16_t > > channel_plane_numbers)
Configure the pieces to the pipeline.

◆ generate_tps()

template<typename T, typename U>
virtual std::vector< dunedaq::trgdataformats::TriggerPrimitive > tpglibs::TPGPipeline< T, U >::generate_tps ( const signal_t & tp_mask)
pure virtual

Pure virtual function that will generate TPs given a mask to draw from.

Implemented in tpglibs::AVXPipeline.

◆ get_all_processor_references()

template<typename T, typename U>
virtual std::vector< std::shared_ptr< AbstractProcessor< signal_t > > > tpglibs::TPGPipeline< T, U >::get_all_processor_references ( )
inlinevirtual

Return reference to all processors in this pipeline.

Returns
A vector of all processor references.

Definition at line 100 of file TPGPipeline.hpp.

◆ process()

template<typename T, typename U>
virtual std::vector< dunedaq::trgdataformats::TriggerPrimitive > tpglibs::TPGPipeline< T, U >::process ( const signal_t & signal)
inlinevirtual

Process a signal through the pipeline.

Definition at line 76 of file TPGPipeline.hpp.

76 {
78
82
83 return tps;
84 }
virtual bool check_for_tps(const signal_t &tp_mask)=0
Pure virtual function that will check if any TPs can be generated.
U signal_t
Signal type to use. Generally __m256i.
virtual std::vector< dunedaq::trgdataformats::TriggerPrimitive > generate_tps(const signal_t &tp_mask)=0
Pure virtual function that will generate TPs given a mask to draw from.
virtual signal_t save_state(const signal_t &processed_signal)=0
Pure virtual function that will save the state of the generation.

◆ save_state()

template<typename T, typename U>
virtual signal_t tpglibs::TPGPipeline< T, U >::save_state ( const signal_t & processed_signal)
pure virtual

Pure virtual function that will save the state of the generation.

Implemented in tpglibs::AVXPipeline.

◆ set_sot_minima()

template<typename T, typename U>
virtual void tpglibs::TPGPipeline< T, U >::set_sot_minima ( const std::vector< uint16_t > & sot_minima)
inlinevirtual

Set the samples over threshold minimum values.

Definition at line 113 of file TPGPipeline.hpp.

113 {
114 int idx = 0;
115 for (auto sot_minimum : sot_minima) {
117 }
118 }
std::array< uint16_t, 3 > m_sot_minima
The samples over threshold minimum that a TP from plane i must have.

Member Data Documentation

◆ m_adc_integral_hi

template<typename T, typename U>
signal_t tpglibs::TPGPipeline< T, U >::m_adc_integral_hi {}
protected

Definition at line 123 of file TPGPipeline.hpp.

123{};

◆ m_adc_integral_lo

template<typename T, typename U>
signal_t tpglibs::TPGPipeline< T, U >::m_adc_integral_lo {}
protected

The on-going ADC integral for channels that are considered active.

Definition at line 122 of file TPGPipeline.hpp.

122{};

◆ m_adc_peak

template<typename T, typename U>
signal_t tpglibs::TPGPipeline< T, U >::m_adc_peak {}
protected

The ADC peak for channels that are considered active.

Definition at line 125 of file TPGPipeline.hpp.

125{};

◆ m_channels

template<typename T, typename U>
std::array<dunedaq::trgdataformats::channel_t, 16> tpglibs::TPGPipeline< T, U >::m_channels
protected

Detector channel numbers for the 16 channels that are being processed.

Definition at line 131 of file TPGPipeline.hpp.

◆ m_factory

template<typename T, typename U>
std::shared_ptr<AbstractFactory<processor_t> > tpglibs::TPGPipeline< T, U >::m_factory = AbstractFactory<processor_t>::get_instance()
protected

Processor factory singleton.

Definition at line 137 of file TPGPipeline.hpp.

◆ m_plane_numbers

template<typename T, typename U>
std::array<int16_t, 16> tpglibs::TPGPipeline< T, U >::m_plane_numbers
protected

Detector plane numbers for the 16 channels that are being processed.

Definition at line 133 of file TPGPipeline.hpp.

◆ m_processor_head

template<typename T, typename U>
std::shared_ptr<processor_t> tpglibs::TPGPipeline< T, U >::m_processor_head
protected

Processor head to start from.

Definition at line 139 of file TPGPipeline.hpp.

◆ m_samples_over_threshold

template<typename T, typename U>
signal_t tpglibs::TPGPipeline< T, U >::m_samples_over_threshold {}
protected

The samples over threshold for channels that are considered active.

Definition at line 127 of file TPGPipeline.hpp.

127{};

◆ m_samples_to_peak

template<typename T, typename U>
signal_t tpglibs::TPGPipeline< T, U >::m_samples_to_peak {}
protected

The number of samples from time_start to the ADC peak.

Definition at line 129 of file TPGPipeline.hpp.

129{};

◆ m_sot_minima

template<typename T, typename U>
std::array<uint16_t, 3> tpglibs::TPGPipeline< T, U >::m_sot_minima
protected

The samples over threshold minimum that a TP from plane i must have.

Definition at line 135 of file TPGPipeline.hpp.


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