With this example, you should get: CL_sb = 0.130 and CL_b = 0.946 (if data had -2lnQ = -3.0742).
␛[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby␛[0m
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
Test statistics has been evaluated for data
HybridCalculatorOriginal: run 1000 toy-MC experiments
with test statistics index: 1
marginalize nuisance parameters
....... toy number 0 / 1000
....... toy number 500 / 1000
Completed HybridCalculatorOriginal example:
- -2lnQ = -5.97789
- CL_sb = 0.194
- CL_b = 0.04
- CL_s = 4.85
- significance of data = 1.75069
- mean significance of toys = 2.65207
void HybridOriginalDemo(int ntoys = 1000)
{
RooExtendPdf bkg_ext_pdf(
"bkg_ext_pdf",
"",bkg_pdf,bkg_yield);
sig_yield.setConstant(
kTRUE);
HybridCalculatorOriginal myHybridCalc(*
data, tot_pdf , bkg_ext_pdf ,
&nuisance_parameters, &bkg_yield_prior);
myHybridCalc.SetTestStatistic(1);
myHybridCalc.SetNumberOfToys(ntoys);
myHybridCalc.UseNuisance(true);
myHybridCalc.SetGenerateBinned(false);
HybridResult* myHybridResult = myHybridCalc.GetHypoTest();
if (! myHybridResult) {
std::cerr << "\nError returned from Hypothesis test" << std::endl;
return;
}
HybridPlot* myHybridPlot = myHybridResult->GetPlot("myHybridPlot","Plot of results with HybridCalculatorOriginal",100);
myHybridPlot->Draw();
double clsb_data = myHybridResult->CLsplusb();
double clb_data = myHybridResult->CLb();
double cls_data = myHybridResult->CLs();
double data_significance = myHybridResult->Significance();
double min2lnQ_data = myHybridResult->GetTestStat_data();
double mean_sb_toys_test_stat = myHybridPlot->GetSBmean();
myHybridResult->SetDataTestStatistics(mean_sb_toys_test_stat);
double toys_significance = myHybridResult->Significance();
std::cout << "Completed HybridCalculatorOriginal example:\n";
std::cout << " - -2lnQ = " << min2lnQ_data << endl;
std::cout << " - CL_sb = " << clsb_data << std::endl;
std::cout << " - CL_b = " << clb_data << std::endl;
std::cout << " - CL_s = " << cls_data << std::endl;
std::cout << " - significance of data = " << data_significance << std::endl;
std::cout << " - mean significance of toys = " << toys_significance << std::endl;
}
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooDataSet is a container class to hold unbinned data.
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
RooPolynomial implements a polynomial p.d.f of the form.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
RooCmdArg Extended(Bool_t flag=kTRUE)
RooConstVar & RooConst(Double_t val)
@(#)root/roostats:$Id$ Author: George Lewis, Kyle Cranmer