Rebin transformation¶
Description¶
Performs the histogram rebinning. The rebinning is implemented via multiplication by a sparse matrix.
Inputs¶
rebin.histin
— the input histogram. The input edges are defined from it.
Outputs¶
rebin.histout
— the output histogram with new binning.
Arguments¶
size_t n
— number of bin edges.double* edges
— bin edges.int rounding
— number of decimal places to round to. Should be sufficient to distinguish nearest bins.
Tests¶
Use the following commands for the usage example and testing:
./tests/elementary/test_rebinner.py
Implementation¶
The algorithm is the following:
On initialization both edge specifications are rounded to the specified precision in order to avoid float comparison uncertainty.
Bins below
edges[0]
are ignored.Relevant conversion matrix items are filled with 1.
Bins above
edges[-1]
are ignored.