libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
Histogramming processors

Description

Processors for histogramming.

Topics

 Binning processors
 Processors for binning data for histogramming.

Functions

template<histogram_policy Policy = histogram_policy::default_policy, typename ResetEvent = never_event, typename DataTypes = default_data_types, typename Downstream>
auto tcspc::histogram (arg::num_bins< std::size_t > num_bins, arg::max_per_bin< typename DataTypes::bin_type > max_per_bin, std::shared_ptr< bucket_source< typename DataTypes::bin_type > > buffer_provider, Downstream downstream)
 Create a processor that collects a histogram.
template<histogram_policy Policy = histogram_policy::default_policy, typename ResetEvent = never_event, typename DataTypes = default_data_types, typename Downstream>
auto tcspc::scan_histograms (arg::num_elements< std::size_t > num_elements, arg::num_bins< std::size_t > num_bins, arg::max_per_bin< typename DataTypes::bin_type > max_per_bin, std::shared_ptr< bucket_source< typename DataTypes::bin_type > > buffer_provider, Downstream downstream)
 Create a processor that scans over an array of histograms, updating each with the received bin increment clusters.

Function Documentation

◆ histogram()

template<histogram_policy Policy = histogram_policy::default_policy, typename ResetEvent = never_event, typename DataTypes = default_data_types, typename Downstream>
auto tcspc::histogram ( arg::num_bins< std::size_t > num_bins,
arg::max_per_bin< typename DataTypes::bin_type > max_per_bin,
std::shared_ptr< bucket_source< typename DataTypes::bin_type > > buffer_provider,
Downstream downstream )

Create a processor that collects a histogram.

The processor fills a histogram (held in a tcspc::bucket<DataTypes::bin_type> provided by buffer_provider) by incrementing the bin given by each incoming tcspc::bin_increment_event.

A round of accumulation is ended by resetting, for example by receiving a ResetEvent. After a reset, the histogram is replaced with a new bucket and a new round is started.

The value of Policy can modify behavior and specify what happens when a histogram bin overflows; see tcspc::histogram_policy for details.

The result is emitted in 2 ways:

Attention
Behavior is undefined if an incoming tcspc::bin_increment_event contains a bin index beyond the size of the histogram. The bin mapper should be chosen so that this does not occur.
Template Parameters
Policypolicy specifying behavior of the processor
ResetEventtype of event causing a new round to start
DataTypesdata type set specifying bin_index_type and bin_type
Downstreamdownstream processor type (usually deduced)
Parameters
num_binsnumber of bins in the histogram (must match the bin mapper used upstream)
max_per_binmaximum value allowed in each bin
buffer_providerbucket source providing series of buffers (a new bucket is used after every reset)
downstreamdownstream processor
Returns
processor
Events handled

◆ scan_histograms()

template<histogram_policy Policy = histogram_policy::default_policy, typename ResetEvent = never_event, typename DataTypes = default_data_types, typename Downstream>
auto tcspc::scan_histograms ( arg::num_elements< std::size_t > num_elements,
arg::num_bins< std::size_t > num_bins,
arg::max_per_bin< typename DataTypes::bin_type > max_per_bin,
std::shared_ptr< bucket_source< typename DataTypes::bin_type > > buffer_provider,
Downstream downstream )

Create a processor that scans over an array of histograms, updating each with the received bin increment clusters.

The processor fills an array of histograms (held in a tcspc::bucket<DataTypes::bin_type> provided by buffer_provider) by sequentially visiting its elements (each a histogram) on each incoming tcspc::bin_increment_cluster_event. One such iteration over the array is termed a scan. After a scan, the processor returns to the first element of the array and continues to add increments (by default adding to the previous scans).

A round consisting of multiple scans is ended by resetting, for example by receiving a ResetEvent. After a reset, the histogram array is replaced with a new bucket and a new round is started, in which handling of subsequent bin increment clusters begins at the first element of the array.

The value of Policy can modify behavior (including disabling the accumulating behavior) and specify what happens when a histogram bin overflows; see tcspc::histogram_policy for details.

The result is emitted in 3 ways:

Attention
Behavior is undefined if an incoming tcspc::bin_increment_cluster_event contains a bin index beyond the size of the histogram. The bin mapper should be chosen so that this does not occur.
Template Parameters
Policypolicy specifying behavior of the processor
ResetEventtype of event causing a new round to start
DataTypesdata type set specifying bin_index_type and bin_type
Downstreamdownstream processor type (usually deduced)
Parameters
num_elementsthe number of elements (each a histogram) in the array
num_binsthe number of bins in each histogram (must match the bin mapper used upstream)
max_per_binmaximum value allowed in each bin
buffer_providerbucket source providing series of buffers for each histogram array
downstreamdownstream processor
Returns
processor
Events handled