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

#include <TCMakerChannelDistanceAlgorithm.hpp>

Inheritance diagram for triggeralgs::TCMakerChannelDistanceAlgorithm:
[legend]
Collaboration diagram for triggeralgs::TCMakerChannelDistanceAlgorithm:
[legend]

Public Member Functions

void process (const TriggerActivity &input_ta, std::vector< TriggerCandidate > &output_tcs)
 TA processing function that creates & fills TCs.
void configure (const nlohmann::json &config)
void set_tc_attributes ()
Public Member Functions inherited from triggeralgs::TriggerCandidateMaker
virtual ~TriggerCandidateMaker ()=default
void operator() (const TriggerActivity &input_ta, std::vector< TriggerCandidate > &output_tc)
virtual bool preprocess (const TriggerActivity &)
 TA pre-processing/filtering.
virtual void postprocess (std::vector< TriggerCandidate > &output_tc)
 Post-processing/filtering of the TCs, e.g. prescale.
virtual void flush (timestamp_t, std::vector< TriggerCandidate > &)

Private Member Functions

void set_new_tc (const TriggerActivity &input_ta)

Private Attributes

TriggerCandidate m_current_tc
uint16_t m_current_tp_count
uint16_t m_max_tp_count = 1000

Additional Inherited Members

Public Attributes inherited from triggeralgs::TriggerCandidateMaker
std::atomic< uint64_t > m_data_vs_system_time = 0
std::atomic< uint64_t > m_initial_offset = 0
uint64_t m_prescale = 1
 Configurable prescale factor.
uint64_t m_tc_count = 0
 TC made count for prescaling.
TriggerCandidate::Type m_tc_type_out = TriggerCandidate::Type::kUnknown
 Configurable TC type output.

Detailed Description

Definition at line 17 of file TCMakerChannelDistanceAlgorithm.hpp.

Member Function Documentation

◆ configure()

void triggeralgs::TCMakerChannelDistanceAlgorithm::configure ( const nlohmann::json & config)
virtual

Reimplemented from triggeralgs::TriggerCandidateMaker.

Definition at line 26 of file TCMakerChannelDistanceAlgorithm.cpp.

27{
29
30 if (config.contains("max_tp_count"))
31 m_max_tp_count = config["max_tp_count"];
32 return;
33}
virtual void configure(const nlohmann::json &config)

◆ process()

void triggeralgs::TCMakerChannelDistanceAlgorithm::process ( const TriggerActivity & input_ta,
std::vector< TriggerCandidate > & output_tc )
virtual

TA processing function that creates & fills TCs.

Parameters
input_ta[in]Input TA for the triggering algorithm
output_tc[out]Output vector of TCs to fill by the algorithm

Implements triggeralgs::TriggerCandidateMaker.

Definition at line 52 of file TCMakerChannelDistanceAlgorithm.cpp.

54{
55
56 // Start a new TC if not already going.
57 if (m_current_tc.inputs.empty()) {
58 set_new_tc(input_ta);
59 return;
60 }
61
62 // Check to close the TC based on TP contents.
63 if (input_ta.inputs.size() + m_current_tp_count > m_max_tp_count) {
65 output_tcs.push_back(m_current_tc);
66
67 set_new_tc(input_ta);
68 return;
69 }
70
71 // Append the new TA and increase the TP count.
72 m_current_tc.inputs.push_back(input_ta);
73 m_current_tp_count += input_ta.inputs.size();
74 return;
75}

◆ set_new_tc()

void triggeralgs::TCMakerChannelDistanceAlgorithm::set_new_tc ( const TriggerActivity & input_ta)
private

Definition at line 17 of file TCMakerChannelDistanceAlgorithm.cpp.

18{
20 m_current_tc.inputs.push_back(input_ta);
21 m_current_tp_count = input_ta.inputs.size();
22 return;
23}
TriggerObjectOverlay< TriggerCandidateData, TriggerActivityData > TriggerCandidate

◆ set_tc_attributes()

void triggeralgs::TCMakerChannelDistanceAlgorithm::set_tc_attributes ( )

Definition at line 36 of file TCMakerChannelDistanceAlgorithm.cpp.

37{
38 auto& first_ta = m_current_tc.inputs.front();
39 auto& last_ta = m_current_tc.inputs.back();
40
41 m_current_tc.time_start = first_ta.time_start;
42 m_current_tc.time_end = last_ta.time_end;
43 m_current_tc.time_candidate = last_ta.time_start; // Since this is the TA that closed the TC.
44
45 m_current_tc.detid = first_ta.detid;
48 return;
49}
TriggerCandidate::Type m_tc_type_out
Configurable TC type output.

Member Data Documentation

◆ m_current_tc

TriggerCandidate triggeralgs::TCMakerChannelDistanceAlgorithm::m_current_tc
private

Definition at line 25 of file TCMakerChannelDistanceAlgorithm.hpp.

◆ m_current_tp_count

uint16_t triggeralgs::TCMakerChannelDistanceAlgorithm::m_current_tp_count
private

Definition at line 26 of file TCMakerChannelDistanceAlgorithm.hpp.

◆ m_max_tp_count

uint16_t triggeralgs::TCMakerChannelDistanceAlgorithm::m_max_tp_count = 1000
private

Definition at line 27 of file TCMakerChannelDistanceAlgorithm.hpp.


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