|
pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
|
read and print histograms filled by the firmware More...
#include <FWHistoPool.h>
Classes | |
| class | BlockHistogram |
| a full histogram block read into memory More... | |
| class | SingleChannelHistogram |
| A single histogram read into memory. More... | |
Public Types | |
| enum class | FillValue : int { DecodedSum = 0 , EncodedSum = 1 , HighPeak = 2 , Test = 15 } |
| the blocks of histograms are logically distinct by what values we fill into them More... | |
Public Member Functions | |
| FWHistoPool (int i_trigpath) | |
| construct the pool for the passed trigpath index (0 or 1) | |
| void | clear () |
| reset all of the histograms in the pool to zero counts | |
| void | debug (int fill_val) |
| use the test histograms to check the functionality of the histogram block | |
| std::array< uint32_t, 256 > | read_fw (FillValue fill_type, int index) |
| read a histogram's content from the firmware | |
| SingleChannelHistogram | read (FillValue fill_type, int ihist) |
| read the current values for the input histogram index of the input value type | |
| BlockHistogram | read (FillValue fill_type) |
| read the current values of a block of histograms of the input value type | |
Private Types | |
| using | the_clock = std::chrono::high_resolution_clock |
| type of clock we'll use to measure collection time | |
| using | a_time_point = std::chrono::time_point<the_clock> |
| a time point for our clock | |
Private Member Functions | |
| std::optional< double > | get_collection_time (a_time_point now) const |
| get the collection time | |
Private Attributes | |
| pflib::UIO | uio_ |
| handle to register area of trigpath firmware block | |
| std::optional< a_time_point > | time_of_last_clear_ |
| last time the clear method was called | |
| pflib::logging::logger | the_log_ |
| share logging channel with histo menu | |
read and print histograms filled by the firmware
|
strong |
| void FWHistoPool::debug | ( | int | fill_val | ) |
use the test histograms to check the functionality of the histogram block
The fill value is split across the four test histograms. The lowest 2 bits go into test histogram 0. The next lowest 2 bits go into test histogram 1 multiplied by 4. The next lowest 2 bits go into test histogram 2 multiplied by 16. The next lowest 2 bits go into test histogram 3 multiplied by 64.
For example, a value of 85 (= 0b01010101) should cause bin 1 of histogram 0, bin 4 of histogram 1, bin 16 of histogram 2, and bin 64 of histogram 2 to increment by one.
After doing this single fill, all of the test histograms are printed to the terminal to view the resulting values.
| FWHistoPool::BlockHistogram FWHistoPool::read | ( | FillValue | fill_type | ) |
read the current values of a block of histograms of the input value type
| [in] | fill_type | FillValue choosing which block of histograms to read |
| FWHistoPool::SingleChannelHistogram FWHistoPool::read | ( | FWHistoPool::FillValue | fill_type, |
| int | ihist ) |
read the current values for the input histogram index of the input value type
| [in] | fill_type | FillValue choosing which block of histograms to read from |
| [in] | ihist | index of histogram within that block [0,7] |
| std::array< uint32_t, 256 > FWHistoPool::read_fw | ( | FWHistoPool::FillValue | fill_type, |
| int | index ) |
read a histogram's content from the firmware
| [in] | fill_type | block of histograms to read from |
| [in] | index | index of the histogram we want in that block |