56 double StandardFrequentistDiscovery(
57 const char* infile =
"",
58 const char* workspaceName =
"channel1",
59 const char* modelConfigNameSB =
"ModelConfig",
60 const char* dataName =
"obsData",
62 double poiValueForBackground = 0.0,
63 double poiValueForSignal = 1.0
77 const char* filename =
"";
78 if (!strcmp(infile,
"")) {
79 filename =
"results/example_channel1_GammaExample_model.root";
84 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
88 cout <<
"will run standard hist2workspace example"<<endl;
89 gROOT->ProcessLine(
".! prepareHistFactory .");
90 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
91 cout <<
"\n\n---------------------"<<endl;
92 cout <<
"Done creating example input"<<endl;
93 cout <<
"---------------------\n\n"<<endl;
105 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
120 cout <<
"workspace not found" << endl;
133 cout <<
"data or ModelConfig was not found" << endl;
139 firstPOI->
setVal(poiValueForSignal);
143 firstPOI->
setVal(poiValueForBackground);
170 toymcs.SetNEventsPerToy(1);
171 }
else cout <<
"Not sure what to do about this model" << endl;
182 freqCalc.SetToys( toys,toys );
188 freqCalcResult->
Print();
193 cout <<
"total CPU time: " << mn_t->
CpuTime() << endl;
194 cout <<
"total real time: " << mn_t->
RealTime() << endl;
209 c1->
SaveAs(
"standard_discovery_output.pdf");
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Holds configuration options for proof and proof-lite.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Print(const Option_t *="") const
Print out some information about the results Note: use Alt/Null labels for the hypotheses here as the...
HypoTestResult is a base class for results from hypothesis tests.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
This class provides the plots for the result of a study performed with any of the HypoTestCalculatorG...
SamplingDistribution * GetAltDistribution(void) const
void SetLogYaxis(Bool_t ly)
changes plot to log scale on y axis
virtual ModelConfig * Clone(const char *name="") const
clone
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
void Stop()
Stop the stopwatch.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
RooRealVar represents a fundamental (non-derived) real valued object.
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
R__EXTERN TSystem * gSystem
RooAbsArg * first() const
virtual Double_t NullPValue() const
Return p-value for null hypothesis.
SamplingDistribution * GetNullDistribution(void) const
RooAbsData is the common abstract base class for binned and unbinned datasets.
void SetOneSidedDiscovery(Bool_t flag=true)
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
ToyMCSampler is an implementation of the TestStatSampler interface.
Bool_t canBeExtended() const
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
Namespace for the RooStats classes.
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
void AddTF1(TF1 *f, const char *title=NULL, Option_t *drawOptions="SAME")
add a TF1
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Does a frequentist hypothesis test.
static constexpr double pc
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual void SetSnapshot(const RooArgSet &set)
set parameter values for a particular hypothesis if using a common PDF by saving a snapshot in the wo...
virtual void SetVarName(const char *name)
The RooWorkspace is a persistable container for RooFit projects.
virtual Int_t numEntries() const