Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
rf709_BarlowBeeston.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Implementing the Barlow-Beeston method for taking into account the statistical uncertainty of a Monte-Carlo fit template.

#include "RooRealVar.h"
#include "RooGaussian.h"
#include "RooUniform.h"
#include "RooDataSet.h"
#include "RooDataHist.h"
#include "RooHistFunc.h"
#include "RooRealSumPdf.h"
#include "RooProduct.h"
#include "RooConstVar.h"
#include "RooPoisson.h"
#include "RooProdPdf.h"
#include "RooFitResult.h"
#include "RooPlot.h"
#include "RooMsgService.h"
#include "TCanvas.h"
#include "TPaveText.h"
#include <cmath>
#include <iostream>
#include <memory>
RooArgSet createConstraints(RooArgList const &gammas, RooArgList const &samples, RooArgSet &globalObservables)
{
RooArgSet constraints;
for (std::size_t i = 0; i < gammas.size(); ++i) {
auto *gamma = static_cast<RooRealVar *>(&gammas[i]);
auto nomName = "nom_" + std::string(gamma->GetName());
auto tauName = std::string(gamma->GetName()) + "_tau";
auto meanName = std::string(gamma->GetName()) + "_mean";
auto poissonName = std::string(gamma->GetName()) + "_constraint";
double nomVal = 0.0;
for (auto *func : static_range_cast<RooHistFunc *>(samples)) {
nomVal += func->dataHist().weight(i);
}
// Like in HistFactory, the gamma of an empty bin is fixed and not
// constrained. Otherwise, it would be a flat direction of the likelihood.
// The other gammas get the relative Poisson uncertainty as initial error.
if (nomVal == 0.0) {
gamma->setConstant(true);
continue;
}
gamma->setError(1.0 / std::sqrt(nomVal));
auto nominal = std::make_unique<RooRealVar>(nomName.c_str(), nomName.c_str(), nomVal, 0.0, RooNumber::infinity());
nominal->setConstant(true);
globalObservables.add(*nominal);
auto tau = std::make_unique<RooConstVar>(tauName.c_str(), tauName.c_str(), nominal->getVal());
auto mean = std::make_unique<RooProduct>(meanName.c_str(), meanName.c_str(), *gamma, *tau);
mean->addOwnedComponents(std::move(tau));
auto poisson = std::make_unique<RooPoisson>(poissonName.c_str(), poissonName.c_str(), *nominal, *mean);
poisson->addOwnedComponents(std::move(nominal));
poisson->addOwnedComponents(std::move(mean));
constraints.addOwned(std::move(poisson));
}
return constraints;
}
void rf709_BarlowBeeston()
{
using namespace RooFit;
// First, construct a likelihood model with a Gaussian signal on top of a uniform background
RooRealVar x("x", "x", -20, 20);
x.setBins(25);
RooRealVar meanG("meanG", "meanG", 1, -10, 10);
RooRealVar sigG("sigG", "sigG", 1.5, -10, 10);
RooGaussian g("g", "Gauss", x, meanG, sigG);
RooUniform u("u", "Uniform", x);
// Generate the data to be fitted
std::unique_ptr<RooDataSet> sigData(g.generate(x, 50));
std::unique_ptr<RooDataSet> bkgData(u.generate(x, 1000));
RooDataSet sumData("sumData", "Gauss + Uniform", x);
sumData.append(*sigData);
sumData.append(*bkgData);
// Make histogram templates for signal and background.
// Let's take a signal distribution with low statistics and a more accurate
// background distribution.
// Normally, these come from Monte Carlo simulations, but we will just generate them.
std::unique_ptr<RooDataHist> dh_sig(g.generateBinned(x, 50));
std::unique_ptr<RooDataHist> dh_bkg(u.generateBinned(x, 10000));
// ***** Case 0 - 'Rigid templates' *****
// Construct histogram shapes for signal and background
RooHistFunc p_h_sig("p_h_sig", "p_h_sig", x, *dh_sig);
RooHistFunc p_h_bkg("p_h_bkg", "p_h_bkg", x, *dh_bkg);
// Construct scale factors for adding the two distributions
RooRealVar Asig0("Asig", "Asig", 1, 0.01, 5000);
RooRealVar Abkg0("Abkg", "Abkg", 1, 0.01, 5000);
// Construct the sum model
RooRealSumPdf model0("model0", "model0", {p_h_sig, p_h_bkg}, {Asig0, Abkg0}, true);
// ***** Case 1 - 'Barlow Beeston' *****
// Construct parameterized histogram shapes for signal and background
RooArgList gammas_sig1{ParamHistFunc::createParamSet("p_ph_sig_gamma", x.numBins(), 0, 10)};
RooArgList gammas_bkg1{ParamHistFunc::createParamSet("p_ph_bkg_gamma", x.numBins(), 0, 10)};
ParamHistFunc p_phf_sig1{"p_phf_sig1", "p_phf_sig1", x, gammas_sig1};
ParamHistFunc p_phf_bkg1{"p_phf_bkg1", "p_phf_bkg1", x, gammas_bkg1};
RooProduct p_p_sig1{"p_p_sig1", "p_p_sig1", p_h_sig, p_phf_sig1};
RooProduct p_p_bkg1{"p_p_bkg1", "p_p_bkg1", p_h_bkg, p_phf_bkg1};
RooRealVar Asig1("Asig", "Asig", 1, 0.01, 5000);
RooRealVar Abkg1("Abkg", "Abkg", 1, 0.01, 5000);
// Construct the sum of these
RooRealSumPdf model1_tmp("sp_ph", "sp_ph", {p_p_sig1, p_p_bkg1}, {Asig1, Abkg1}, true);
// Construct the subsidiary poisson measurements constraining the histogram parameters
// These ensure that the bin contents of the histograms are only allowed to vary within
// the statistical uncertainty of the Monte Carlo.
RooArgSet globs1;
RooArgSet constraints_sig1{createConstraints(gammas_sig1, p_h_sig, globs1)};
RooArgSet constraints_bkg1{createConstraints(gammas_bkg1, p_h_bkg, globs1)};
// Construct the joint model with template PDFs and constraints
RooProdPdf model1("model1", "model1", {model1_tmp, constraints_sig1, constraints_bkg1});
// ***** Case 2 - 'Barlow Beeston' light (one parameter per bin for all samples) *****
// Construct the histogram shapes, using the same parameters for signal and background.
// There is one parameter per bin, such as `p_ph_gamma_bin_0`. This allows bin 0 to
// fluctuate up and down. The SAME ParamHistFunc scales both the signal and the background
// histogram, so the bins fluctuate synchronously. This reduces the number of parameters.
RooArgList gammas2{ParamHistFunc::createParamSet("p_ph_gamma", x.numBins(), 0, 10)};
ParamHistFunc p_phf2{"p_phf2", "p_phf2", x, gammas2};
RooProduct p_p_sig2{"p_p_sig2", "p_p_sig2", p_h_sig, p_phf2};
RooProduct p_p_bkg2{"p_p_bkg2", "p_p_bkg2", p_h_bkg, p_phf2};
RooRealVar Asig2("Asig", "Asig", 1, 0.01, 5000);
RooRealVar Abkg2("Abkg", "Abkg", 1, 0.01, 5000);
// As before, construct the sum of signal2 and background2
RooRealSumPdf model2_tmp("sp_ph", "sp_ph", {p_p_sig2, p_p_bkg2}, {Asig2, Abkg2}, true);
// Construct the subsidiary poisson measurements constraining the statistical fluctuations
RooArgSet globs2;
RooArgSet constraints2{createConstraints(gammas2, {p_h_sig, p_h_bkg}, globs2)};
// Construct the joint model
RooProdPdf model2("model2", "model2", {model2_tmp, constraints2});
// ************ Fit all models to data and plot *********************
std::unique_ptr<RooFitResult> result0{model0.fitTo(sumData, PrintLevel(0), Save())};
std::unique_ptr<RooFitResult> result1{model1.fitTo(sumData, PrintLevel(0), Save(), GlobalObservables(globs1))};
std::unique_ptr<RooFitResult> result2{model2.fitTo(sumData, PrintLevel(0), Save(), GlobalObservables(globs2))};
TCanvas *can = new TCanvas("can", "", 1500, 600);
can->Divide(3, 1);
TPaveText pt(-19.5, 1, -2, 25);
can->cd(1);
auto frame = x.frame(Title("No template uncertainties"));
// Plot data to enable automatic determination of model0 normalisation:
sumData.plotOn(frame);
model0.plotOn(frame, LineColor(kBlue), VisualizeError(*result0));
// Plot data again to show it on top of model0 error bands:
sumData.plotOn(frame);
// Plot model components
model0.plotOn(frame, LineColor(kBlue));
model0.plotOn(frame, Components(p_h_sig), LineColor(kAzure));
model0.plotOn(frame, Components(p_h_bkg), LineColor(kRed));
model0.paramOn(frame);
sigData->plotOn(frame, MarkerColor(kBlue));
frame->Draw();
for (auto text : {"No template uncertainties", "are taken into account.", "This leads to low errors",
"for the parameters A, since", "the only source of errors", "are the data statistics."}) {
}
can->cd(2);
frame = x.frame(Title("Barlow Beeston for Sig & Bkg separately"));
sumData.plotOn(frame);
model1.plotOn(frame, LineColor(kBlue), VisualizeError(*result1));
// Plot data again to show it on top of error bands:
sumData.plotOn(frame);
model1.plotOn(frame, LineColor(kBlue));
model1.plotOn(frame, Components(p_p_sig1), LineColor(kAzure));
model1.plotOn(frame, Components(p_p_bkg1), LineColor(kRed));
model1.paramOn(frame, Parameters({Asig1, Abkg1}));
sigData->plotOn(frame, MarkerColor(kBlue));
frame->Draw();
pt.Clear();
for (auto text : {"With gamma parameters, the", "signal & background templates", "can adapt to the data.",
"Note how the blue signal", "template changes its shape.", "This leads to higher errors",
"of the scale parameters A."}) {
}
can->cd(3);
frame = x.frame(Title("Barlow Beeston light for (Sig+Bkg)"));
sumData.plotOn(frame);
model2.plotOn(frame, LineColor(kBlue), VisualizeError(*result2));
// Plot data again to show it on top of model0 error bands:
sumData.plotOn(frame);
model2.plotOn(frame, LineColor(kBlue));
model2.plotOn(frame, Components(p_p_sig2), LineColor(kAzure));
model2.plotOn(frame, Components(p_p_bkg2), LineColor(kRed));
model2.paramOn(frame, Parameters({Asig2, Abkg2}));
sigData->plotOn(frame, MarkerColor(kBlue));
frame->Draw();
pt.Clear();
for (auto text : {"When signal and background", "template share one gamma para-", "meter per bin, they adapt less.",
"The errors of the A parameters", "also shrink slightly."}) {
}
std::cout << "Asig [normal ] = " << Asig0.getVal() << " +/- " << Asig0.getError() << std::endl;
std::cout << "Asig [BB ] = " << Asig1.getVal() << " +/- " << Asig1.getError() << std::endl;
std::cout << "Asig [BBlight] = " << Asig2.getVal() << " +/- " << Asig2.getError() << std::endl;
}
#define g(i)
Definition RSha256.hxx:105
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
@ kRed
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
@ kAzure
Definition Rtypes.h:67
Option_t Option_t TPoint TPoint const char text
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
static RooArgList createParamSet(RooWorkspace &w, const std::string &, const RooArgList &Vars)
Create the list of RooRealVar parameters which represent the height of the histogram bins.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
RooFit::OwningPtr< RooFitResult > fitTo(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Fit PDF to given dataset.
Definition RooAbsPdf.h:149
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold unbinned data.
Definition RooDataSet.h:32
Plain Gaussian p.d.f.
Definition RooGaussian.h:24
A real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:29
static RooMsgService & instance()
Return reference to singleton instance.
StreamConfig & getStream(Int_t id)
static constexpr double infinity()
Return internal infinity representation.
Definition RooNumber.h:25
Efficient implementation of a product of PDFs of the form.
Definition RooProdPdf.h:35
Represents the product of a given set of RooAbsReal objects.
Definition RooProduct.h:29
Implements a PDF constructed from a sum of functions:
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Flat p.d.f.
Definition RooUniform.h:24
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:42
The Canvas class.
Definition TCanvas.h:23
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Definition TCanvas.cxx:732
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
Definition TObject.cxx:318
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
Definition TPad.cxx:1361
A Pave (see TPave) with text, lines or/and boxes inside.
Definition TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Clear(Option_t *option="") override
Clear all lines in this pavetext.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Definition TPave.h:79
void Draw(Option_t *option="") override=0
Default Draw method for all objects.
TPaveText * pt
RooCmdArg Parameters(const RooArgSet &params)
RooCmdArg Save(bool flag=true)
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg Components(Args_t &&... argsOrArgSet)
RooCmdArg LineColor(TColorNumber color)
RooCmdArg VisualizeError(const RooDataSet &paramData, double Z=1)
RooCmdArg MarkerColor(TColorNumber color)
Double_t x[n]
Definition legend1.C:17
double gamma(double x)
double poisson(double x, double par)
Definition MathFuncs.h:239
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:73
const char * Title
Definition TXMLSetup.cxx:67
void removeTopic(RooFit::MsgTopic oldTopic)
[#0] WARNING:InputArguments -- The parameter 'sigG' with range [-10, 10] of the RooGaussian 'g' exceeds the safe range of (0, inf). Advise to limit its range.
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
[#1] INFO:Fitting -- RooAbsPdf::fitTo(model0_over_model0_Int[x]) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- using generic CPU library compiled with no vectorizations
[#1] INFO:Fitting -- Creation of NLL object took 517.932 μs
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model0_over_model0_Int[x]_sumData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- [fitFCN] No discrete parameters, performing continuous minimization only
Minuit2Minimizer: Minimize with max-calls 1000 convergence for edm < 1 strategy 1
Minuit2Minimizer : Valid minimum - status = 0
FVAL = -2388.31039421315518
Edm = 3.25299757922590944e-06
Nfcn = 60
Abkg = 0.0614547 +/- 0.00211669 (limited)
Asig = 0.833778 +/- 0.1898 (limited)
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
[#1] INFO:Minimization -- Including the following constraint terms in minimization: (p_ph_sig_gamma_bin_11_constraint,p_ph_sig_gamma_bin_12_constraint,p_ph_sig_gamma_bin_13_constraint,p_ph_sig_gamma_bin_14_constraint,p_ph_sig_gamma_bin_15_constraint,p_ph_bkg_gamma_bin_0_constraint,p_ph_bkg_gamma_bin_1_constraint,p_ph_bkg_gamma_bin_2_constraint,p_ph_bkg_gamma_bin_3_constraint,p_ph_bkg_gamma_bin_4_constraint,p_ph_bkg_gamma_bin_5_constraint,p_ph_bkg_gamma_bin_6_constraint,p_ph_bkg_gamma_bin_7_constraint,p_ph_bkg_gamma_bin_8_constraint,p_ph_bkg_gamma_bin_9_constraint,p_ph_bkg_gamma_bin_10_constraint,p_ph_bkg_gamma_bin_11_constraint,p_ph_bkg_gamma_bin_12_constraint,p_ph_bkg_gamma_bin_13_constraint,p_ph_bkg_gamma_bin_14_constraint,p_ph_bkg_gamma_bin_15_constraint,p_ph_bkg_gamma_bin_16_constraint,p_ph_bkg_gamma_bin_17_constraint,p_ph_bkg_gamma_bin_18_constraint,p_ph_bkg_gamma_bin_19_constraint,p_ph_bkg_gamma_bin_20_constraint,p_ph_bkg_gamma_bin_21_constraint,p_ph_bkg_gamma_bin_22_constraint,p_ph_bkg_gamma_bin_23_constraint,p_ph_bkg_gamma_bin_24_constraint)
[#1] INFO:Minimization -- The following global observables have been defined and their values are taken from the model: (nom_p_ph_sig_gamma_bin_11,nom_p_ph_sig_gamma_bin_12,nom_p_ph_sig_gamma_bin_13,nom_p_ph_sig_gamma_bin_14,nom_p_ph_sig_gamma_bin_15,nom_p_ph_bkg_gamma_bin_0,nom_p_ph_bkg_gamma_bin_1,nom_p_ph_bkg_gamma_bin_2,nom_p_ph_bkg_gamma_bin_3,nom_p_ph_bkg_gamma_bin_4,nom_p_ph_bkg_gamma_bin_5,nom_p_ph_bkg_gamma_bin_6,nom_p_ph_bkg_gamma_bin_7,nom_p_ph_bkg_gamma_bin_8,nom_p_ph_bkg_gamma_bin_9,nom_p_ph_bkg_gamma_bin_10,nom_p_ph_bkg_gamma_bin_11,nom_p_ph_bkg_gamma_bin_12,nom_p_ph_bkg_gamma_bin_13,nom_p_ph_bkg_gamma_bin_14,nom_p_ph_bkg_gamma_bin_15,nom_p_ph_bkg_gamma_bin_16,nom_p_ph_bkg_gamma_bin_17,nom_p_ph_bkg_gamma_bin_18,nom_p_ph_bkg_gamma_bin_19,nom_p_ph_bkg_gamma_bin_20,nom_p_ph_bkg_gamma_bin_21,nom_p_ph_bkg_gamma_bin_22,nom_p_ph_bkg_gamma_bin_23,nom_p_ph_bkg_gamma_bin_24)
[#1] INFO:Fitting -- RooAbsPdf::fitTo(model1) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- Creation of NLL object took 5.28145 ms
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model1_sumData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- [fitFCN] No discrete parameters, performing continuous minimization only
Minuit2Minimizer: Minimize with max-calls 16000 convergence for edm < 1 strategy 1
Minuit2Minimizer : Valid minimum - status = 0
FVAL = -2282.22801982652527
Edm = 1.00286880153482931e-07
Nfcn = 1361
Abkg = 0.061372 +/- 0.00222727 (limited)
Asig = 0.850638 +/- 0.234536 (limited)
p_ph_bkg_gamma_bin_0 = 0.998055 +/- 0.0474257 (limited)
p_ph_bkg_gamma_bin_1 = 1.0003 +/- 0.0474792 (limited)
p_ph_bkg_gamma_bin_10 = 0.980305 +/- 0.0456236 (limited)
p_ph_bkg_gamma_bin_11 = 1.00631 +/- 0.0508578 (limited)
p_ph_bkg_gamma_bin_12 = 1.00477 +/- 0.0510208 (limited)
p_ph_bkg_gamma_bin_13 = 0.991229 +/- 0.0489404 (limited)
p_ph_bkg_gamma_bin_14 = 0.99605 +/- 0.0497176 (limited)
p_ph_bkg_gamma_bin_15 = 1.00899 +/- 0.047647 (limited)
p_ph_bkg_gamma_bin_16 = 1.02997 +/- 0.0492173 (limited)
p_ph_bkg_gamma_bin_17 = 1.00769 +/- 0.0467472 (limited)
p_ph_bkg_gamma_bin_18 = 1.01965 +/- 0.0509651 (limited)
p_ph_bkg_gamma_bin_19 = 0.975013 +/- 0.045872 (limited)
p_ph_bkg_gamma_bin_2 = 0.996158 +/- 0.0468663 (limited)
p_ph_bkg_gamma_bin_20 = 0.999858 +/- 0.0473528 (limited)
p_ph_bkg_gamma_bin_21 = 0.998271 +/- 0.0474891 (limited)
p_ph_bkg_gamma_bin_22 = 0.998324 +/- 0.0487655 (limited)
p_ph_bkg_gamma_bin_23 = 0.98395 +/- 0.0461911 (limited)
p_ph_bkg_gamma_bin_24 = 1.02664 +/- 0.0479852 (limited)
p_ph_bkg_gamma_bin_3 = 1.00554 +/- 0.0495891 (limited)
p_ph_bkg_gamma_bin_4 = 0.990585 +/- 0.0483877 (limited)
p_ph_bkg_gamma_bin_5 = 0.992304 +/- 0.048244 (limited)
p_ph_bkg_gamma_bin_6 = 1.01041 +/- 0.0497095 (limited)
p_ph_bkg_gamma_bin_7 = 0.997207 +/- 0.0460169 (limited)
p_ph_bkg_gamma_bin_8 = 0.980295 +/- 0.0463239 (limited)
p_ph_bkg_gamma_bin_9 = 1.00976 +/- 0.0478214 (limited)
p_ph_sig_gamma_bin_11 = 1.09508 +/- 0.337141 (limited)
p_ph_sig_gamma_bin_12 = 1.07036 +/- 0.220845 (limited)
p_ph_sig_gamma_bin_13 = 0.89073 +/- 0.202692 (limited)
p_ph_sig_gamma_bin_14 = 0.947873 +/- 0.357197 (limited)
p_ph_sig_gamma_bin_15 = 1.14083 +/- 1.08867 (limited)
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
[#1] INFO:Minimization -- Including the following constraint terms in minimization: (p_ph_gamma_bin_0_constraint,p_ph_gamma_bin_1_constraint,p_ph_gamma_bin_2_constraint,p_ph_gamma_bin_3_constraint,p_ph_gamma_bin_4_constraint,p_ph_gamma_bin_5_constraint,p_ph_gamma_bin_6_constraint,p_ph_gamma_bin_7_constraint,p_ph_gamma_bin_8_constraint,p_ph_gamma_bin_9_constraint,p_ph_gamma_bin_10_constraint,p_ph_gamma_bin_11_constraint,p_ph_gamma_bin_12_constraint,p_ph_gamma_bin_13_constraint,p_ph_gamma_bin_14_constraint,p_ph_gamma_bin_15_constraint,p_ph_gamma_bin_16_constraint,p_ph_gamma_bin_17_constraint,p_ph_gamma_bin_18_constraint,p_ph_gamma_bin_19_constraint,p_ph_gamma_bin_20_constraint,p_ph_gamma_bin_21_constraint,p_ph_gamma_bin_22_constraint,p_ph_gamma_bin_23_constraint,p_ph_gamma_bin_24_constraint)
[#1] INFO:Minimization -- The following global observables have been defined and their values are taken from the model: (nom_p_ph_gamma_bin_0,nom_p_ph_gamma_bin_1,nom_p_ph_gamma_bin_2,nom_p_ph_gamma_bin_3,nom_p_ph_gamma_bin_4,nom_p_ph_gamma_bin_5,nom_p_ph_gamma_bin_6,nom_p_ph_gamma_bin_7,nom_p_ph_gamma_bin_8,nom_p_ph_gamma_bin_9,nom_p_ph_gamma_bin_10,nom_p_ph_gamma_bin_11,nom_p_ph_gamma_bin_12,nom_p_ph_gamma_bin_13,nom_p_ph_gamma_bin_14,nom_p_ph_gamma_bin_15,nom_p_ph_gamma_bin_16,nom_p_ph_gamma_bin_17,nom_p_ph_gamma_bin_18,nom_p_ph_gamma_bin_19,nom_p_ph_gamma_bin_20,nom_p_ph_gamma_bin_21,nom_p_ph_gamma_bin_22,nom_p_ph_gamma_bin_23,nom_p_ph_gamma_bin_24)
[#1] INFO:Fitting -- RooAbsPdf::fitTo(model2) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- Creation of NLL object took 1.44429 ms
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model2_sumData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- [fitFCN] No discrete parameters, performing continuous minimization only
Minuit2Minimizer: Minimize with max-calls 13500 convergence for edm < 1 strategy 1
Minuit2Minimizer : Valid minimum - status = 0
FVAL = -2291.45127624059842
Edm = 2.286074513756125e-05
Nfcn = 1035
Abkg = 0.0614405 +/- 0.00221883 (limited)
Asig = 0.834377 +/- 0.203007 (limited)
p_ph_gamma_bin_0 = 0.997974 +/- 0.0474163 (limited)
p_ph_gamma_bin_1 = 1.00021 +/- 0.0474697 (limited)
p_ph_gamma_bin_10 = 0.980238 +/- 0.0456146 (limited)
p_ph_gamma_bin_11 = 1.01068 +/- 0.0488736 (limited)
p_ph_gamma_bin_12 = 1.01177 +/- 0.04839 (limited)
p_ph_gamma_bin_13 = 0.983582 +/- 0.0466957 (limited)
p_ph_gamma_bin_14 = 0.994787 +/- 0.0483026 (limited)
p_ph_gamma_bin_15 = 1.00965 +/- 0.047329 (limited)
p_ph_gamma_bin_16 = 1.02985 +/- 0.0492072 (limited)
p_ph_gamma_bin_17 = 1.0076 +/- 0.0467377 (limited)
p_ph_gamma_bin_18 = 1.01955 +/- 0.050955 (limited)
p_ph_gamma_bin_19 = 0.97495 +/- 0.045863 (limited)
p_ph_gamma_bin_2 = 0.996078 +/- 0.046857 (limited)
p_ph_gamma_bin_20 = 0.999775 +/- 0.0473434 (limited)
p_ph_gamma_bin_21 = 0.998189 +/- 0.0474797 (limited)
p_ph_gamma_bin_22 = 0.998242 +/- 0.048756 (limited)
p_ph_gamma_bin_23 = 0.98388 +/- 0.046182 (limited)
p_ph_gamma_bin_24 = 1.02653 +/- 0.0479753 (limited)
p_ph_gamma_bin_3 = 1.00545 +/- 0.0495794 (limited)
p_ph_gamma_bin_4 = 0.99051 +/- 0.0483783 (limited)
p_ph_gamma_bin_5 = 0.992228 +/- 0.0482347 (limited)
p_ph_gamma_bin_6 = 1.01032 +/- 0.0496997 (limited)
p_ph_gamma_bin_7 = 0.997126 +/- 0.0460076 (limited)
p_ph_gamma_bin_8 = 0.980228 +/- 0.0463148 (limited)
p_ph_gamma_bin_9 = 1.00967 +/- 0.0478118 (limited)
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model0) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model0) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model0) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model0) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model0) WARNING: argument CurveNameSuffix is duplicated
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model0) directly selected PDF components: (p_h_sig)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model0) indirectly selected PDF components: ()
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model0) directly selected PDF components: (p_h_bkg)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model0) indirectly selected PDF components: ()
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 50 will supersede previous event count of 1050 for normalization of PDF projections
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model1) WARNING: argument CurveNameSuffix is duplicated
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model1) directly selected PDF components: (p_p_sig1)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model1) indirectly selected PDF components: (p_h_sig,p_phf_sig1,sp_ph)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model1) directly selected PDF components: (p_p_bkg1)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model1) indirectly selected PDF components: (p_h_bkg,p_phf_bkg1,sp_ph)
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 50 will supersede previous event count of 1050 for normalization of PDF projections
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#0] WARNING:InputArguments -- RooAbsReal::plotOn(model2) WARNING: argument CurveNameSuffix is duplicated
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model2) directly selected PDF components: (p_p_sig2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model2) indirectly selected PDF components: (p_h_sig,p_phf2,sp_ph)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model2) directly selected PDF components: (p_p_bkg2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model2) indirectly selected PDF components: (p_phf2,p_h_bkg,sp_ph)
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 50 will supersede previous event count of 1050 for normalization of PDF projections
Asig [normal ] = 0.833778 +/- 0.189814
Asig [BB ] = 0.850638 +/- 0.235824
Asig [BBlight] = 0.834377 +/- 0.202972

Based on a demo by Wouter Verkerke

Definition in file rf709_BarlowBeeston.C.