[HLFactoryComplexExample] echo: In the middle!
[HLFactoryComplexExample] echo: At the end!
[#1] INFO:ObjectHandling -- RooWorkspace::import(rs603_ws) importing dataset data1
[#1] INFO:ObjectHandling -- RooWorkspace::import(rs603_ws) importing RooRealVar::x
[#1] INFO:ObjectHandling -- RooWorkspace::import(rs603_ws) importing dataset data2
-------------------------------------------------------------------
Rootfile and Workspace prepared
-------------------------------------------------------------------
[HLFactoryElaborateExample] echo: In the middle!
[HLFactoryElaborateExample] echo: Now reading the included file!
[HLFactoryElaborateExample] echo: Including datasets in a Workspace in a Root file...
[#1] INFO:ObjectHandling -- RooWorkspace::import(HLFactoryElaborateExample_ws) importing dataset data1
[#1] INFO:ObjectHandling -- RooWorkspace::import(HLFactoryElaborateExample_ws) importing dataset data2
[HLFactoryElaborateExample] echo: At the end!
RooDataSet::data1[x] = 219 entries
RooCategory::HLFactoryElaborateExample_category = model2(idx = 1)
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
[#1] INFO:Fitting -- RooAbsPdf::fitTo(HLFactoryElaborateExample_sigbkg) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- using CPU computation library compiled with -mavx512
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_HLFactoryElaborateExample_sigbkg_HLFactoryElaborateExample_TotData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
Minuit2Minimizer: Minimize with max-calls 3000 convergence for edm < 1 strategy 1
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 165.576629828310018
Edm = 9.10124785533382357e-07
Nfcn = 106
mean1 = 50.6657 +/- 0.411801 (limited)
mean2 = 79.8756 +/- 0.629188 (limited)
nbkg1 = 87.4181 +/- 10.4372 (limited)
nbkg2 = 67.5739 +/- 9.49233 (limited)
nsig1 = 131.59 +/- 12.3613 (limited)
nsig2 = 96.4299 +/- 10.9011 (limited)
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
[#1] INFO:Plotting -- RooSimultaneous::plotOn(HLFactoryElaborateExample_sigbkg) plot on x represents a slice in the index category (HLFactoryElaborateExample_category)
[#1] INFO:Plotting -- RooAbsReal::plotOn(sb_model1) slice variable HLFactoryElaborateExample_category was not projected anyway
[#1] INFO:Plotting -- RooSimultaneous::plotOn(HLFactoryElaborateExample_sigbkg) plot on x represents a slice in the index category (HLFactoryElaborateExample_category)
[#1] INFO:Plotting -- RooAbsReal::plotOn(sb_model2) slice variable HLFactoryElaborateExample_category was not projected anyway
#include <fstream>
using std::ofstream, std::cout;
{
ofile <<
"// The simplest card for combination\n\n";
ofile <<
"gauss1 = Gaussian(x[0,100],mean1[50,0,100],4);\n";
ofile <<
"flat1 = Polynomial(x,0);\n";
ofile <<
"sb_model1 = SUM(nsig1[120,0,300]*gauss1 , nbkg1[100,0,1000]*flat1);\n\n";
ofile <<
"echo In the middle!;\n\n";
ofile <<
"gauss2 = Gaussian(x,mean2[80,0,100],5);\n";
ofile <<
"flat2 = Polynomial(x,0);\n";
ofile <<
"sb_model2 = SUM(nsig2[90,0,400]*gauss2 , nbkg2[80,0,1000]*flat2);\n\n";
ofile <<
"echo At the end!;\n";
ofile2 <<
"// The simplest card for combination\n\n";
ofile2 <<
"gauss1 = Gaussian(x[0,100],mean1[50,0,100],4);\n";
ofile2 <<
"flat1 = Polynomial(x,0);\n";
ofile2 <<
"sb_model1 = SUM(nsig1[120,0,300]*gauss1 , nbkg1[100,0,1000]*flat1);\n\n";
ofile2 <<
"echo In the middle!;\n\n";
ofile2 <<
"gauss2 = Gaussian(x,mean2[80,0,100],5);\n";
ofile2 <<
"flat2 = Polynomial(x,0);\n";
ofile2 <<
"sb_model2 = SUM(nsig2[90,0,400]*gauss2 , nbkg2[80,0,1000]*flat2);\n\n";
ofile2 <<
"#include rs603_included_card.rs;\n\n";
ofile2 <<
"echo At the end!;\n";
ofile3 <<
"echo Now reading the included file!;\n\n";
ofile3 <<
"echo Including datasets in a Workspace in a Root file...;\n";
ofile3 <<
"data1 = import(rs603_infile.root,\n";
ofile3 <<
"data2 = import(rs603_infile.root,\n";
HLFactory hlf(
"HLFactoryComplexExample",
"rs603_card_WsMaker.rs",
false);
auto pdf1 =
hlf.GetWs()->pdf(
"sb_model1");
auto pdf2 =
hlf.GetWs()->pdf(
"sb_model2");
cout << "-------------------------------------------------------------------\n"
<< " Rootfile and Workspace prepared \n"
<< "-------------------------------------------------------------------\n";
pdf1 =
hlf_2.GetWs()->pdf(
"sb_model1");
pdf2 =
hlf_2.GetWs()->pdf(
"sb_model2");
hlf_2.AddChannel(
"model1",
"sb_model1",
"flat1",
"data1");
hlf_2.AddChannel(
"model2",
"sb_model2",
"flat2",
"data2");
auto pdf =
hlf_2.GetTotSigBkgPdf();
gROOT->SetStyle(
"Plain");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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 (...
Persistable container for RooFit projects.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.