Belle II Software development
|
Binning of a data distribution Provides PDF and CDF values of the distribution per bin. More...
#include <Binning.h>
Public Member Functions | |
Binning (unsigned int nBins=0) | |
Creates an empty binning with nBins. | |
unsigned int | getBin (float datapoint) const |
Gets the bin corresponding to the given datapoint. | |
void | normalizePDFs () |
Normalizes the PDF values, so their sum is 1. | |
void | calculateCDFsFromPDFs () |
Calculates the CDF values from the pdf values, which are assumed to be normalized. | |
Static Public Member Functions | |
static Binning | CreateEqualFrequency (const std::vector< float > &data, const std::vector< float > &weights, const std::vector< bool > &isSignal, unsigned int nBins) |
Create an equal frequency (aka equal-statistics) binning. | |
static Binning | CreateEquidistant (const std::vector< float > &data, const std::vector< float > &weights, const std::vector< bool > &isSignal, unsigned int nBins) |
Create an equidistant binning. | |
Public Attributes | |
double | m_signal_yield |
Signal yield in data distribution. | |
double | m_bckgrd_yield |
Background yield in data distribution. | |
std::vector< float > | m_signal_pdf |
Signal pdf of data distribution per bin. | |
std::vector< float > | m_signal_cdf |
Signal cdf of data distribution per bin. | |
std::vector< float > | m_bckgrd_pdf |
Background pdf of data distribution per bin. | |
std::vector< float > | m_bckgrd_cdf |
Background cdf of data distribution per bin. | |
std::vector< float > | m_boundaries |
Boundaries of data distribution, including minimum and maximum value as first and last boundary. | |
Binning of a data distribution Provides PDF and CDF values of the distribution per bin.
|
explicit |
Creates an empty binning with nBins.
nBins | number of bins |
Definition at line 21 of file Binning.cc.
void calculateCDFsFromPDFs | ( | ) |
Calculates the CDF values from the pdf values, which are assumed to be normalized.
Definition at line 73 of file Binning.cc.
|
static |
Create an equal frequency (aka equal-statistics) binning.
data | data-points sampled from the distribution |
weights | weights for each data-point |
isSignal | per data point |
nBins | number of bins |
Definition at line 93 of file Binning.cc.
|
static |
Create an equidistant binning.
data | data-points sampled from the distribution |
weights | weights for each data-point |
isSignal | per data point |
nBins | number of bins |
Definition at line 139 of file Binning.cc.
unsigned int getBin | ( | float | datapoint | ) | const |
Gets the bin corresponding to the given datapoint.
There are no overflow/underflow bins, so data points outside the original range are mapped to the first and last bin.
datapoint | for which the bin is returned |
Definition at line 34 of file Binning.cc.
void normalizePDFs | ( | ) |
Normalizes the PDF values, so their sum is 1.
Definition at line 47 of file Binning.cc.
std::vector<float> m_bckgrd_cdf |
std::vector<float> m_bckgrd_pdf |
double m_bckgrd_yield |
std::vector<float> m_boundaries |
std::vector<float> m_signal_cdf |
std::vector<float> m_signal_pdf |