2#ifndef PFLIB_PACKING_TRIGALGOOUTPUT_H
3#define PFLIB_PACKING_TRIGALGOOUTPUT_H
8#include "pflib/logging/Logging.h"
9#include "pflib/packing/ECONTCaptureHeader.h"
10#include "pflib/packing/Reader.h"
12namespace pflib::packing {
42 const SingleBXOutput& sample(std::optional<int> i_sample = {})
const;
43 TrigAlgoOutput() =
default;
44 TrigAlgoOutput(std::span<uint32_t> data);
45 void from(std::span<uint32_t> data);
46 Reader& read(Reader& r);
48 const ECONTCaptureHeader& header()
const;
50 bool is_high_peak(
int i_stc, std::optional<int> i_sample = {})
const;
52 bool trigger(std::optional<int> i_sample = {})
const;
54 bool algo_trigger(std::optional<int> i_sample = {})
const;
55 bool econ_tdata_dv(std::optional<int> i_sample = {})
const;
60 ECONTCaptureHeader header_;
Definition TrigAlgoOutput.h:14
bool algo_trigger(std::optional< int > i_sample={}) const
reports if the algo would have triggered
Definition TrigAlgoOutput.cxx:68
bool trigger(std::optional< int > i_sample={}) const
reports the gated trigger i.e. if a readout request would be sent
Definition TrigAlgoOutput.cxx:64
logger get(const std::string &name)
Gets a logger with the input name for its channel.
Definition Logging.cxx:24
Definition TrigAlgoOutput.h:16
std::bitset< 5 > algo_trigger_history_
the last 5 clk ticks of the algo trigger
Definition TrigAlgoOutput.h:20
bool algo_trigger_
if the algorithm would trigger
Definition TrigAlgoOutput.h:24
std::bitset< 5 > gated_trigger_history_
the last 5 clk ticks of the actual trigger
Definition TrigAlgoOutput.h:22
friend std::ostream & operator<<(std::ostream &o, const SingleBXOutput &sample)
print human readable sample
Definition TrigAlgoOutput.h:31
bool gated_trigger_
if a trigger was actually sent (the trigger may be prevented by the single-shot gate)
Definition TrigAlgoOutput.h:27
bool econ_tdata_dv_
if the link alignment was valid
Definition TrigAlgoOutput.h:29
std::bitset< 16 > is_high_peak_
whether STC i had a high peak
Definition TrigAlgoOutput.h:18