12#include "TRACE/trace.h"
13#define TRACE_NAME "TCMakerChannelAdjacencyAlgorithm"
20using Logging::TLVL_DEBUG_ALL;
21using Logging::TLVL_DEBUG_HIGH;
22using Logging::TLVL_DEBUG_MEDIUM;
23using Logging::TLVL_VERY_IMPORTANT;
27 std::vector<TriggerCandidate>& output_tc)
39 TLOG_DEBUG(TLVL_DEBUG_HIGH) <<
"[TCM:CA] Window not yet complete, adding the activity to the window.";
45 <<
"[TCM:CA] TAWindow is at required length but specified threshold not met, shifting window along.";
58 <<
" len(tc.inputs) " << tc.
inputs.size();
60 for (
const auto& ta : tc.
inputs) {
61 TLOG_DEBUG(TLVL_DEBUG_ALL) <<
"[TCM:CA] [TA] ta.time_start=" << ta.time_start <<
" ta.time_end=" << ta.time_end
62 <<
" ta.adc_integral=" << ta.adc_integral;
65 output_tc.push_back(tc);
87 if (config.is_object()) {
88 if (config.contains(
"trigger_on_adc"))
90 if (config.contains(
"trigger_on_n_channels"))
92 if (config.contains(
"adc_threshold"))
94 if (config.contains(
"n_channels_threshold"))
96 if (config.contains(
"window_length"))
102 TLOG_DEBUG(TLVL_VERY_IMPORTANT) <<
"[TCM:CA] Not triggering! All trigger flags are false!";
#define REGISTER_TRIGGER_CANDIDATE_MAKER(tcm_name, tcm_class)
void clear()
Clear all inputs.
void add(const TriggerActivity &input_ta)
Add the input TA's contribution to the total ADC, increase the hit count of all of the channels which...
std::vector< TriggerActivity > inputs
void reset(TriggerActivity const &input_ta)
Reset window content on the input.
uint16_t n_channels_hit()
void move(TriggerActivity const &input_ta, timestamp_t const &window_length)
Find all of the TAs in the window that need to be removed if the input_ta is to be added and the size...
std::vector< TAWindow > m_window_record
uint64_t m_activity_count
TAWindow m_current_window
void add_window_to_record(TAWindow window)
uint16_t m_n_channels_threshold
timestamp_t m_window_length
TriggerCandidate construct_tc() const
void process(const TriggerActivity &, std::vector< TriggerCandidate > &)
TA processing function that creates & fills TCs.
void configure(const nlohmann::json &config)
bool m_trigger_on_n_channels
TriggerCandidate::Type m_tc_type_out
Configurable TC type output.
virtual void configure(const nlohmann::json &config)
#define TLOG_DEBUG(lvl,...)
std::vector< TriggerPrimitive > inputs
std::vector< dunedaq::trgdataformats::TriggerActivityData > inputs