BCEfficiencyFitter.cxx
30 BCEfficiencyFitter::BCEfficiencyFitter(const TH1& trials, const TH1& successes, const TF1& func, const std::string& name)
37 throw std::invalid_argument("BCEfficiencyFitter: Histograms do not have the same number of bins.");
39 // check compatibility of both histograms : bin edges incl. right-most edge = left edge of overflow bin
144 (std::string(fTrials.GetTitle()) + ";" + fTrials.GetXaxis()->GetTitle() + ";" + fTrials.GetYaxis()->GetTitle()).data(),
146 100, std::min(fTrials.GetMinimum(), fSuccesses.GetMinimum()), 1.1 * std::max(fTrials.GetMaximum(), fSuccesses.GetMaximum()));
208 GetUncertainties( static_cast<int>(fTrials.GetBinContent(i)), static_cast<int>(fSuccesses.GetBinContent(i)), 0.68, xexp, xmin, xmax);
273 double BCEfficiencyFitter::CalculatePValueFast(const std::vector<double>& par, unsigned nIterations)
280 double BCEfficiencyFitter::CalculatePValueFast(const std::vector<double>& pars, BCEfficiencyFitter::ToyDataInterface* callback, unsigned nIterations)
380 bool BCEfficiencyFitter::GetUncertainties(int n, int k, double p, double& xexp, double& xmin, double& xmax)
389 BCLog::OutDebug(Form("Calculating efficiency data-point of type %d for (n,k) = (%d,%d)", fDataPointType, n, k));
396 fHistogramBinomial.SetBinContent(i, BCMath::ApproxBinomial(n, k, fHistogramBinomial.GetBinCenter(i)));
void PrintShortFitSummary()
Prints a short summary of the fit results on the screen.
Definition: BCFitter.cxx:212
void SetBounds(unsigned index, double lower_bound, double upper_bound, bool fixed=false)
Set bounds for data values.
Definition: BCDataSet.cxx:267
void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method)
Definition: BCIntegrate.h:465
bool AddDataPoint(const BCDataPoint &datapoint)
Adds a data point to the data set.
Definition: BCDataSet.cxx:209
virtual void DrawData(bool flaglegend=false)
Draw the data in the current pad.
Definition: BCEfficiencyFitter.cxx:138
double LogApproxBinomial(unsigned n, unsigned k, double p)
Calculates natural logarithm of the Binomial probability using approximations for factorial calculati...
Definition: BCMath.cxx:79
double CalculatePValueFast(const std::vector< double > &par, BCEfficiencyFitter::ToyDataInterface *callback, unsigned nIterations=100000)
Calculate the p-value using fast-MCMC.
Definition: BCEfficiencyFitter.cxx:280
TGraph * GetErrorBandGraph(double level1, double level2) const
Definition: BCFitter.cxx:249
A guard object to prevent ROOT from taking over ownership of TNamed objects.
Definition: BCAux.h:171
std::vector< double > FindMode(std::vector< double > start=std::vector< double >())
Do the mode finding using a method set via SetOptimizationMethod.
Definition: BCIntegrate.cxx:1022
Draw mean and standard deviation.
Definition: BCEfficiencyFitter.h:47
Draw mean and central 68% interval.
Definition: BCEfficiencyFitter.h:49
void SetFitFunctionIndices(int indexx, int indexy)
Sets indices of the x and y values in function fits.
Definition: BCFitter.h:187
bool GetUncertainties(int n, int k, double p, double &xexp, double &xmin, double &xmax)
Calculates the central value and the lower and upper limits for a given probability.
Definition: BCEfficiencyFitter.cxx:380
BCAux::BCTrash< TObject > fObjectTrash
Storage for plot objects with proper clean-up.
Definition: BCEngineMCMC.h:1832
virtual void DrawFit(const std::string &options="", bool flaglegend=false)
Draw the fit in the current pad.
Definition: BCEfficiencyFitter.cxx:193
double ApproxBinomial(unsigned n, unsigned k, double p)
Calculates Binomial probability using approximations for factorial calculations if calculation for nu...
Definition: BCMath.cxx:97
std::vector< BCH1D::BCH1DSmallestInterval > GetSmallestIntervals(std::vector< double > masses)
Definition: BCH1D.cxx:452
Draw mean and smallest 68% interval.
Definition: BCEfficiencyFitter.h:48
BCIntegrate::BCOptimizationMethod GetOptimizationMethod() const
Definition: BCIntegrate.h:264
double Integral(const std::vector< double > ¶meters, double xmin, double xmax)
Compute the integral of the fit function between xmin and xmax.
Definition: BCFitter.cxx:196
Vector of intervals with information about total mass.
Definition: BCH1D.h:247
BCEfficiencyFitter(const TH1 &trials, const TH1 &successes, const TF1 &func, const std::string &name="efficiency_fitter_model")
Constructor.
Definition: BCEfficiencyFitter.cxx:30
virtual double LogLikelihood(const std::vector< double > ¶meters)
The log of the prior probability.
Definition: BCEfficiencyFitter.cxx:78
virtual const std::vector< double > & GetBestFitParameters() const
Definition: BCIntegrate.cxx:274
bool fFlagIntegration
Flag for using the ROOT TH1::Integral method (true), or linear interpolation (false) ...
Definition: BCFitter.h:297
void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method)
Definition: BCIntegrate.h:456
Abstract class which doesn't do anything but offers the right interface to allow calculation the dist...
Definition: BCEfficiencyFitter.h:59