High Level Factory: creation of a combined model
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
RooAbsTestStatistic::initSimMode: creating slave calculator #0 for state model1 (211 dataset entries)
RooAbsTestStatistic::initSimMode: creating slave calculator #1 for state model2 (175 dataset entries)
[#1] INFO:Fitting -- RooAbsTestStatistic::initSimMode: created 2 slave calculators.
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#1] INFO:Minimization -- The following expressions have been identified as constant and will be precalculated and cached: (flat1)
[#1] INFO:Minimization -- The following expressions will be evaluated in cache-and-track mode: (gauss1)
[#1] INFO:Minimization -- The following expressions have been identified as constant and will be precalculated and cached: (flat2)
[#1] INFO:Minimization -- The following expressions will be evaluated in cache-and-track mode: (gauss2)
Minuit2Minimizer: Minimize with max-calls 3000 convergence for edm < 1 strategy 1
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 199.349002773492941
Edm = 3.00537720146558623e-05
Nfcn = 93
mean1 = 49.8783 +/- 0.42659 (limited)
mean2 = 79.8952 +/- 0.649972 (limited)
nbkg1 = 91.8179 +/- 10.6581 (limited)
nbkg2 = 82.5577 +/- 10.3903 (limited)
nsig1 = 119.174 +/- 11.8598 (limited)
nsig2 = 92.432 +/- 10.8502 (limited)
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
[#1] INFO:Plotting -- RooSimultaneous::plotOn(HLFavtoryCombinationexample_sigbkg) plot on x represents a slice in the index category (HLFavtoryCombinationexample_category)
[#1] INFO:Plotting -- RooAbsReal::plotOn(sb_model1) slice variable HLFavtoryCombinationexample_category was not projected anyway
[#1] INFO:Plotting -- RooSimultaneous::plotOn(HLFavtoryCombinationexample_sigbkg) plot on x represents a slice in the index category (HLFavtoryCombinationexample_category)
[#1] INFO:Plotting -- RooAbsReal::plotOn(sb_model2) slice variable HLFavtoryCombinationexample_category was not projected anyway
#include <fstream>
using namespace std;
void rs602_HLFactoryCombinationexample()
{
TString card_name(
"HLFavtoryCombinationexample.rs");
ofstream ofile(card_name);
ofile << "// The simplest card for combination\n\n"
<< "gauss1 = Gaussian(x[0,100],mean1[50,0,100],4);\n"
<< "flat1 = Polynomial(x,0);\n"
<< "sb_model1 = SUM(nsig1[120,0,300]*gauss1 , nbkg1[100,0,1000]*flat1);\n"
<< "gauss2 = Gaussian(x,mean2[80,0,100],5);\n"
<< "flat2 = Polynomial(x,0);\n"
<< "sb_model2 = SUM(nsig2[90,0,400]*gauss2 , nbkg2[80,0,1000]*flat2);\n";
ofile.close();
HLFactory hlf(
"HLFavtoryCombinationexample", card_name,
false);
hlf.AddChannel("model1", "sb_model1", "flat1");
hlf.AddChannel("model2", "sb_model2", "flat2");
auto pdf = hlf.GetTotSigBkgPdf();
auto thecat = hlf.GetTotCategory();
auto x =
static_cast<RooRealVar *
>(hlf.GetWs()->arg(
"x"));
auto xframe =
x->frame();
thecat->setIndex(0);
pdf->plotOn(xframe, Slice(*thecat), ProjWData(*thecat, *
data));
thecat->setIndex(1);
pdf->plotOn(xframe, Slice(*thecat), ProjWData(*thecat, *
data));
gROOT->SetStyle(
"Plain");
xframe->Draw();
}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooRealVar represents a variable that can be changed from the outside.
HLFactory is an High Level model Factory allows you to describe your models in a configuration file (...
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.
- Author
- Danilo Piparo
Definition in file rs602_HLFactoryCombinationexample.C.