19 std::string InputFile =
"./data/example.root";
23 std::cout <<
"Input file is not found - run prepareHistFactory script " << std::endl;
24 gROOT->ProcessLine(
".! prepareHistFactory .");
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{
99 std::unique_ptr<RooAbsReal>
nll{pdf->
createNLL(*ws->data(
"obsData"))};
100 std::unique_ptr<RooAbsReal> profile{
nll->createProfile(*poi)};
109 TCanvas *profileLikelihoodCanvas =
new TCanvas{
"combined",
"", 800, 600};
124 profile->plotOn(frame);
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
R__EXTERN TSystem * gSystem
RooAbsArg * first() const
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.
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.
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,...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Plot frame and a container for graphics objects within that frame.
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
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...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
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.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
RooCmdArg Save(bool flag=true)
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
RooCmdArg Minos(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg LineColor(Color_t color)
RooCmdArg LineStyle(Style_t style)
double nll(double pdf, double weight, int binnedL, int doBinOffset)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
RooFit::OwningPtr< RooWorkspace > MakeModelAndMeasurementFast(RooStats::HistFactory::Measurement &measurement, HistoToWorkspaceFactoryFast::Configuration const &cfg={})