pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
FWHistoPool::SingleChannelHistogram Class Reference

A single histogram read into memory. More...

#include <FWHistoPool.h>

Collaboration diagram for FWHistoPool::SingleChannelHistogram:
[legend]

Public Member Functions

 SingleChannelHistogram (FillValue fill_type, int index, std::array< uint32_t, 256 > values, double collection_time)
 
FillValue fill_type () const
 which type of fill value was put into the histogram
 
int index () const
 which index was read
 
const std::array< uint32_t, 256 > values () const
 access the values of the histogram
 
double collection_time () const
 how long was the histogram being filled?
 
nlohmann::json to_json () const
 convert the histogram into UHI JSON
 

Private Attributes

FillValue fill_type_
 what type of value was filled into the histogram
 
int index_
 index of STC in this histogram
 
std::array< uint32_t, 256 > values_
 content of the histogram
 
double collection_time_
 time histogram was filling in seconds (or zero if no last clear)
 

Detailed Description

A single histogram read into memory.

Member Function Documentation

◆ to_json()

nlohmann::json FWHistoPool::SingleChannelHistogram::to_json ( ) const

convert the histogram into UHI JSON

This JSON output is helpful for loading into python plotting. If only the output from this function is written to the file, then the histogram can be loaded with

import json
import uhi.io.json
import hist
with open('path/to/hist.json') as f:
h_ir = json.load(f, object_hook=uhi.io.json.object_hook)
h = hist.Hist(h_ir)
# h is a 1D histogram of the STC sum
Returns
JSON representation of histogram

The documentation for this class was generated from the following files: