Logo ROOT   6.07/09
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 = 30;
23 /// int nToyMC = 500;
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"
114 #include "RooStats/FeldmanCousins.h"
115 #include "RooStats/ToyMCSampler.h"
117 #include "RooStats/ConfidenceBelt.h"
118 
119 #include "RooStats/RooStatsUtils.h"
121 
122 using namespace RooFit;
123 using namespace RooStats;
124 using namespace std;
125 
126 bool useProof = false; // flag to control whether to use Proof
127 int nworkers = 0; // number of workers (default use all available cores)
128 
129 // -------------------------------------------------------
130 
131 void 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;
264  mc->GetGlobalObservables()->Print();
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 }
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
Definition: RooAbsPdf.cxx:777
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:1265
Bool_t saveSnapshot(const char *name, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of parameters &#39;params&#39; If importValues ...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3127
Holds configuration options for proof and proof-lite.
Definition: ProofConfig.h:49
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:52
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
Definition: ModelConfig.h:244
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
virtual void SetGlobalObservables(const RooArgSet &o)
Definition: ToyMCSampler.h:205
return c1
Definition: legend1.C:41
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
Definition: ModelConfig.h:265
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Definition: THist.hxx:302
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:50
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:659
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:400
#define gROOT
Definition: TROOT.h:364
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
virtual Double_t getMin(const char *name=0) const
int Int_t
Definition: RtypesCore.h:41
virtual Int_t GetNbinsX() const
Definition: TH1.h:301
STL namespace.
RooCmdArg Extended(Bool_t flag=kTRUE)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Definition: ModelConfig.h:250
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Definition: TH1.cxx:2546
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3871
RooAbsArg * first() const
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:1956
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2082
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
Definition: TPad.cxx:5037
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
Definition: TH1.cxx:7477
Double_t SignificanceToPValue(Double_t Z)
Definition: RooStatsUtils.h:64
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:37
virtual void setVal(Double_t value)
Set value of variable to &#39;value&#39;.
Definition: RooRealVar.cxx:205
virtual TestStatistic * GetTestStatistic(unsigned int i) const
Definition: ToyMCSampler.h:162
Double_t LowerLimit(RooRealVar &param)
return lower limit on a given parameter
virtual Double_t * GetIntegral()
Return a pointer to the array of bins integral.
Definition: TH1.cxx:2405
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition: TH1.cxx:8208
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2853
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Int_t numEntries() const
Definition: RooAbsData.cxx:269
void SetProofConfig(ProofConfig *pc=NULL)
Definition: ToyMCSampler.h:263
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
TAxis * GetYaxis()
Definition: TH1.h:325
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
Bool_t loadSnapshot(const char *name)
Load the values and attributes of the parameters in the snapshot saved with the given name...
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:99
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
virtual void Print(Option_t *option="") const
overload the print method
Definition: ModelConfig.cxx:90
Double_t UpperLimit(RooRealVar &param)
return upper limit on a given parameter
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
Definition: ModelConfig.h:259
The Canvas class.
Definition: TCanvas.h:41
Namespace for the RooStats classes.
Definition: Asimov.h:20
virtual TObject * clone(const char *newname) const
Definition: RooArgSet.h:82
PointSetInterval is a concrete implementation of the ConfInterval interface.
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Bool_t canBeExtended() const
Definition: RooAbsPdf.h:216
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of &#39;global observables&#39; – for RooStats tools...
virtual Double_t getMax(const char *name=0) const
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Definition: TPad.cxx:1089
Definition: file.py:1
void Print(Option_t *opts=0) const
Print contents of the workspace.
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())
Generate a new dataset containing the specified variables with events sampled from our distribution...
Definition: RooAbsPdf.cxx:1702
virtual RooAbsReal * createProfile(const RooArgSet &paramsOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function...
Definition: RooAbsReal.cxx:463
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
Definition: ModelConfig.h:247
Double_t GetAcceptanceRegionMax(RooArgSet &, Double_t cl=-1., Double_t leftside=-1.)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:155
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event &#39;index&#39;.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
Definition: RooArgSet.cxx:448
TAxis * GetXaxis()
Definition: TH1.h:324
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:42
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:527