Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooStatsUtils.cxx
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Kyle Cranmer 28/07/2008
3
4/*************************************************************************
5 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "Rtypes.h"
13
14#if !defined(R__ALPHA) && !defined(R__SOLARIS) && !defined(R__ACC) && !defined(R__FBSD)
16#endif
17
18#include "TTree.h"
19#include "TBranch.h"
20
21#include "RooArgSet.h"
22#include "RooWorkspace.h"
23#include "RooAbsPdf.h"
24#include "RooUniform.h"
25#include "RooProdPdf.h"
26#include "RooExtendPdf.h"
27#include "RooSimultaneous.h"
30
31using namespace std;
32
33
34namespace {
35 template<class listT, class stringT> void getParameterNames(const listT* l,std::vector<stringT>& names){
36 // extract the parameter names from a list
37 if(!l) return;
38 for (auto const *obj : *l) {
39 names.push_back(obj->GetName());
40 }
41 }
42 void getArgs(RooWorkspace* ws, const std::vector<TString> names, RooArgSet& args){
43 for(const auto& p:names){
44 RooRealVar* v = ws->var(p.Data());
45 if(v){
46 args.add(*v);
47 }
48 }
49 }
50 }
51
52namespace RooStats {
53
55 static RooStatsConfig theConfig;
56 return theConfig;
57 }
58
59 double AsimovSignificance(double s, double b, double sigma_b ) {
60 // Asimov significance
61 // formula [10] and [20] from https://www.pp.rhul.ac.uk/~cowan/stat/notes/medsigNote.pdf
62 // case we have a sigma_b
63 double sb2 = sigma_b*sigma_b;
64 // formula below has a large error when sigma_b becomes zero
65 // better to use the approximation for sigma_b=0 for very small values
66 double r = sb2/b;
67 if (r > 1.E-12) {
68 double bpsb2 = b + sb2;
69 double b2 = b*b;
70 double spb = s+b;
71 double za2 = 2.*( (spb)* std::log( ( spb)*(bpsb2)/(b2+ spb*sb2) ) -
72 (b2/sb2) * std::log(1. + ( sb2 * s)/(b * bpsb2) ) );
73 return sqrt(za2);
74
75 }
76 // case when the background (b) is known
77 double za2 = 2.*( (s+b) * std::log(1. + s/b) -s );
78 return std::sqrt(za2);
79 }
80
81 /// Use an offset in NLL calculations.
82 void UseNLLOffset(bool on) {
84 }
85
86 /// Test of RooStats should by default offset NLL calculations.
87 bool IsNLLOffset() {
89 }
90
91 void FactorizePdf(const RooArgSet &observables, RooAbsPdf &pdf, RooArgList &obsTerms, RooArgList &constraints) {
92 // utility function to factorize constraint terms from a pdf
93 // (from G. Petrucciani)
94 if (auto prod = dynamic_cast<RooProdPdf *>(&pdf)) {
95 RooArgList list(prod->pdfList());
96 for (int i = 0, n = list.getSize(); i < n; ++i) {
97 RooAbsPdf *pdfi = (RooAbsPdf *) list.at(i);
98 FactorizePdf(observables, *pdfi, obsTerms, constraints);
99 }
100 } else if (dynamic_cast<RooExtendPdf *>(&pdf)) {
101 // extract underlying pdf which is extended; first server is the pdf; second server is the number of events variable
102 auto iter = pdf.servers().begin();
103 assert(iter != pdf.servers().end());
104 assert(dynamic_cast<RooAbsPdf*>(*iter));
105 FactorizePdf(observables, static_cast<RooAbsPdf&>(**iter), obsTerms, constraints);
106 } else if (auto sim = dynamic_cast<RooSimultaneous *>(&pdf)) { //|| dynamic_cast<RooSimultaneousOpt>(&pdf)) {
107 assert(sim != nullptr);
108 RooAbsCategoryLValue *cat = (RooAbsCategoryLValue *) sim->indexCat().clone(sim->indexCat().GetName());
109 for (int ic = 0, nc = cat->numBins((const char *)nullptr); ic < nc; ++ic) {
110 cat->setBin(ic);
111 RooAbsPdf* catPdf = sim->getPdf(cat->getCurrentLabel());
112 // it is possible that a pdf is not defined for every category
113 if (catPdf != nullptr) FactorizePdf(observables, *catPdf, obsTerms, constraints);
114 }
115 delete cat;
116 } else if (pdf.dependsOn(observables)) {
117 if (!obsTerms.contains(pdf)) obsTerms.add(pdf);
118 } else {
119 if (!constraints.contains(pdf)) constraints.add(pdf);
120 }
121 }
122
123
124 void FactorizePdf(RooStats::ModelConfig &model, RooAbsPdf &pdf, RooArgList &obsTerms, RooArgList &constraints) {
125 // utility function to factorize constraint terms from a pdf
126 // (from G. Petrucciani)
127 if (!model.GetObservables() ) {
128 oocoutE(nullptr,InputArguments) << "RooStatsUtils::FactorizePdf - invalid input model: missing observables" << endl;
129 return;
130 }
131 return FactorizePdf(*model.GetObservables(), pdf, obsTerms, constraints);
132 }
133
134
135 RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name) {
136 // make a nuisance pdf by factorizing out all constraint terms in a common pdf
137 RooArgList obsTerms, constraints;
138 FactorizePdf(observables, pdf, obsTerms, constraints);
139 if(constraints.empty()) {
140 oocoutW(nullptr, Eval) << "RooStatsUtils::MakeNuisancePdf - no constraints found on nuisance parameters in the input model" << endl;
141 return nullptr;
142 }
143 return new RooProdPdf(name,"", constraints);
144 }
145
147 // make a nuisance pdf by factorizing out all constraint terms in a common pdf
148 if (!model.GetPdf() || !model.GetObservables() ) {
149 oocoutE(nullptr, InputArguments) << "RooStatsUtils::MakeNuisancePdf - invalid input model: missing pdf and/or observables" << endl;
150 return nullptr;
151 }
152 return MakeNuisancePdf(*model.GetPdf(), *model.GetObservables(), name);
153 }
154
155 RooAbsPdf * StripConstraints(RooAbsPdf &pdf, const RooArgSet &observables) {
156
157 if (auto prod = dynamic_cast<RooProdPdf *>(&pdf)) {
158
159 RooArgList list(prod->pdfList()); RooArgList newList;
160
161 for (int i = 0, n = list.getSize(); i < n; ++i) {
162 RooAbsPdf *pdfi = (RooAbsPdf *) list.at(i);
163 RooAbsPdf *newPdfi = StripConstraints(*pdfi, observables);
164 if(newPdfi != nullptr) newList.add(*newPdfi);
165 }
166
167 if(newList.empty()) return nullptr; // only constraints in product
168 // return single component (no longer a product)
169 else if(newList.getSize() == 1) return dynamic_cast<RooAbsPdf *>(newList.at(0)->clone(TString::Format("%s_unconstrained",
170 newList.at(0)->GetName())));
171 else return new RooProdPdf(TString::Format("%s_unconstrained", prod->GetName()).Data(),
172 TString::Format("%s without constraints", prod->GetTitle()).Data(), newList);
173
174 } else if (dynamic_cast<RooExtendPdf*>(&pdf)) {
175
176 auto iter = pdf.servers().begin();
177 // extract underlying pdf which is extended; first server is the pdf; second server is the number of events variable
178 auto uPdf = dynamic_cast<RooAbsPdf *>(*(iter++));
179 auto extended_term = dynamic_cast<RooAbsReal *>(*(iter++));
180 assert(uPdf != nullptr);
181 assert(extended_term != nullptr);
182 assert(iter == pdf.servers().end());
183
184 RooAbsPdf *newUPdf = StripConstraints(*uPdf, observables);
185 if(newUPdf == nullptr) return nullptr; // only constraints in underlying pdf
186 else return new RooExtendPdf(TString::Format("%s_unconstrained", pdf.GetName()).Data(),
187 TString::Format("%s without constraints", pdf.GetTitle()).Data(), *newUPdf, *extended_term);
188
189 } else if (auto sim = dynamic_cast<RooSimultaneous *>(&pdf)) { //|| dynamic_cast<RooSimultaneousOpt *>(&pdf)) {
190
191 assert(sim != nullptr);
192 RooAbsCategoryLValue *cat = (RooAbsCategoryLValue *) sim->indexCat().Clone(); assert(cat != nullptr);
193 RooArgList pdfList;
194
195 for (int ic = 0, nc = cat->numBins((const char *)nullptr); ic < nc; ++ic) {
196 cat->setBin(ic);
197 RooAbsPdf* catPdf = sim->getPdf(cat->getCurrentLabel());
198 RooAbsPdf* newPdf = nullptr;
199 // it is possible that a pdf is not defined for every category
200 if (catPdf != nullptr) newPdf = StripConstraints(*catPdf, observables);
201 if (newPdf == nullptr) { delete cat; return nullptr; } // all channels must have observables
202 pdfList.add(*newPdf);
203 }
204
205 return new RooSimultaneous(TString::Format("%s_unconstrained", sim->GetName()).Data(),
206 TString::Format("%s without constraints", sim->GetTitle()).Data(), pdfList, *cat);
207
208 } else if (pdf.dependsOn(observables)) {
209 return (RooAbsPdf *) pdf.clone(TString::Format("%s_unconstrained", pdf.GetName()).Data());
210 }
211
212 return nullptr; // just a constraint term
213 }
214
215 RooAbsPdf * MakeUnconstrainedPdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name) {
216 // make a clone pdf without all constraint terms in a common pdf
217 RooAbsPdf * unconstrainedPdf = StripConstraints(pdf, observables);
218 if(!unconstrainedPdf) {
219 oocoutE(nullptr, InputArguments) << "RooStats::MakeUnconstrainedPdf - invalid observable list passed (observables not found in original pdf) or invalid pdf passed (without observables)" << endl;
220 return nullptr;
221 }
222 if(name != nullptr) unconstrainedPdf->SetName(name);
223 return unconstrainedPdf;
224 }
225
227 // make a clone pdf without all constraint terms in a common pdf
228 if(!model.GetPdf() || !model.GetObservables()) {
229 oocoutE(nullptr, InputArguments) << "RooStatsUtils::MakeUnconstrainedPdf - invalid input model: missing pdf and/or observables" << endl;
230 return nullptr;
231 }
232 return MakeUnconstrainedPdf(*model.GetPdf(), *model.GetObservables(), name);
233 }
234
235 // Helper class for GetAsTTree
237 public:
238 std::map<TString, double> fVarVals;
239 double fInval;
241
242 BranchStore(const vector <TString> &params = vector <TString>(), double _inval = -999.) : fTree(nullptr) {
243 fInval = _inval;
244 for(unsigned int i = 0;i<params.size();i++)
245 fVarVals[params[i]] = _inval;
246 }
247
249 if (fTree) {
250 for(std::map<TString, double>::iterator it = fVarVals.begin();it!=fVarVals.end();++it) {
251 TBranch *br = fTree->GetBranch( it->first );
252 if (br) br->ResetAddress();
253 }
254 }
255 }
256
257 void AssignToTTree(TTree &myTree) {
258 fTree = &myTree;
259 for(std::map<TString, double>::iterator it = fVarVals.begin();it!=fVarVals.end();++it) {
260 const TString& name = it->first;
261 myTree.Branch( name, &fVarVals[name], TString::Format("%s/D", name.Data()));
262 }
263 }
264 void ResetValues() {
265 for(std::map<TString, double>::iterator it = fVarVals.begin();it!=fVarVals.end();++it) {
266 const TString& name = it->first;
268 }
269 }
270 };
271
273 if (data.numEntries() == 0) {
274 return new BranchStore;
275 }
276 vector <TString> V;
277 for (auto *rvar : dynamic_range_cast<RooRealVar *>(* data.get(0))) {
278 if (rvar == nullptr)
279 continue;
280 V.push_back(rvar->GetName());
281 if (rvar->hasAsymError()) {
282 V.push_back(TString::Format("%s_errlo", rvar->GetName()));
283 V.push_back(TString::Format("%s_errhi", rvar->GetName()));
284 }
285 else if (rvar->hasError()) {
286 V.push_back(TString::Format("%s_err", rvar->GetName()));
287 }
288 }
289 return new BranchStore(V);
290 }
291
292 void FillTree(TTree &myTree, const RooDataSet &data) {
294 bs->AssignToTTree(myTree);
295
296 for(int entry = 0;entry<data.numEntries();entry++) {
297 bs->ResetValues();
298 for (auto const *rvar : dynamic_range_cast<RooRealVar *>(*data.get(entry))) {
299 if (rvar == nullptr)
300 continue;
301 bs->fVarVals[rvar->GetName()] = rvar->getValV();
302 if (rvar->hasAsymError()) {
303 bs->fVarVals[TString::Format("%s_errlo", rvar->GetName())] = rvar->getAsymErrorLo();
304 bs->fVarVals[TString::Format("%s_errhi", rvar->GetName())] = rvar->getAsymErrorHi();
305 }
306 else if (rvar->hasError()) {
307 bs->fVarVals[TString::Format("%s_err", rvar->GetName())] = rvar->getError();
308 }
309 }
310 myTree.Fill();
311 }
312
313 delete bs;
314 }
315
317 TTree* myTree = new TTree(name, desc);
318 FillTree(*myTree, data);
319 return myTree;
320 }
321
322
323 // useful function to print in one line the content of a set with their values
324 void PrintListContent(const RooArgList & l, std::ostream & os ) {
325 bool first = true;
326 os << "( ";
327 for (int i = 0; i< l.getSize(); ++i) {
328 if (first) {
329 first=false ;
330 } else {
331 os << ", " ;
332 }
333 l[i].printName(os);
334 os << " = ";
335 l[i].printValue(os);
336 }
337 os << ")\n";
338 }
339
340 // clone a workspace, copying all needed components and discarding all others
341 // start off with the old workspace
342 RooWorkspace* MakeCleanWorkspace(RooWorkspace *oldWS, const char *newName,
343 bool copySnapshots, const char *mcname,
344 const char *newmcname) {
345 auto objects = oldWS->allGenericObjects();
346 RooStats::ModelConfig *oldMC =
347 dynamic_cast<RooStats::ModelConfig *>(oldWS->obj(mcname));
348 auto data = oldWS->allData();
349 for (auto it : objects) {
350 if (!oldMC) {
351 oldMC = dynamic_cast<RooStats::ModelConfig *>(it);
352 }
353 }
354 if (!oldMC)
355 throw std::runtime_error("unable to retrieve ModelConfig");
356
357 RooAbsPdf *origPdf = oldMC->GetPdf();
358
359 // start off with the old modelconfig
360 std::vector<TString> poilist;
361 std::vector<TString> nplist;
362 std::vector<TString> obslist;
363 std::vector<TString> globobslist;
364 RooAbsPdf *pdf = nullptr;
365 if (oldMC) {
366 pdf = oldMC->GetPdf();
367 ::getParameterNames(oldMC->GetParametersOfInterest(), poilist);
368 ::getParameterNames(oldMC->GetNuisanceParameters(), nplist);
369 ::getParameterNames(oldMC->GetObservables(), obslist);
370 ::getParameterNames(oldMC->GetGlobalObservables(), globobslist);
371 }
372 if (!pdf) {
373 if (origPdf)
374 pdf = origPdf;
375 }
376 if (!pdf) {
377 return nullptr;
378 }
379
380 // create them anew
381 RooWorkspace *newWS = new RooWorkspace(newName ? newName : oldWS->GetName());
382 newWS->autoImportClassCode(true);
383 RooStats::ModelConfig *newMC = new RooStats::ModelConfig(newmcname, newWS);
384
385 // Copy snapshots
386 if (copySnapshots) {
387 for (auto* snap : static_range_cast<RooArgSet const*>(oldWS->getSnapshots())) {
388 newWS->saveSnapshot(snap->GetName(), *snap, /*importValuesdf*/true);
389 }
390 }
391
392 newWS->import(*pdf, RooFit::RecycleConflictNodes());
393 RooAbsPdf *newPdf = newWS->pdf(pdf->GetName());
394 newMC->SetPdf(*newPdf);
395
396 for (auto d : data) {
397 newWS->import(*d);
398 }
399
400 RooArgSet poiset;
401 ::getArgs(newWS, poilist, poiset);
402 RooArgSet npset;
403 ::getArgs(newWS, nplist, npset);
404 RooArgSet obsset;
405 ::getArgs(newWS, obslist, obsset);
406 RooArgSet globobsset;
407 ::getArgs(newWS, globobslist, globobsset);
408
409 newMC->SetParametersOfInterest(poiset);
410 newMC->SetNuisanceParameters(npset);
411 newMC->SetObservables(obsset);
412 newMC->SetGlobalObservables(globobsset);
413 newWS->import(*newMC);
414
415 return newWS;
416 }
417
418}
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define oocoutW(o, a)
#define oocoutE(o, a)
#define NamespaceImp(name)
Definition Rtypes.h:393
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
char name[80]
Definition TGX11.cxx:110
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual TObject * clone(const char *newname=nullptr) const =0
void SetName(const char *name) override
Set the name of the TNamed.
const RefCountList_t & servers() const
List of all servers of this object.
Definition RooAbsArg.h:208
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
Definition RooAbsArg.h:91
Abstract base class for objects that represent a discrete value that can be set from the outside,...
Int_t numBins(const char *rangeName=nullptr) const override
Return the number of fit bins ( = number of types )
void setBin(Int_t ibin, const char *rangeName=nullptr) override
Set category to i-th fit bin, which is the i-th registered state.
virtual const char * getCurrentLabel() const
Return label string of current state.
bool contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
Int_t getSize() const
Return the number of elements in the collection.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:110
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
Efficient implementation of a product of PDFs of the form.
Definition RooProdPdf.h:33
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:37
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
std::map< TString, double > fVarVals
void AssignToTTree(TTree &myTree)
BranchStore(const vector< TString > &params=vector< TString >(), double _inval=-999.)
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition ModelConfig.h:35
virtual void SetObservables(const RooArgSet &set)
Specify the observables.
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return nullptr if not existing)
virtual void SetParametersOfInterest(const RooArgSet &set)
Specify parameters of interest.
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return nullptr if not existing)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return nullptr if not existing)
const RooArgSet * GetObservables() const
get RooArgSet for observables (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 SetNuisanceParameters(const RooArgSet &set)
Specify the nuisance parameters (parameters that are not POI).
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the workspace if not already there.
Definition ModelConfig.h:87
virtual void SetGlobalObservables(const RooArgSet &set)
Specify the global observables.
Persistable container for RooFit projects.
TObject * obj(RooStringView name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
bool saveSnapshot(RooStringView, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of given parameters.
std::list< RooAbsData * > allData() const
Return list of all dataset in the workspace.
RooLinkedList const & getSnapshots() const
std::list< TObject * > allGenericObjects() const
Return list of all generic objects in the workspace.
bool import(const RooAbsArg &arg, 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 RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
RooRealVar * var(RooStringView name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
static void autoImportClassCode(bool flag)
If flag is true, source code of classes not the ROOT distribution is automatically imported if on obj...
A TTree is a list of TBranches.
Definition TBranch.h:93
virtual void ResetAddress()
Reset the address of the branch.
Definition TBranch.cxx:2651
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2356
A TTree represents a columnar dataset.
Definition TTree.h:79
virtual Int_t Fill()
Fill all branches.
Definition TTree.cxx:4600
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition TTree.cxx:5291
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Definition TTree.h:353
RooCmdArg RecycleConflictNodes(bool flag=true)
const Int_t n
Definition legend1.C:16
Namespace for the RooStats classes.
Definition Asimov.h:19
TTree * GetAsTTree(TString name, TString desc, const RooDataSet &data)
Create a TTree with the given name and description. All RooRealVars in the RooDataSet are represented...
void FillTree(TTree &myTree, const RooDataSet &data)
BranchStore * CreateBranchStore(const RooDataSet &data)
RooAbsPdf * StripConstraints(RooAbsPdf &pdf, const RooArgSet &observables)
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
extract constraint terms from pdf
void FactorizePdf(const RooArgSet &observables, RooAbsPdf &pdf, RooArgList &obsTerms, RooArgList &constraints)
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...
double AsimovSignificance(double s, double b, double sigma_b=0.0)
Compute the Asimov Median significance for a Poisson process with s = expected number of signal event...
void UseNLLOffset(bool on)
function to set a global flag in RooStats to use NLL offset when performing nll computations Note tha...
RooAbsPdf * MakeUnconstrainedPdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name=nullptr)
remove constraints from pdf and return the unconstrained pdf
bool IsNLLOffset()
function returning if the flag to check if the flag to use NLLOffset is set
RooWorkspace * MakeCleanWorkspace(RooWorkspace *oldWS, const char *newName, bool copySnapshots, const char *mcname, const char *newmcname)
function that clones a workspace, copying all needed components and discarding all others
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
useful function to print in one line the content of a set with their values
Definition first.py:1
bool useLikelihoodOffset
Offset the likelihood by passing RooFit::Offset to fitTo().
TLine l
Definition textangle.C:4