libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::power_of_2_bin_mapper< NDataBits, NHistoBits, Flip, DataTypes > Struct Template Reference

Description

template<unsigned NDataBits, unsigned NHistoBits, bool Flip = false, typename DataTypes = default_data_types>
struct tcspc::power_of_2_bin_mapper< NDataBits, NHistoBits, Flip, DataTypes >

Bin mapper that discards the least significant bits.

This bin mapper performs fast linear binning by taking the most significant bits of the datapoint as the bin index.

For example, if NDataBits is 12 and NHistoBits is 8, incoming datapoints must contain values in the range [0, 4095] and will be mapped to bin indices [0, 255], where each bin has a width of 16.

No division operations are used by this bin mapper.

Datapoints outside of the mapped range are discarded.

Template Parameters
NDataBitsnumber of significant bits in the datapoints
NHistoBitsnumber of bits used for bin indices
Flipwhether to flip the bin indices
DataTypesdata type set specifying datapoint_type and bin_index_type

Public Member Functions

auto n_bins () const -> std::size_t
 Implements bin mapper requirement.
auto operator() (typename DataTypes::datapoint_type datapoint) const -> std::optional< typename DataTypes::bin_index_type >
 Implements bin mapper requirement.

The documentation for this struct was generated from the following file: