59 void StandardHistFactoryPlotsWithCategories(
const char* infile =
"",
60 const char* workspaceName =
"combined",
61 const char* modelConfigName =
"ModelConfig",
62 const char* dataName =
"obsData"){
65 double nSigmaToVary=5.;
72 const char* filename =
"";
73 if (!strcmp(infile,
"")) {
74 filename =
"results/example_combined_GaussExample_model.root";
79 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
83 cout <<
"will run standard hist2workspace example"<<endl;
84 gROOT->ProcessLine(
".! prepareHistFactory .");
85 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
86 cout <<
"\n\n---------------------"<<endl;
87 cout <<
"Done creating example input"<<endl;
88 cout <<
"---------------------\n\n"<<endl;
100 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
111 cout <<
"workspace not found" << endl;
124 cout <<
"data or ModelConfig was not found" <<endl;
147 int nPlotsMax = 1000;
148 cout <<
" check expectedData by category"<<endl;
152 cout <<
"Is a simultaneous PDF"<<endl;
155 cout <<
"Is not a simultaneous PDF"<<endl;
210 cout <<
"on type " << tt->
GetName() <<
" " << endl;
235 if(strcmp(var->
GetName(),
"Lumi")==0){
236 cout <<
"working on lumi"<<endl;
250 if(strcmp(var->
GetName(),
"Lumi")==0){
251 cout <<
"working on lumi"<<endl;
255 var->
setVal(nSigmaToVary);
263 if(strcmp(var->
GetName(),
"Lumi")==0){
264 cout <<
"working on lumi"<<endl;
268 var->
setVal(-nSigmaToVary);
279 if(strcmp(var->
GetName(),
"Lumi")==0){
280 cout <<
"working on lumi"<<endl;
314 for(
int i=0; i<list->
GetSize(); ++i){
virtual Double_t sumEntries() const =0
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
void doFit(int n, const char *fitter)
RooCmdArg Cut(const char *cutSpec)
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
RooCmdArg LineColor(Color_t color)
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
void SetYTitle(const char *title)
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
const RooAbsCategoryLValue & indexCat() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Iterator abstract base class.
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
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
RooCmdArg MarkerSize(Size_t size)
RooCmdArg DataError(Int_t)
RooCmdArg LineStyle(Style_t style)
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
TIterator * createIterator(Bool_t dir=kIterForward) const
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Double_t getVal(const RooArgSet *set=0) const
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Plot dataset on specified frame.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual const RooArgSet * get() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
R__EXTERN TSystem * gSystem
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none(), const RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
RooDataSet is a container class to hold unbinned data.
RooCategory represents a fundamental (non-derived) discrete value object.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
Namespace for the RooStats classes.
virtual Int_t GetSize() const
RooCmdArg Normalization(Double_t scaleFactor)
RooCmdArg LineWidth(Width_t width)
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
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.
virtual void Add(TObject *obj)
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual TObject * Next()=0
virtual RooFitResult * fitTo(RooAbsData &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Fit PDF to given dataset.
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
Int_t CeilNint(Double_t x)
virtual const Text_t * GetName() const
Returns name of object.
TIterator * typeIterator() const
Return iterator over all defined states.
The RooWorkspace is a persistable container for RooFit projects.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
virtual const char * getLabel() const
Return label string of current state.