11#ifndef INCLUDE_GUARD_BELLE2_MVA_BINNING_HEADER
12#define INCLUDE_GUARD_BELLE2_MVA_BINNING_HEADER
33 explicit Binning(
unsigned int nBins = 0);
41 unsigned int getBin(
float datapoint)
const;
71 const std::vector<bool>& isSignal,
unsigned int nBins);
81 const std::vector<bool>& isSignal,
unsigned int nBins);
Binning of a data distribution Provides PDF and CDF values of the distribution per bin.
std::vector< float > m_bckgrd_pdf
Background pdf of data distribution per bin.
std::vector< float > m_signal_pdf
Signal pdf of data distribution per bin.
std::vector< float > m_boundaries
Boundaries of data distribution, including minimum and maximum value as first and last boundary.
std::vector< float > m_bckgrd_cdf
Background cdf of data distribution per bin.
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.
double m_bckgrd_yield
Background yield in data distribution.
double m_signal_yield
Signal yield in data distribution.
std::vector< float > m_signal_cdf
Signal cdf of data distribution per bin.
void calculateCDFsFromPDFs()
Calculates the CDF values from the pdf values, which are assumed to be normalized.
void normalizePDFs()
Normalizes the PDF values, so their sum is 1.
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.
unsigned int getBin(float datapoint) const
Gets the bin corresponding to the given datapoint.
Abstract base class for different kinds of events.