50 using namespace RooFit;
51 using namespace RooStats;
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
80 filename =
"results/example_channel1_GammaExample_model.root";
85 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
89 cout <<
"will run standard hist2workspace example"<<endl;
90 gROOT->ProcessLine(
".! prepareHistFactory .");
91 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
92 cout <<
"\n\n---------------------"<<endl;
93 cout <<
"Done creating example input"<<endl;
94 cout <<
"---------------------\n\n"<<endl;
106 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
121 cout <<
"workspace not found" << endl;
134 cout <<
"data or ModelConfig was not found" << endl;
140 firstPOI->
setVal(poiValueForSignal);
144 firstPOI->
setVal(poiValueForBackground);
172 }
else cout <<
"Not sure what to do about this model" << endl;
189 freqCalcResult->
Print();
194 cout <<
"total CPU time: " << mn_t->
CpuTime() << endl;
195 cout <<
"total real time: " << mn_t->
RealTime() << endl;
198 TCanvas*
c1 =
new TCanvas();
204 TF1*
f =
new TF1(
"f",
TString::Format(
"1*ROOT::Math::chisquared_pdf(2*x,%d,0)",nPOI), 0,20);
205 f->SetLineColor(
kBlack );
206 f->SetLineStyle( 7 );
210 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.
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...
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
void SetToys(int toysNull, int toysAlt)
set number of toys
HypoTestResult is a base class for results from hypothesis tests.
static const char * filename()
virtual void SetNEventsPerToy(const Int_t nevents)
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...
double StandardFrequentistDiscovery(const char *infile="", const char *workspaceName="channel1", const char *modelConfigNameSB="ModelConfig", const char *dataName="obsData", int toys=1000, double poiValueForBackground=0.0, double poiValueForSignal=1.0)
SamplingDistribution * GetAltDistribution(void) const
void SetLogYaxis(Bool_t ly)
changes plot to log scale on y axis
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
RooAbsArg * first() const
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
virtual ModelConfig * Clone(const char *name="") const
clone
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...
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
void Print(const Option_t *="") const
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
virtual Double_t NullPValue() const
Return p-value for null hypothesis.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
R__EXTERN TSystem * gSystem
virtual Int_t numEntries() 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.
void AddTF1(TF1 *f, const char *title=NULL, Option_t *drawOptions="SAME")
add a TF1
Bool_t canBeExtended() const
SamplingDistribution * GetNullDistribution(void) const
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
void Print(Option_t *opts=0) const
Print contents of the workspace.
Hypothesis Test Calculator using a full frequentist procedure for sampling the test statistic distrib...
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
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.