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 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.
 
dunedaq::trgdataformats::channel_t m_channels [16]
 Detector channel numbers for the 16 channels that are being processed.
 
int16_t m_plane_numbers [16]
 Detector plane numbers for the 16 channels that are being processed.
 
uint16_t m_sot_minima [3]
 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 28 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 31 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 33 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 43 of file TPGPipeline.hpp.

43 {
44 std::shared_ptr<processor_t> prev_processor = nullptr;
45
46 for (int i = 0; i < 16; i++) {
47 m_channels[i] = channel_plane_numbers[i].first;
48 m_plane_numbers[i] = channel_plane_numbers[i].second;
49 }
50
51 for (const auto& name_config : configs) {
52 // Get the requested processor.
53 std::shared_ptr<processor_t> processor = m_factory->create_processor(name_config.first);
54
55 // Configure it.
56 processor->configure(name_config.second, m_plane_numbers);
57
58 // If it's the first one, make it the head.
59 if (!prev_processor) {
60 m_processor_head = processor;
61 prev_processor = processor;
62 continue;
63 }
64
65 // Otherwise, start linking the chain.
66 prev_processor->set_next_processor(processor);
67 prev_processor = processor;
68 }
69 }
int16_t m_plane_numbers[16]
Detector plane 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.
dunedaq::trgdataformats::channel_t m_channels[16]
Detector channel numbers for the 16 channels that are being processed.

◆ 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.

◆ 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 74 of file TPGPipeline.hpp.

74 {
75 signal_t tp_mask = save_state(m_processor_head->process(signal));
76
77 std::vector<dunedaq::trgdataformats::TriggerPrimitive> tps;
78 if (check_for_tps(tp_mask))
79 tps = generate_tps(tp_mask);
80
81 return tps;
82 }
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 94 of file TPGPipeline.hpp.

94 {
95 int idx = 0;
96 for (auto sot_minimum : sot_minima) {
97 m_sot_minima[idx++] = sot_minimum;
98 }
99 }
uint16_t m_sot_minima[3]
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 104 of file TPGPipeline.hpp.

104{};

◆ 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 103 of file TPGPipeline.hpp.

103{};

◆ 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 106 of file TPGPipeline.hpp.

106{};

◆ m_channels

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

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

Definition at line 112 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 118 of file TPGPipeline.hpp.

◆ m_plane_numbers

template<typename T , typename U >
int16_t tpglibs::TPGPipeline< T, U >::m_plane_numbers[16]
protected

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

Definition at line 114 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 120 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 108 of file TPGPipeline.hpp.

108{};

◆ 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 110 of file TPGPipeline.hpp.

110{};

◆ m_sot_minima

template<typename T , typename U >
uint16_t tpglibs::TPGPipeline< T, U >::m_sot_minima[3]
protected

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

Definition at line 116 of file TPGPipeline.hpp.


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