2#ifndef PFTOOL_TRIG_FWHISTO_H
3#define PFTOOL_TRIG_FWHISTO_H
6#include <nlohmann/json.hpp>
9#include "pflib/logging/Logging.h"
10#include "pflib/zcu/UIO.h"
116 nlohmann::json
to_json()
const;
179 nlohmann::json
to_json()
const;
a full histogram block read into memory
Definition FWHistoPool.h:134
FillValue fill_type() const
which type of fill value was put into the histogram
Definition FWHistoPool.cxx:153
double collection_time_
time histogram was filling in seconds (or zero if no last clear)
Definition FWHistoPool.h:142
int econt_
which ECON-T was read
Definition FWHistoPool.h:138
nlohmann::json to_json() const
convert the histogram into UHI JSON
Definition FWHistoPool.cxx:166
FillValue fill_type_
what type of value was filled into the histogram
Definition FWHistoPool.h:136
double collection_time() const
how long was the histogram being filled?
Definition FWHistoPool.cxx:162
const std::array< std::array< uint32_t, 256 >, 8 > values() const
access the values of the histogram
Definition FWHistoPool.cxx:158
std::array< std::array< uint32_t, 256 >, 8 > values_
content of the histogram
Definition FWHistoPool.h:140
A single histogram read into memory.
Definition FWHistoPool.h:71
const std::array< uint32_t, 256 > values() const
access the values of the histogram
Definition FWHistoPool.cxx:81
FillValue fill_type() const
which type of fill value was put into the histogram
Definition FWHistoPool.cxx:75
double collection_time() const
how long was the histogram being filled?
Definition FWHistoPool.cxx:86
std::array< uint32_t, 256 > values_
content of the histogram
Definition FWHistoPool.h:79
nlohmann::json to_json() const
convert the histogram into UHI JSON
Definition FWHistoPool.cxx:100
int index() const
which index was read
Definition FWHistoPool.cxx:79
int index_
index of STC in this histogram
Definition FWHistoPool.h:77
int econt_
which ECON-T was read
Definition FWHistoPool.h:75
double collection_time_
time histogram was filling in seconds (or zero if no last clear)
Definition FWHistoPool.h:81
FillValue fill_type_
what type of value was filled into the histogram
Definition FWHistoPool.h:73
read and print histograms filled by the firmware
Definition FWHistoPool.h:15
void clear()
reset all of the histograms in the pool to zero counts
Definition FWHistoPool.cxx:61
static uint32_t FW_VERSION
firmware version being read from (updated in constructor)
Definition FWHistoPool.h:21
std::optional< a_time_point > time_of_last_clear_
last time the clear method was called
Definition FWHistoPool.h:30
pflib::UIO uio_
handle to register area of trigpath firmware block
Definition FWHistoPool.h:23
std::optional< double > get_collection_time(a_time_point now) const
get the collection time
Definition FWHistoPool.cxx:14
static const uint32_t ADDR_MASK
mask for writing histogram addresses
Definition FWHistoPool.h:19
pflib::logging::logger the_log_
share logging channel with histo menu
Definition FWHistoPool.h:33
SingleChannelHistogram read(FillValue fill_type, int econt, int ihist)
read the current values for the input histogram index of the input value type
Definition FWHistoPool.cxx:127
FillValue
the blocks of histograms are logically distinct by what values we fill into them
Definition FWHistoPool.h:49
@ EncodedSum
the sums as unpacked but still in their 5E+4M encoding
@ HighPeak
value of rolling sum, high peaks used for trigger
@ DecodedSum
the sums as output by the decoder lut
std::array< uint32_t, 256 > read_fw(FillValue fill_type, int econt, int index)
read a histogram's content from the firmware
Definition FWHistoPool.cxx:27
static const uint32_t ADDR_REG
register where we write which histogram address we want to read
Definition FWHistoPool.h:17
FWHistoPool(int i_trigpath)
construct the pool for the passed trigpath index (0 or 1)
Definition FWHistoPool.cxx:54
boost::log::sources::severity_channel_logger_mt< level, std::string > logger
our logger type
Definition Logging.h:39