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"
65 void debug(
int fill_val);
137 nlohmann::json
to_json()
const;
197 nlohmann::json
to_json()
const;
a full histogram block read into memory
Definition FWHistoPool.h:154
FillValue fill_type() const
which type of fill value was put into the histogram
Definition FWHistoPool.cxx:164
double collection_time_
time histogram was filling in seconds (or zero if no last clear)
Definition FWHistoPool.h:160
nlohmann::json to_json() const
convert the histogram into UHI JSON
Definition FWHistoPool.cxx:177
FillValue fill_type_
what type of value was filled into the histogram
Definition FWHistoPool.h:156
double collection_time() const
how long was the histogram being filled?
Definition FWHistoPool.cxx:173
const std::array< std::array< uint32_t, 256 >, 8 > values() const
access the values of the histogram
Definition FWHistoPool.cxx:169
std::array< std::array< uint32_t, 256 >, 8 > values_
content of the histogram
Definition FWHistoPool.h:158
A single histogram read into memory.
Definition FWHistoPool.h:94
const std::array< uint32_t, 256 > values() const
access the values of the histogram
Definition FWHistoPool.cxx:91
FillValue fill_type() const
which type of fill value was put into the histogram
Definition FWHistoPool.cxx:85
double collection_time() const
how long was the histogram being filled?
Definition FWHistoPool.cxx:96
std::array< uint32_t, 256 > values_
content of the histogram
Definition FWHistoPool.h:100
nlohmann::json to_json() const
convert the histogram into UHI JSON
Definition FWHistoPool.cxx:112
int index() const
which index was read
Definition FWHistoPool.cxx:89
int index_
index of STC in this histogram
Definition FWHistoPool.h:98
double collection_time_
time histogram was filling in seconds (or zero if no last clear)
Definition FWHistoPool.h:102
FillValue fill_type_
what type of value was filled into the histogram
Definition FWHistoPool.h:96
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:56
std::array< uint32_t, 256 > read_fw(FillValue fill_type, int index)
read a histogram's content from the firmware
Definition FWHistoPool.cxx:27
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
SingleChannelHistogram read(FillValue fill_type, int ihist)
read the current values for the input histogram index of the input value type
Definition FWHistoPool.cxx:144
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
void debug(int fill_val)
use the test histograms to check the functionality of the histogram block
Definition FWHistoPool.cxx:61
FillValue
the blocks of histograms are logically distinct by what values we fill into them
Definition FWHistoPool.h:71
@ Test
the test histogram codes
@ 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
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:49
boost::log::sources::severity_channel_logger_mt< level, std::string > logger
our logger type
Definition Logging.h:39