19 std::string InputFile =
"./data/example.root";
21 bool bfile =
gSystem->AccessPathName(InputFile.c_str());
23 std::cout <<
"Input file is not found - run prepareHistFactory script " << std::endl;
24 gROOT->ProcessLine(
".! prepareHistFactory .");
25 bfile =
gSystem->AccessPathName(InputFile.c_str());
27 std::cout <<
"Still no " << InputFile <<
", giving up.\n";
35 meas.SetOutputFilePrefix(
"./results/example_UsingC");
36 meas.SetPOI(
"SigXsecOverSM");
37 meas.AddConstantParam(
"alpha_syst1");
38 meas.AddConstantParam(
"Lumi");
41 meas.SetLumiRelErr(0.10);
47 chan.SetData(
"data", InputFile);
48 chan.SetStatErrorConfig(0.05,
"Poisson");
54 signal.AddOverallSys(
"syst1", 0.95, 1.05);
55 signal.AddNormFactor(
"SigXsecOverSM", 1, 0, 3);
56 chan.AddSample(signal);
60 background1.ActivateStatError(
"background1_statUncert", InputFile);
61 background1.AddOverallSys(
"syst2", 0.95, 1.05);
62 chan.AddSample(background1);
66 background2.ActivateStatError();
67 background2.AddOverallSys(
"syst3", 0.95, 1.05);
68 chan.AddSample(background2);
72 meas.AddChannel(chan);
76 meas.CollectHistograms();
93 std::unique_ptr<RooFitResult>
result{
100 std::unique_ptr<RooAbsReal> profile{nll->createProfile(*poi)};
106 frame->GetYaxis()->SetTitle(
"-log likelihood");
109 TCanvas *profileLikelihoodCanvas =
new TCanvas{
"combined",
"", 800, 600};
120 frame->addObject(line90);
121 frame->addObject(line95);
124 profile->plotOn(frame);
126 frame->SetMinimum(0);
127 frame->SetMaximum(2.);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Abstract interface for all probability density functions.
RooFit::OwningPtr< RooAbsReal > createNLL(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Construct representation of -log(L) of PDF with given dataset.
RooFit::OwningPtr< RooFitResult > fitTo(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Fit PDF to given dataset.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Plot frame and a container for graphics objects within that frame.
Variable that can be changed from the outside.
This class encapsulates all information for the statistical interpretation of one experiment.
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
< A class that holds configuration information for a model using a workspace as a store
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return nullptr if not existing)
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return nullptr if not existing)
RooAbsPdf * GetPdf() const
get model PDF (return nullptr if pdf has not been specified or does not exist)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Use the TLine constructor to create a simple line.
const char * GetTitle() const override
Returns title of object.
RooCmdArg Save(bool flag=true)
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
RooCmdArg Minos(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooFit::OwningPtr< RooWorkspace > MakeModelAndMeasurementFast(RooStats::HistFactory::Measurement &measurement, HistoToWorkspaceFactoryFast::Configuration const &cfg={})
Creates a statistical model and associated RooFit workspace(s) from a HistFactory measurement configu...
RooCmdArg LineColor(TColorNumber color)
RooCmdArg LineStyle(Style_t style)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...