Logo ROOT   6.16/01
Reference Guide
TwoSidedFrequentistUpperLimitWithBands.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_roostats
3/// \notebook -js
4/// TwoSidedFrequentistUpperLimitWithBands
5///
6///
7/// This is a standard demo that can be used with any ROOT file
8/// prepared in the standard way. You specify:
9/// - name for input ROOT file
10/// - name of workspace inside ROOT file that holds model and data
11/// - name of ModelConfig that specifies details for calculator tools
12/// - name of dataset
13///
14/// With default parameters the macro will attempt to run the
15/// standard hist2workspace example and read the ROOT file
16/// that it produces.
17///
18/// You may want to control:
19/// ~~~{.cpp}
20/// double confidenceLevel=0.95;
21/// double additionalToysFac = 1.;
22/// int nPointsToScan = 12;
23/// int nToyMC = 200;
24/// ~~~
25///
26/// This uses a modified version of the profile likelihood ratio as
27/// a test statistic for upper limits (eg. test stat = 0 if muhat>mu).
28///
29/// Based on the observed data, one defines a set of parameter points
30/// to be tested based on the value of the parameter of interest
31/// and the conditional MLE (eg. profiled) values of the nuisance parameters.
32///
33/// At each parameter point, pseudo-experiments are generated using this
34/// fixed reference model and then the test statistic is evaluated.
35/// The auxiliary measurements (global observables) associated with the
36/// constraint terms in nuisance parameters are also fluctuated in the
37/// process of generating the pseudo-experiments in a frequentist manner
38/// forming an 'unconditional ensemble'. One could form a 'conditional'
39/// ensemble in which these auxiliary measurements are fixed. Note that the
40/// nuisance parameters are not randomized, which is a Bayesian procedure.
41/// Note, the nuisance parameters are floating in the fits. For each point,
42/// the threshold that defines the 95% acceptance region is found. This
43/// forms a "Confidence Belt".
44///
45/// After constructing the confidence belt, one can find the confidence
46/// interval for any particular dataset by finding the intersection
47/// of the observed test statistic and the confidence belt. First
48/// this is done on the observed data to get an observed 1-sided upper limt.
49///
50/// Finally, there expected limit and bands (from background-only) are
51/// formed by generating background-only data and finding the upper limit.
52/// The background-only is defined as such that the nuisance parameters are
53/// fixed to their best fit value based on the data with the signal rate fixed to 0.
54/// The bands are done by hand for now, will later be part of the RooStats tools.
55///
56/// On a technical note, this technique IS the generalization of Feldman-Cousins
57/// with nuisance parameters.
58///
59/// Building the confidence belt can be computationally expensive.
60/// Once it is built, one could save it to a file and use it in a separate step.
61///
62/// We can use PROOF to speed things along in parallel, however,
63/// the test statistic has to be installed on the workers
64/// so either turn off PROOF or include the modified test statistic
65/// in your $ROOTSYS/roofit/roostats/inc directory,
66/// add the additional line to the LinkDef.h file,
67/// and recompile root.
68///
69/// Note, if you have a boundary on the parameter of interest (eg. cross-section)
70/// the threshold on the two-sided test statistic starts off at moderate values and plateaus.
71///
72/// [#0] PROGRESS:Generation -- generated toys: 500 / 999
73/// NeymanConstruction: Prog: 12/50 total MC = 39 this test stat = 0
74/// SigXsecOverSM=0.69 alpha_syst1=0.136515 alpha_syst3=0.425415 beta_syst2=1.08496 [-1e+30, 0.011215] in interval = 1
75///
76/// this tells you the values of the parameters being used to generate the pseudo-experiments
77/// and the threshold in this case is 0.011215. One would expect for 95% that the threshold
78/// would be ~1.35 once the cross-section is far enough away from 0 that it is essentially
79/// unaffected by the boundary. As one reaches the last points in the scan, the
80/// theshold starts to get artificially high. This is because the range of the parameter in
81/// the fit is the same as the range in the scan. In the future, these should be independently
82/// controlled, but they are not now. As a result the ~50% of pseudo-experiments that have an
83/// upward fluctuation end up with muhat = muMax. Because of this, the upper range of the
84/// parameter should be well above the expected upper limit... but not too high or one will
85/// need a very large value of nPointsToScan to resolve the relevant region. This can be
86/// improved, but this is the first version of this script.
87///
88/// Important note: when the model includes external constraint terms, like a Gaussian
89/// constraint to a nuisance parameter centered around some nominal value there is
90/// a subtlety. The asymptotic results are all based on the assumption that all the
91/// measurements fluctuate... including the nominal values from auxiliary measurements.
92/// If these do not fluctuate, this corresponds to an "conditional ensemble". The
93/// result is that the distribution of the test statistic can become very non-chi^2.
94/// This results in thresholds that become very large.
95///
96/// \macro_image
97/// \macro_output
98/// \macro_code
99///
100/// \author Kyle Cranmer,Contributions from Aaron Armbruster, Haoshuang Ji, Haichen Wang and Daniel Whiteson
101
102#include "TFile.h"
103#include "TROOT.h"
104#include "TH1F.h"
105#include "TCanvas.h"
106#include "TSystem.h"
107#include <iostream>
108
109#include "RooWorkspace.h"
110#include "RooSimultaneous.h"
111#include "RooAbsData.h"
112
113#include "RooStats/ModelConfig.h"
118
121
122using namespace RooFit;
123using namespace RooStats;
124using namespace std;
125
126bool useProof = false; // flag to control whether to use Proof
127int nworkers = 0; // number of workers (default use all available cores)
128
129// -------------------------------------------------------
130
131void TwoSidedFrequentistUpperLimitWithBands(const char* infile = "",
132 const char* workspaceName = "combined",
133 const char* modelConfigName = "ModelConfig",
134 const char* dataName = "obsData") {
135
136
137 double confidenceLevel=0.95;
138 // degrade/improve number of pseudo-experiments used to define the confidence belt.
139 // value of 1 corresponds to default number of toys in the tail, which is 50/(1-confidenceLevel)
140 double additionalToysFac = 0.5;
141 int nPointsToScan = 20; // number of steps in the parameter of interest
142 int nToyMC = 200; // number of toys used to define the expected limit and band
143
144 // -------------------------------------------------------
145 // First part is just to access a user-defined file
146 // or create the standard example file if it doesn't exist
147 const char* filename = "";
148 if (!strcmp(infile,"")) {
149 filename = "results/example_combined_GaussExample_model.root";
150 bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code
151 // if file does not exists generate with histfactory
152 if (!fileExist) {
153#ifdef _WIN32
154 cout << "HistFactory file cannot be generated on Windows - exit" << endl;
155 return;
156#endif
157 // Normally this would be run on the command line
158 cout <<"will run standard hist2workspace example"<<endl;
159 gROOT->ProcessLine(".! prepareHistFactory .");
160 gROOT->ProcessLine(".! hist2workspace config/example.xml");
161 cout <<"\n\n---------------------"<<endl;
162 cout <<"Done creating example input"<<endl;
163 cout <<"---------------------\n\n"<<endl;
164 }
165
166 }
167 else
168 filename = infile;
169
170 // Try to open the file
171 TFile *file = TFile::Open(filename);
172
173 // if input file was specified byt not found, quit
174 if(!file ){
175 cout <<"StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
176 return;
177 }
178
179 // -------------------------------------------------------
180 // Now get the data and workspace
181
182 // get the workspace out of the file
183 RooWorkspace* w = (RooWorkspace*) file->Get(workspaceName);
184 if(!w){
185 cout <<"workspace not found" << endl;
186 return;
187 }
188
189 // get the modelConfig out of the file
190 ModelConfig* mc = (ModelConfig*) w->obj(modelConfigName);
191
192 // get the modelConfig out of the file
193 RooAbsData* data = w->data(dataName);
194
195 // make sure ingredients are found
196 if(!data || !mc){
197 w->Print();
198 cout << "data or ModelConfig was not found" <<endl;
199 return;
200 }
201
202 cout << "Found data and ModelConfig:" <<endl;
203 mc->Print();
204
205 // -------------------------------------------------------
206 // Now get the POI for convenience
207 // you may want to adjust the range of your POI
208 RooRealVar* firstPOI = (RooRealVar*) mc->GetParametersOfInterest()->first();
209 /* firstPOI->setMin(0);*/
210 /* firstPOI->setMax(10);*/
211
212 // -------------------------------------------------------
213 // create and use the FeldmanCousins tool
214 // to find and plot the 95% confidence interval
215 // on the parameter of interest as specified
216 // in the model config
217 // REMEMBER, we will change the test statistic
218 // so this is NOT a Feldman-Cousins interval
219 FeldmanCousins fc(*data,*mc);
220 fc.SetConfidenceLevel(confidenceLevel);
221 fc.AdditionalNToysFactor(additionalToysFac); // improve sampling that defines confidence belt
222 // fc.UseAdaptiveSampling(true); // speed it up a bit, but don't use for expected limits
223 fc.SetNBins(nPointsToScan); // set how many points per parameter of interest to scan
224 fc.CreateConfBelt(true); // save the information in the belt for plotting
225
226 // -------------------------------------------------------
227 // Feldman-Cousins is a unified limit by definition
228 // but the tool takes care of a few things for us like which values
229 // of the nuisance parameters should be used to generate toys.
230 // so let's just change the test statistic and realize this is
231 // no longer "Feldman-Cousins" but is a fully frequentist Neyman-Construction.
232 // fc.GetTestStatSampler()->SetTestStatistic(&onesided);
233 // ((ToyMCSampler*) fc.GetTestStatSampler())->SetGenerateBinned(true);
234 ToyMCSampler* toymcsampler = (ToyMCSampler*) fc.GetTestStatSampler();
235 ProfileLikelihoodTestStat* testStat = dynamic_cast<ProfileLikelihoodTestStat*>(toymcsampler->GetTestStatistic());
236
237 // Since this tool needs to throw toy MC the PDF needs to be
238 // extended or the tool needs to know how many entries in a dataset
239 // per pseudo experiment.
240 // In the 'number counting form' where the entries in the dataset
241 // are counts, and not values of discriminating variables, the
242 // datasets typically only have one entry and the PDF is not
243 // extended.
244 if(!mc->GetPdf()->canBeExtended()){
245 if(data->numEntries()==1)
246 fc.FluctuateNumDataEntries(false);
247 else
248 cout <<"Not sure what to do about this model" <<endl;
249 }
250
251 // We can use PROOF to speed things along in parallel
252 // However, the test statistic has to be installed on the workers
253 // so either turn off PROOF or include the modified test statistic
254 // in your $ROOTSYS/roofit/roostats/inc directory,
255 // add the additional line to the LinkDef.h file,
256 // and recompile root.
257 if (useProof) {
258 ProofConfig pc(*w, nworkers, "",false);
259 toymcsampler->SetProofConfig(&pc); // enable proof
260 }
261
262 if(mc->GetGlobalObservables()){
263 cout << "will use global observables for unconditional ensemble"<<endl;
265 toymcsampler->SetGlobalObservables(*mc->GetGlobalObservables());
266 }
267
268
269 // Now get the interval
270 PointSetInterval* interval = fc.GetInterval();
271 ConfidenceBelt* belt = fc.GetConfidenceBelt();
272
273 // print out the interval on the first Parameter of Interest
274 cout << "\n95% interval on " <<firstPOI->GetName()<<" is : ["<<
275 interval->LowerLimit(*firstPOI) << ", "<<
276 interval->UpperLimit(*firstPOI) <<"] "<<endl;
277
278 // get observed UL and value of test statistic evaluated there
279 RooArgSet tmpPOI(*firstPOI);
280 double observedUL = interval->UpperLimit(*firstPOI);
281 firstPOI->setVal(observedUL);
282 double obsTSatObsUL = fc.GetTestStatSampler()->EvaluateTestStatistic(*data,tmpPOI);
283
284
285 // Ask the calculator which points were scanned
286 RooDataSet* parameterScan = (RooDataSet*) fc.GetPointsToScan();
287 RooArgSet* tmpPoint;
288
289 // make a histogram of parameter vs. threshold
290 TH1F* histOfThresholds = new TH1F("histOfThresholds","",
291 parameterScan->numEntries(),
292 firstPOI->getMin(),
293 firstPOI->getMax());
294 histOfThresholds->GetXaxis()->SetTitle(firstPOI->GetName());
295 histOfThresholds->GetYaxis()->SetTitle("Threshold");
296
297 // loop through the points that were tested and ask confidence belt
298 // what the upper/lower thresholds were.
299 // For FeldmanCousins, the lower cut off is always 0
300 for(Int_t i=0; i<parameterScan->numEntries(); ++i){
301 tmpPoint = (RooArgSet*) parameterScan->get(i)->clone("temp");
302 //cout <<"get threshold"<<endl;
303 double arMax = belt->GetAcceptanceRegionMax(*tmpPoint);
304 double poiVal = tmpPoint->getRealValue(firstPOI->GetName()) ;
305 histOfThresholds->Fill(poiVal,arMax);
306 }
307 TCanvas* c1 = new TCanvas();
308 c1->Divide(2);
309 c1->cd(1);
310 histOfThresholds->SetMinimum(0);
311 histOfThresholds->Draw();
312 c1->cd(2);
313
314 // -------------------------------------------------------
315 // Now we generate the expected bands and power-constraint
316
317 // First: find parameter point for mu=0, with conditional MLEs for nuisance parameters
318 RooAbsReal* nll = mc->GetPdf()->createNLL(*data);
319 RooAbsReal* profile = nll->createProfile(*mc->GetParametersOfInterest());
320 firstPOI->setVal(0.);
321 profile->getVal(); // this will do fit and set nuisance parameters to profiled values
322 RooArgSet* poiAndNuisance = new RooArgSet();
323 if(mc->GetNuisanceParameters())
324 poiAndNuisance->add(*mc->GetNuisanceParameters());
325 poiAndNuisance->add(*mc->GetParametersOfInterest());
326 w->saveSnapshot("paramsToGenerateData",*poiAndNuisance);
327 RooArgSet* paramsToGenerateData = (RooArgSet*) poiAndNuisance->snapshot();
328 cout << "\nWill use these parameter points to generate pseudo data for bkg only" << endl;
329 paramsToGenerateData->Print("v");
330
331
332 RooArgSet unconditionalObs;
333 unconditionalObs.add(*mc->GetObservables());
334 unconditionalObs.add(*mc->GetGlobalObservables()); // comment this out for the original conditional ensemble
335
336 double CLb=0;
337 double CLbinclusive=0;
338
339 // Now we generate background only and find distribution of upper limits
340 TH1F* histOfUL = new TH1F("histOfUL","",100,0,firstPOI->getMax());
341 histOfUL->GetXaxis()->SetTitle("Upper Limit (background only)");
342 histOfUL->GetYaxis()->SetTitle("Entries");
343 for(int imc=0; imc<nToyMC; ++imc){
344
345 // set parameters back to values for generating pseudo data
346 // cout << "\n get current nuis, set vals, print again" << endl;
347 w->loadSnapshot("paramsToGenerateData");
348 // poiAndNuisance->Print("v");
349
350 RooDataSet* toyData = 0;
351 // now generate a toy dataset for the main measurement
352 if(!mc->GetPdf()->canBeExtended()){
353 if(data->numEntries()==1)
354 toyData = mc->GetPdf()->generate(*mc->GetObservables(),1);
355 else
356 cout <<"Not sure what to do about this model" <<endl;
357 } else{
358 // cout << "generating extended dataset"<<endl;
359 toyData = mc->GetPdf()->generate(*mc->GetObservables(),Extended());
360 }
361
362 // generate global observables
363 // need to be careful for simpdf.
364 // In ROOT 5.28 there is a problem with generating global observables
365 // with a simultaneous PDF. In 5.29 there is a solution with
366 // RooSimultaneous::generateSimGlobal, but this may change to
367 // the standard generate interface in 5.30.
368
369 RooSimultaneous* simPdf = dynamic_cast<RooSimultaneous*>(mc->GetPdf());
370 if(!simPdf){
371 RooDataSet *one = mc->GetPdf()->generate(*mc->GetGlobalObservables(), 1);
372 const RooArgSet *values = one->get();
373 RooArgSet *allVars = mc->GetPdf()->getVariables();
374 *allVars = *values;
375 delete allVars;
376 delete one;
377 } else {
378 RooDataSet* one = simPdf->generateSimGlobal(*mc->GetGlobalObservables(),1);
379 const RooArgSet *values = one->get();
380 RooArgSet *allVars = mc->GetPdf()->getVariables();
381 *allVars = *values;
382 delete allVars;
383 delete one;
384
385 }
386
387
388 // get test stat at observed UL in observed data
389 firstPOI->setVal(observedUL);
390 double toyTSatObsUL = fc.GetTestStatSampler()->EvaluateTestStatistic(*toyData,tmpPOI);
391 // toyData->get()->Print("v");
392 // cout <<"obsTSatObsUL " <<obsTSatObsUL << "toyTS " << toyTSatObsUL << endl;
393 if(obsTSatObsUL < toyTSatObsUL) // not sure about <= part yet
394 CLb+= (1.)/nToyMC;
395 if(obsTSatObsUL <= toyTSatObsUL) // not sure about <= part yet
396 CLbinclusive+= (1.)/nToyMC;
397
398
399 // loop over points in belt to find upper limit for this toy data
400 double thisUL = 0;
401 for(Int_t i=0; i<parameterScan->numEntries(); ++i){
402 tmpPoint = (RooArgSet*) parameterScan->get(i)->clone("temp");
403 double arMax = belt->GetAcceptanceRegionMax(*tmpPoint);
404 firstPOI->setVal( tmpPoint->getRealValue(firstPOI->GetName()) );
405 // double thisTS = profile->getVal();
406 double thisTS = fc.GetTestStatSampler()->EvaluateTestStatistic(*toyData,tmpPOI);
407
408 // cout << "poi = " << firstPOI->getVal()
409 // << " max is " << arMax << " this profile = " << thisTS << endl;
410 // cout << "thisTS = " << thisTS<<endl;
411 if(thisTS<=arMax){
412 thisUL = firstPOI->getVal();
413 } else{
414 break;
415 }
416 }
417
418
419 histOfUL->Fill(thisUL);
420
421 // for few events, data is often the same, and UL is often the same
422 // cout << "thisUL = " << thisUL<<endl;
423
424 delete toyData;
425 }
426 histOfUL->Draw();
427 c1->SaveAs("two-sided_upper_limit_output.pdf");
428
429 // if you want to see a plot of the sampling distribution for a particular scan point:
430 /*
431 SamplingDistPlot sampPlot;
432 int indexInScan = 0;
433 tmpPoint = (RooArgSet*) parameterScan->get(indexInScan)->clone("temp");
434 firstPOI->setVal( tmpPoint->getRealValue(firstPOI->GetName()) );
435 toymcsampler->SetParametersForTestStat(tmpPOI);
436 SamplingDistribution* samp = toymcsampler->GetSamplingDistribution(*tmpPoint);
437 sampPlot.AddSamplingDistribution(samp);
438 sampPlot.Draw();
439 */
440
441 // Now find bands and power constraint
442 Double_t* bins = histOfUL->GetIntegral();
443 TH1F* cumulative = (TH1F*) histOfUL->Clone("cumulative");
444 cumulative->SetContent(bins);
445 double band2sigDown=0, band1sigDown=0, bandMedian=0, band1sigUp=0,band2sigUp=0;
446 for(int i=1; i<=cumulative->GetNbinsX(); ++i){
447 if(bins[i]<RooStats::SignificanceToPValue(2))
448 band2sigDown=cumulative->GetBinCenter(i);
449 if(bins[i]<RooStats::SignificanceToPValue(1))
450 band1sigDown=cumulative->GetBinCenter(i);
451 if(bins[i]<0.5)
452 bandMedian=cumulative->GetBinCenter(i);
453 if(bins[i]<RooStats::SignificanceToPValue(-1))
454 band1sigUp=cumulative->GetBinCenter(i);
455 if(bins[i]<RooStats::SignificanceToPValue(-2))
456 band2sigUp=cumulative->GetBinCenter(i);
457 }
458 cout << "-2 sigma band " << band2sigDown << endl;
459 cout << "-1 sigma band " << band1sigDown << " [Power Constraint)]" << endl;
460 cout << "median of band " << bandMedian << endl;
461 cout << "+1 sigma band " << band1sigUp << endl;
462 cout << "+2 sigma band " << band2sigUp << endl;
463
464 // print out the interval on the first Parameter of Interest
465 cout << "\nobserved 95% upper-limit "<< interval->UpperLimit(*firstPOI) <<endl;
466 cout << "CLb strict [P(toy>obs|0)] for observed 95% upper-limit "<< CLb <<endl;
467 cout << "CLb inclusive [P(toy>=obs|0)] for observed 95% upper-limit "<< CLbinclusive <<endl;
468
469 delete profile;
470 delete nll;
471
472}
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
#define gROOT
Definition: TROOT.h:410
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2074
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
RooAbsArg * first() const
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
virtual Int_t numEntries() const
Definition: RooAbsData.cxx:285
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
Definition: RooAbsPdf.cxx:781
Bool_t canBeExtended() const
Definition: RooAbsPdf.h:230
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
Definition: RooAbsPdf.h:56
virtual Double_t getMax(const char *name=0) const
virtual Double_t getMin(const char *name=0) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual RooAbsReal * createProfile(const RooArgSet &paramsOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
Definition: RooAbsReal.cxx:462
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
Definition: RooAbsReal.h:64
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.
Definition: RooArgSet.cxx:472
virtual TObject * clone(const char *newname) const
Definition: RooArgSet.h:84
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:31
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
Definition: RooDataSet.cxx:995
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:36
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Definition: RooRealVar.cxx:204
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools.
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
Double_t GetAcceptanceRegionMax(RooArgSet &, Double_t cl=-1., Double_t leftside=-1.)
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:30
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
Definition: ModelConfig.h:249
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
Definition: ModelConfig.h:231
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Definition: ModelConfig.h:234
virtual void Print(Option_t *option="") const override
overload the print method
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
Definition: ModelConfig.h:243
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
Definition: ModelConfig.h:228
PointSetInterval is a concrete implementation of the ConfInterval interface.
Double_t UpperLimit(RooRealVar &param)
return upper limit on a given parameter
Double_t LowerLimit(RooRealVar &param)
return lower limit on a given parameter
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
Holds configuration options for proof and proof-lite.
Definition: ProofConfig.h:46
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:71
void SetProofConfig(ProofConfig *pc=NULL)
Definition: ToyMCSampler.h:233
virtual TestStatistic * GetTestStatistic(unsigned int i) const
Definition: ToyMCSampler.h:132
virtual void SetGlobalObservables(const RooArgSet &o)
Definition: ToyMCSampler.h:175
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
void Print(Option_t *opts=0) const
Print contents of the workspace.
Bool_t saveSnapshot(const char *name, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of parameters 'params' If importValues ...
Bool_t loadSnapshot(const char *name)
Load the values and attributes of the parameters in the snapshot saved with the given name.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
The Canvas class.
Definition: TCanvas.h:31
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3975
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition: TH1.cxx:8462
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:316
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Definition: TH1.cxx:2657
virtual Int_t GetNbinsX() const
Definition: TH1.h:292
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3251
TAxis * GetYaxis()
Definition: TH1.h:317
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
Definition: TH1.cxx:7728
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:395
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2974
virtual Double_t * GetIntegral()
Return a pointer to the array of bins integral.
Definition: TH1.cxx:2515
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1286
return c1
Definition: legend1.C:41
RooCmdArg Extended(Bool_t flag=kTRUE)
@(#)root/roostats:$Id$ Author: George Lewis, Kyle Cranmer
Definition: Asimov.h:20
Double_t SignificanceToPValue(Double_t Z)
returns p-value corresponding to a 1-sided significance
Definition: RooStatsUtils.h:49
static constexpr double pc
Definition: file.py:1
STL namespace.