Line data Source code
1 : /**
2 : * @file TCMakerADCSimpleWindowAlgorithm.cpp
3 : *
4 : * This is part of the DUNE DAQ Application Framework, copyright 2021.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 :
9 : #include "triggeralgs/ADCSimpleWindow/TCMakerADCSimpleWindowAlgorithm.hpp"
10 :
11 : #include "TRACE/trace.h"
12 : #define TRACE_NAME "TCMakerADCSimpleWindowAlgorithm"
13 :
14 : #include <vector>
15 :
16 : using namespace triggeralgs;
17 :
18 : void
19 0 : TCMakerADCSimpleWindowAlgorithm::process(const TriggerActivity& activity, std::vector<TriggerCandidate>& cand)
20 : {
21 : // For now, if there is any single activity from any one detector element, emit
22 : // a trigger candidate.
23 0 : std::vector<TriggerActivity::TriggerActivityData> ta_list = {static_cast<TriggerActivity::TriggerActivityData>(activity)};
24 :
25 0 : TriggerCandidate tc;
26 0 : tc.time_start = activity.time_start;
27 0 : tc.time_end = activity.time_end;
28 0 : tc.time_candidate = activity.time_activity;
29 0 : tc.detid = activity.detid;
30 0 : tc.type = m_tc_type_out;
31 0 : tc.algorithm = TriggerCandidate::Algorithm::kADCSimpleWindow;
32 :
33 0 : tc.inputs = ta_list;
34 :
35 0 : cand.push_back(tc);
36 :
37 0 : }
38 :
39 : void
40 0 : TCMakerADCSimpleWindowAlgorithm::configure(const nlohmann::json &config)
41 : {
42 0 : TriggerCandidateMaker::configure(config);
43 0 : }
44 :
45 12 : REGISTER_TRIGGER_CANDIDATE_MAKER(TRACE_NAME, TCMakerADCSimpleWindowAlgorithm)
|