DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TCMakerProtoDUNEBSMWindowAlgorithm.cpp
Go to the documentation of this file.
1
10
11#include "TRACE/trace.h"
12#define TRACE_NAME "TCMakerProtoDUNEBSMWindowAlgorithm"
13
14#include <vector>
15
16using namespace triggeralgs;
17
18using Logging::TLVL_DEBUG_LOW;
19
20void TCMakerProtoDUNEBSMWindowAlgorithm::process(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
21//TCMakerProtoDUNEBSMWindowAlgorithm::operator()(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
22{
23
24 // For now, if there is any single activity from any one detector element, emit
25 // a trigger candidate.
27 std::vector<TriggerActivity::TriggerActivityData> ta_list = {static_cast<TriggerActivity::TriggerActivityData>(activity)};
28
29 TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:ADCSW] Emitting an "
31 << " TriggerCandidate with AEAnomalyWindow algorithm" << (m_activity_count-1);
32
34 tc.time_start = activity.time_start;
35 tc.time_end = activity.time_end;
36 tc.time_candidate = activity.time_activity;
37 tc.detid = activity.detid;
38 tc.type = m_tc_type;
39 //tc.algorithm = TriggerCandidate::Algorithm::kAEAnomalyWindow;
41
42 tc.inputs = ta_list;
43
44 cand.push_back(tc);
45
46}
47
48void
50{
52 /*
53 // Don't configure if no configuration object
54 if (!config.is_object())
55 return;
56
57 // Set the TC name
58 if (config.contains("tc_type_name")){
59 m_tc_type = static_cast<triggeralgs::TriggerCandidate::Type>(
60 dunedaq::trgdataformats::string_to_fragment_type_value(config["tc_type_name"]));
61
62 // Set unknown to the default kAEAnomalyWindow
63 if (m_tc_type == triggeralgs::TriggerCandidate::Type::kUnknown) {
64 //m_tc_type = TriggerCandidate::Type::kAEAnomalyWindow;
65 m_tc_type = TriggerCandidate::Type::kUnknown;
66 }
67
68 TLOG() << "[TCM:ADCSW]: setting output TC type to "
69 << dunedaq::trgdataformats::get_trigger_candidate_type_names()[m_tc_type];
70 }
71 */
72}
73
#define TRACE_NAME
#define REGISTER_TRIGGER_CANDIDATE_MAKER(tcm_name, tcm_class)
TriggerCandidate::Type m_tc_type
Configurable TC type to produce by this TC algorithm.
void process(const TriggerActivity &, std::vector< TriggerCandidate > &)
The function that gets call when there is a new activity.
virtual void configure(const nlohmann::json &config)
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
std::map< TriggerCandidateData::Type, std::string > get_trigger_candidate_type_names()
std::vector< dunedaq::trgdataformats::TriggerActivityData > inputs