11#include "TRACE/trace.h"
12#define TRACE_NAME "TAMakerADCSimpleWindowAlgorithm"
41 uint32_t n_tps_to_erase = 0;
43 if(input_tp.
time_start-tp.time_start >= window_length){
83 os <<
"Window is empty!\n";
86 <<
", end: " << window.
tp_list.back().time_start
88 <<
" ADC counts with " << window.
tp_list.size()
124 TLOG_DEBUG(
TLVL_DEBUG_ALL) <<
"[TAM:ADCSW] Window is at required length but adc threshold not met, shifting window along.";
141 if (config.is_object()){
142 if (config.contains(
"window_length"))
m_window_length = config[
"window_length"];
143 if (config.contains(
"adc_threshold"))
m_adc_threshold = config[
"adc_threshold"];
163 uint64_t ch_peak{last_tp.
channel};
167 std::vector<TriggerPrimitive> tp_list;
175 ch_min = std::min(ch_min, tp.channel);
176 ch_max = std::max(ch_max, tp.channel);
177 time_min = std::min(time_min, tp.time_start);
181 ch_peak = tp.channel;
185 tp_list.push_back(tp);
#define REGISTER_TRIGGER_ACTIVITY_MAKER(tam_name, tam_class)
std::deque< TriggerPrimitive > tp_list
void reset(TriggerPrimitive const &input_tp)
void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length)
void add(TriggerPrimitive const &input_tp)
uint64_t m_primitive_count
TriggerActivity construct_ta() const
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_ta)
TP processing function that creates & fills TAs.
timestamp_t m_window_length
const uint16_t k_sample_to_dts_ticks
void configure(const nlohmann::json &config)
virtual void configure(const nlohmann::json &config)
#define TLOG_DEBUG(lvl,...)
dunedaq::trgdataformats::timestamp_t timestamp_t
dunedaq::trgdataformats::TriggerPrimitive TriggerPrimitive
std::ostream & operator<<(std::ostream &os, const ProtoDUNEBSMWindow &window)
std::vector< TriggerPrimitive > inputs