DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAMakerChannelDistanceAlgorithm.cpp
Go to the documentation of this file.
1
10
11#include "TRACE/trace.h"
12#define TRACE_NAME "TAMakerChannelDistanceAlgorithm"
13
14namespace triggeralgs {
15
16void
25
26void
28 std::vector<TriggerActivity>& output_tas)
29{
30
31 // Start a new TA if not already going.
32 if (m_current_ta.inputs.empty()) {
33 set_new_ta(input_tp);
34 return;
35 }
36
37 // Check to close the TA based on time.
38 if (input_tp.time_start - m_current_ta.inputs.front().time_start > m_window_length) {
39 // Check to block the TA based on min TPs.
40 if (m_current_ta.inputs.size() >= m_min_tps) {
42 output_tas.push_back(m_current_ta);
43 }
44 set_new_ta(input_tp);
45 return;
46 }
47
48 // Check to skip the TP if it's outside the current channel bounds.
50 return;
51
52 m_current_ta.inputs.push_back(input_tp);
55}
56
57void
58TAMakerChannelDistanceAlgorithm::configure(const nlohmann::json& config)
59{
61
62 if (config.contains("min_tps"))
63 m_min_tps = config["min_tps"];
64 if (config.contains("window_length"))
65 m_window_length = config["window_length"];
66 if (config.contains("max_channel_distance"))
67 m_max_channel_distance = config["max_channel_distance"];
68
69 return;
70}
71
72void
100
101// Register algo in TA Factory
103
104} // namespace triggeralgs
#define REGISTER_TRIGGER_ACTIVITY_MAKER(tam_name, tam_class)
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_tas)
TP processing function that creates & fills TAs.
virtual void configure(const nlohmann::json &config)
dunedaq::trgdataformats::channel_diff_t channel_diff_t
Definition Types.hpp:21
#define TRACE_NAME
A single energy deposition on a TPC or PDS channel.
std::vector< TriggerPrimitive > inputs