DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TCMakerBundleNAlgorithm.cpp
Go to the documentation of this file.
1
10
11#include "TRACE/trace.h"
12#define TRACE_NAME "TCMakerBundleNAlgorithm"
13
14namespace triggeralgs {
15
18
20 // Using the first TA as reference.
22
24 m_current_tc.time_end = m_current_tc.inputs.back().time_end;
25 m_current_tc.time_candidate = front_ta.time_start; // TODO: Conforming. Do we change this?
26 m_current_tc.detid = front_ta.detid;
29 return;
30}
31
35
36void
37TCMakerBundleNAlgorithm::process(const TriggerActivity& input_ta, std::vector<TriggerCandidate>& output_tcs)
38{
39 // Expect that TAs are inherently time ordered.
40 m_current_tc.inputs.push_back(input_ta);
41
42 if (bundle_condition()) {
43 TLOG_DEBUG(TLVL_DEBUG_HIGH) << "[TC:BN] Emitting BundleN TriggerCandidate with " << m_current_tc.inputs.size() << " TAs.";
45 output_tcs.push_back(m_current_tc);
46
47 // Reset the current.
49 }
50
51 // Should never reach this step. In this case, send it out.
52 if (m_current_tc.inputs.size() > m_bundle_size) {
53 TLOG_DEBUG(TLVL_IMPORTANT) << "[TC:BN] Emitting large BundleN TriggerCandidate with " << m_current_tc.inputs.size() << " TAs.";
55 output_tcs.push_back(m_current_tc);
56
57 // Reset the current.
59 }
60}
61
62void
63TCMakerBundleNAlgorithm::configure(const nlohmann::json& config)
64{
66 if (config.is_object() && config.contains("bundle_size")) {
67 m_bundle_size = config["bundle_size"];
68 }
69}
70
72} // namespace triggeralgs
73
#define REGISTER_TRIGGER_CANDIDATE_MAKER(tcm_name, tcm_class)
void process(const TriggerActivity &input_ta, std::vector< TriggerCandidate > &output_tcs)
TA processing function that creates & fills TCs.
void configure(const nlohmann::json &config)
TriggerCandidate::Type m_tc_type_out
Configurable TC type output.
virtual void configure(const nlohmann::json &config)
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
@ TLVL_DEBUG_HIGH
Definition Logging.hpp:24
#define TRACE_NAME
std::vector< dunedaq::trgdataformats::TriggerActivityData > inputs