ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TwoSidedFrequentistUpperLimitWithBands.C
Go to the documentation of this file.
1 /*
2 TwoSidedFrequentistUpperLimitWithBands
3 
4 Author: Kyle Cranmer,
5 Contributions from Aaron Armbruster, Haoshuang Ji, Haichen Wang and Daniel Whiteson
6 date: Dec. 2010 - Feb. 2011
7 v1. Jan 28, 2010
8 v2. March, 2010
9 v3. May, 2010 (uses 5.29 to fix global obs for simpdf)
10 
11 This is a standard demo that can be used with any ROOT file
12 prepared in the standard way. You specify:
13  - name for input ROOT file
14  - name of workspace inside ROOT file that holds model and data
15  - name of ModelConfig that specifies details for calculator tools
16  - name of dataset
17 
18 With default parameters the macro will attempt to run the
19 standard hist2workspace example and read the ROOT file
20 that it produces.
21 
22 You may want to control:
23  double confidenceLevel=0.95;
24  double additionalToysFac = 1.;
25  int nPointsToScan = 30;
26  int nToyMC = 500;
27 
28 This uses a modified version of the profile likelihood ratio as
29 a test statistic for upper limits (eg. test stat = 0 if muhat>mu).
30 
31 Based on the observed data, one defines a set of parameter points
32 to be tested based on the value of the parameter of interest
33 and the conditional MLE (eg. profiled) values of the nuisance parameters.
34 
35 At each parameter point, pseudo-experiments are generated using this
36 fixed reference model and then the test statistic is evaluated.
37 The auxiliary measurments (global observables) associated with the
38 constraint terms in nuisance parameters are also fluctuated in the
39 process of generating the pseudo-experiments in a frequentist manner
40 forming an 'unconditional ensemble'. One could form a 'conditional'
41 ensemble in which these auxiliary measuements are fixed. Note that the
42 nuisance parameters are not randomized, which is a Bayesian procedure.
43 Note, the nuisance parameters are floating in the fits. For each point,
44 the threshold that defines the 95% acceptance region is found. This
45 forms a "Confidence Belt".
46 
47 After constructing the confidence belt, one can find the confidence
48 interval for any particular dataset by finding the intersection
49 of the observed test statistic and the confidence belt. First
50 this is done on the observed data to get an observed 1-sided upper limt.
51 
52 Finally, there expected limit and bands (from background-only) are
53 formed by generating background-only data and finding the upper limit.
54 The background-only is defined as such that the nuisance parameters are
55 fixed to their best fit value based on the data with the signal rate fixed to 0.
56 The bands are done by hand for now, will later be part of the RooStats tools.
57 
58 On a technical note, this technique IS the generalization of Feldman-Cousins
59 with nuisance parameters.
60 
61 Building the confidence belt can be computationally expensive.
62 Once it is built, one could save it to a file and use it in a separate step.
63 
64 We can use PROOF to speed things along in parallel, however,
65 the test statistic has to be installed on the workers
66 so either turn off PROOF or include the modified test statistic
67 in your $ROOTSYS/roofit/roostats/inc directory,
68 add the additional line to the LinkDef.h file,
69 and recompile root.
70 
71 Note, if you have a boundary on the parameter of interest (eg. cross-section)
72 the threshold on the two-sided test statistic starts off at moderate values and plateaus.
73 
74 [#0] PROGRESS:Generation -- generated toys: 500 / 999
75 NeymanConstruction: Prog: 12/50 total MC = 39 this test stat = 0
76  SigXsecOverSM=0.69 alpha_syst1=0.136515 alpha_syst3=0.425415 beta_syst2=1.08496 [-1e+30, 0.011215] in interval = 1
77 
78 this tells you the values of the parameters being used to generate the pseudo-experiments
79 and the threshold in this case is 0.011215. One would expect for 95% that the threshold
80 would be ~1.35 once the cross-section is far enough away from 0 that it is essentially
81 unaffected by the boundary. As one reaches the last points in the scan, the
82 theshold starts to get artificially high. This is because the range of the parameter in
83 the fit is the same as the range in the scan. In the future, these should be independently
84 controled, but they are not now. As a result the ~50% of pseudo-experiments that have an
85 upward fluctuation end up with muhat = muMax. Because of this, the upper range of the
86 parameter should be well above the expected upper limit... but not too high or one will
87 need a very large value of nPointsToScan to resolve the relevant region. This can be
88 improved, but this is the first version of this script.
89 
90 Important note: when the model includes external constraint terms, like a Gaussian
91 constraint to a nuisance parameter centered around some nominal value there is
92 a subtlety. The asymptotic results are all based on the assumption that all the
93 measurements fluctuate... including the nominal values from auxiliary measurements.
94 If these do not fluctuate, this corresponds to an "conditional ensemble". The
95 result is that the distribution of the test statistic can become very non-chi^2.
96 This results in thresholds that become very large.
97 */
98 
99 #include "TFile.h"
100 #include "TROOT.h"
101 #include "TH1F.h"
102 #include "TCanvas.h"
103 #include "TSystem.h"
104 #include <iostream>
105 
106 #include "RooWorkspace.h"
107 #include "RooSimultaneous.h"
108 #include "RooAbsData.h"
109 
110 #include "RooStats/ModelConfig.h"
111 #include "RooStats/FeldmanCousins.h"
112 #include "RooStats/ToyMCSampler.h"
114 #include "RooStats/ConfidenceBelt.h"
115 
116 #include "RooStats/RooStatsUtils.h"
118 
119 using namespace RooFit;
120 using namespace RooStats;
121 using namespace std;
122 
123 bool useProof = false; // flag to control whether to use Proof
124 int nworkers = 0; // number of workers (default use all available cores)
125 
126 /////////////////////////////////////////////////////////////////////////
127 
129  const char* workspaceName = "combined",
130  const char* modelConfigName = "ModelConfig",
131  const char* dataName = "obsData") {
132 
133 
134  double confidenceLevel=0.95;
135  // degrade/improve number of pseudo-experiments used to define the confidence belt.
136  // value of 1 corresponds to default number of toys in the tail, which is 50/(1-confidenceLevel)
137  double additionalToysFac = 0.5;
138  int nPointsToScan = 20; // number of steps in the parameter of interest
139  int nToyMC = 200; // number of toys used to define the expected limit and band
140 
141  /////////////////////////////////////////////////////////////
142  // First part is just to access a user-defined file
143  // or create the standard example file if it doesn't exist
144  ////////////////////////////////////////////////////////////
145  const char* filename = "";
146  if (!strcmp(infile,"")) {
147  filename = "results/example_combined_GaussExample_model.root";
148  bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code
149  // if file does not exists generate with histfactory
150  if (!fileExist) {
151 #ifdef _WIN32
152  cout << "HistFactory file cannot be generated on Windows - exit" << endl;
153  return;
154 #endif
155  // Normally this would be run on the command line
156  cout <<"will run standard hist2workspace example"<<endl;
157  gROOT->ProcessLine(".! prepareHistFactory .");
158  gROOT->ProcessLine(".! hist2workspace config/example.xml");
159  cout <<"\n\n---------------------"<<endl;
160  cout <<"Done creating example input"<<endl;
161  cout <<"---------------------\n\n"<<endl;
162  }
163 
164  }
165  else
166  filename = infile;
167 
168  // Try to open the file
169  TFile *file = TFile::Open(filename);
170 
171  // if input file was specified byt not found, quit
172  if(!file ){
173  cout <<"StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
174  return;
175  }
176 
177  /////////////////////////////////////////////////////////////
178  // Now get the data and workspace
179  ////////////////////////////////////////////////////////////
180 
181  // get the workspace out of the file
182  RooWorkspace* w = (RooWorkspace*) file->Get(workspaceName);
183  if(!w){
184  cout <<"workspace not found" << endl;
185  return;
186  }
187 
188  // get the modelConfig out of the file
189  ModelConfig* mc = (ModelConfig*) w->obj(modelConfigName);
190 
191  // get the modelConfig out of the file
192  RooAbsData* data = w->data(dataName);
193 
194  // make sure ingredients are found
195  if(!data || !mc){
196  w->Print();
197  cout << "data or ModelConfig was not found" <<endl;
198  return;
199  }
200 
201  cout << "Found data and ModelConfig:" <<endl;
202  mc->Print();
203 
204  /////////////////////////////////////////////////////////////
205  // Now get the POI for convenience
206  // you may want to adjust the range of your POI
207  ////////////////////////////////////////////////////////////
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 expectd 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 iterval 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-constriant
316  ////////////////////////////////////////////////////////////
317 
318  // First: find parameter point for mu=0, with conditional MLEs for nuisance parameters
319  RooAbsReal* nll = mc->GetPdf()->createNLL(*data);
320  RooAbsReal* profile = nll->createProfile(*mc->GetParametersOfInterest());
321  firstPOI->setVal(0.);
322  profile->getVal(); // this will do fit and set nuisance parameters to profiled values
323  RooArgSet* poiAndNuisance = new RooArgSet();
324  if(mc->GetNuisanceParameters())
325  poiAndNuisance->add(*mc->GetNuisanceParameters());
326  poiAndNuisance->add(*mc->GetParametersOfInterest());
327  w->saveSnapshot("paramsToGenerateData",*poiAndNuisance);
328  RooArgSet* paramsToGenerateData = (RooArgSet*) poiAndNuisance->snapshot();
329  cout << "\nWill use these parameter points to generate pseudo data for bkg only" << endl;
330  paramsToGenerateData->Print("v");
331 
332 
333  RooArgSet unconditionalObs;
334  unconditionalObs.add(*mc->GetObservables());
335  unconditionalObs.add(*mc->GetGlobalObservables()); // comment this out for the original conditional ensemble
336 
337  double CLb=0;
338  double CLbinclusive=0;
339 
340  // Now we generate background only and find distribution of upper limits
341  TH1F* histOfUL = new TH1F("histOfUL","",100,0,firstPOI->getMax());
342  histOfUL->GetXaxis()->SetTitle("Upper Limit (background only)");
343  histOfUL->GetYaxis()->SetTitle("Entries");
344  for(int imc=0; imc<nToyMC; ++imc){
345 
346  // set parameters back to values for generating pseudo data
347  // cout << "\n get current nuis, set vals, print again" << endl;
348  w->loadSnapshot("paramsToGenerateData");
349  // poiAndNuisance->Print("v");
350 
351  RooDataSet* toyData = 0;
352  // now generate a toy dataset for the main measurement
353  if(!mc->GetPdf()->canBeExtended()){
354  if(data->numEntries()==1)
355  toyData = mc->GetPdf()->generate(*mc->GetObservables(),1);
356  else
357  cout <<"Not sure what to do about this model" <<endl;
358  } else{
359  // cout << "generating extended dataset"<<endl;
360  toyData = mc->GetPdf()->generate(*mc->GetObservables(),Extended());
361  }
362 
363  // generate global observables
364  // need to be careful for simpdf.
365  // In ROOT 5.28 there is a problem with generating global observables
366  // with a simultaneous PDF. In 5.29 there is a solution with
367  // RooSimultaneous::generateSimGlobal, but this may change to
368  // the standard generate interface in 5.30.
369 
370  RooSimultaneous* simPdf = dynamic_cast<RooSimultaneous*>(mc->GetPdf());
371  if(!simPdf){
372  RooDataSet *one = mc->GetPdf()->generate(*mc->GetGlobalObservables(), 1);
373  const RooArgSet *values = one->get();
374  RooArgSet *allVars = mc->GetPdf()->getVariables();
375  *allVars = *values;
376  delete allVars;
377  delete one;
378  } else {
379  RooDataSet* one = simPdf->generateSimGlobal(*mc->GetGlobalObservables(),1);
380  const RooArgSet *values = one->get();
381  RooArgSet *allVars = mc->GetPdf()->getVariables();
382  *allVars = *values;
383  delete allVars;
384  delete one;
385 
386  }
387 
388 
389  // get test stat at observed UL in observed data
390  firstPOI->setVal(observedUL);
391  double toyTSatObsUL = fc.GetTestStatSampler()->EvaluateTestStatistic(*toyData,tmpPOI);
392  // toyData->get()->Print("v");
393  // cout <<"obsTSatObsUL " <<obsTSatObsUL << "toyTS " << toyTSatObsUL << endl;
394  if(obsTSatObsUL < toyTSatObsUL) // not sure about <= part yet
395  CLb+= (1.)/nToyMC;
396  if(obsTSatObsUL <= toyTSatObsUL) // not sure about <= part yet
397  CLbinclusive+= (1.)/nToyMC;
398 
399 
400  // loop over points in belt to find upper limit for this toy data
401  double thisUL = 0;
402  for(Int_t i=0; i<parameterScan->numEntries(); ++i){
403  tmpPoint = (RooArgSet*) parameterScan->get(i)->clone("temp");
404  double arMax = belt->GetAcceptanceRegionMax(*tmpPoint);
405  firstPOI->setVal( tmpPoint->getRealValue(firstPOI->GetName()) );
406  // double thisTS = profile->getVal();
407  double thisTS = fc.GetTestStatSampler()->EvaluateTestStatistic(*toyData,tmpPOI);
408 
409  // cout << "poi = " << firstPOI->getVal()
410  // << " max is " << arMax << " this profile = " << thisTS << endl;
411  // cout << "thisTS = " << thisTS<<endl;
412  if(thisTS<=arMax){
413  thisUL = firstPOI->getVal();
414  } else{
415  break;
416  }
417  }
418 
419 
420  histOfUL->Fill(thisUL);
421 
422  // for few events, data is often the same, and UL is often the same
423  // cout << "thisUL = " << thisUL<<endl;
424 
425  delete toyData;
426  }
427  histOfUL->Draw();
428  c1->SaveAs("two-sided_upper_limit_output.pdf");
429 
430  // if you want to see a plot of the sampling distribution for a particular scan point:
431  /*
432  SamplingDistPlot sampPlot;
433  int indexInScan = 0;
434  tmpPoint = (RooArgSet*) parameterScan->get(indexInScan)->clone("temp");
435  firstPOI->setVal( tmpPoint->getRealValue(firstPOI->GetName()) );
436  toymcsampler->SetParametersForTestStat(tmpPOI);
437  SamplingDistribution* samp = toymcsampler->GetSamplingDistribution(*tmpPoint);
438  sampPlot.AddSamplingDistribution(samp);
439  sampPlot.Draw();
440  */
441 
442  // Now find bands and power constraint
443  Double_t* bins = histOfUL->GetIntegral();
444  TH1F* cumulative = (TH1F*) histOfUL->Clone("cumulative");
445  cumulative->SetContent(bins);
446  double band2sigDown=0, band1sigDown=0, bandMedian=0, band1sigUp=0,band2sigUp=0;
447  for(int i=1; i<=cumulative->GetNbinsX(); ++i){
448  if(bins[i]<RooStats::SignificanceToPValue(2))
449  band2sigDown=cumulative->GetBinCenter(i);
450  if(bins[i]<RooStats::SignificanceToPValue(1))
451  band1sigDown=cumulative->GetBinCenter(i);
452  if(bins[i]<0.5)
453  bandMedian=cumulative->GetBinCenter(i);
454  if(bins[i]<RooStats::SignificanceToPValue(-1))
455  band1sigUp=cumulative->GetBinCenter(i);
456  if(bins[i]<RooStats::SignificanceToPValue(-2))
457  band2sigUp=cumulative->GetBinCenter(i);
458  }
459  cout << "-2 sigma band " << band2sigDown << endl;
460  cout << "-1 sigma band " << band1sigDown << " [Power Constriant)]" << endl;
461  cout << "median of band " << bandMedian << endl;
462  cout << "+1 sigma band " << band1sigUp << endl;
463  cout << "+2 sigma band " << band2sigUp << endl;
464 
465  // print out the iterval on the first Parameter of Interest
466  cout << "\nobserved 95% upper-limit "<< interval->UpperLimit(*firstPOI) <<endl;
467  cout << "CLb strict [P(toy>obs|0)] for observed 95% upper-limit "<< CLb <<endl;
468  cout << "CLb inclusive [P(toy>=obs|0)] for observed 95% upper-limit "<< CLbinclusive <<endl;
469 
470  delete profile;
471  delete nll;
472 
473 }
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:1213
Bool_t saveSnapshot(const char *name, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of parameters 'params' If importValue...
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
void AdditionalNToysFactor(double fact)
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
TCanvas * c1
Definition: legend1.C:2
ConfidenceBelt * GetConfidenceBelt()
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
Definition: ModelConfig.h:265
std::vector< double > values
Definition: TwoHistoFit2D.C:32
double confidenceLevel
static const char * filename()
void TwoSidedFrequentistUpperLimitWithBands(const char *infile="", const char *workspaceName="combined", const char *modelConfigName="ModelConfig", const char *dataName="obsData")
#define gROOT
Definition: TROOT.h:344
virtual Double_t getMin(const char *name=0) const
int Int_t
Definition: RtypesCore.h:41
const TKDTreeBinning * bins
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
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:3851
RooAbsData * GetPointsToScan()
RooAbsArg * first() const
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:839
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TObject.cxx:203
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:2082
virtual void Draw(Option_t *option="")
Forward draw command to data store.
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
Double_t SignificanceToPValue(Double_t Z)
Definition: RooStatsUtils.h:64
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:37
tuple infile
Definition: mrt.py:15
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Definition: RooRealVar.cxx:203
virtual TestStatistic * GetTestStatistic(unsigned int i) const
Definition: ToyMCSampler.h:162
Double_t LowerLimit(RooRealVar &param)
return lower limit on a given parameter
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
void SetNBins(Int_t bins)
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:293
void FluctuateNumDataEntries(bool flag=true)
void SetProofConfig(ProofConfig *pc=NULL)
Definition: ToyMCSampler.h:263
tuple w
Definition: qtexample.py:51
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
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
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
virtual TObject * clone(const char *newname) const
Definition: RooArgSet.h:82
PointSetInterval is a concrete implementation of the ConfInterval interface.
tuple file
Definition: fildir.py:20
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
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
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 'global observables' – for RooStats tools...
virtual Double_t getMax(const char *name=0) const
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet &paramsOfInterest)=0
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
void CreateConfBelt(bool flag=true)
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.)
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 'index'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
Definition: RooArgSet.cxx:448
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