pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
TrigAlgoOutput.h
1#pragma once
2#ifndef PFLIB_PACKING_TRIGALGOOUTPUT_H
3#define PFLIB_PACKING_TRIGALGOOUTPUT_H
4
5#include <bitset>
6#include <optional>
7
8#include "pflib/logging/Logging.h"
9#include "pflib/packing/ECONTCaptureHeader.h"
10#include "pflib/packing/Reader.h"
11
12namespace pflib::packing {
13
15 public:
30 const SingleBXOutput& sample) {
31 o << "{ is_high_peak: " << sample.is_high_peak_
32 << ", elink_valid: " << sample.elink_valid_
33 << ", econ_tdata_dv: " << sample.econ_tdata_dv_
34 << ", algo_trigger: " << sample.algo_trigger_
35 << ", gated_trigger: " << sample.gated_trigger_ << " }";
36 return o;
37 }
38 };
39 const SingleBXOutput& sample(std::optional<int> i_sample = {}) const;
40 TrigAlgoOutput() = default;
41 TrigAlgoOutput(std::span<uint32_t> data);
42 void from(std::span<uint32_t> data);
43 Reader& read(Reader& r);
44 std::size_t n_samples() const;
45 const ECONTCaptureHeader& header() const;
46 int length() const;
47 bool is_high_peak(int i_stc, std::optional<int> i_sample = {}) const;
49 bool trigger(std::optional<int> i_sample = {}) const;
51 bool algo_trigger(std::optional<int> i_sample = {}) const;
52 bool elink_valid(std::optional<int> i_sample = {}) const;
53 bool econ_tdata_dv(std::optional<int> i_sample = {}) const;
54
55 private:
56 mutable ::pflib::logging::logger the_log_{::pflib::logging::get("decoding")};
58 ECONTCaptureHeader header_;
59};
60
61} // namespace pflib::packing
62
63#endif
Definition TrigAlgoOutput.h:14
bool algo_trigger(std::optional< int > i_sample={}) const
reports if the algo would have triggered
Definition TrigAlgoOutput.cxx:63
bool trigger(std::optional< int > i_sample={}) const
reports the gated trigger i.e. if a readout request would be sent
Definition TrigAlgoOutput.cxx:59
logger get(const std::string &name)
Gets a logger with the input name for its channel.
Definition Logging.cxx:24
bool algo_trigger_
if the algorithm would trigger
Definition TrigAlgoOutput.h:20
friend std::ostream & operator<<(std::ostream &o, const SingleBXOutput &sample)
print human readable sample
Definition TrigAlgoOutput.h:29
bool gated_trigger_
if a trigger was actually sent (the trigger may be prevented by the single-shot gate)
Definition TrigAlgoOutput.h:23
bool econ_tdata_dv_
if the link alignment was valid
Definition TrigAlgoOutput.h:27
std::bitset< 8 > is_high_peak_
whether STC i had a high peak
Definition TrigAlgoOutput.h:18
bool elink_valid_
if the elink was valid
Definition TrigAlgoOutput.h:25