49 using namespace RooFit;
50 using namespace RooStats;
54 const char* workspaceName =
"combined",
55 const char* modelConfigName =
"ModelConfig",
56 const char* dataName =
"obsData"){
59 double nSigmaToVary=5.;
69 filename =
"results/example_combined_GaussExample_model.root";
74 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
78 cout <<
"will run standard hist2workspace example"<<endl;
79 gROOT->ProcessLine(
".! prepareHistFactory .");
80 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
81 cout <<
"\n\n---------------------"<<endl;
82 cout <<
"Done creating example input"<<endl;
83 cout <<
"---------------------\n\n"<<endl;
95 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
106 cout <<
"workspace not found" << endl;
119 cout <<
"data or ModelConfig was not found" <<endl;
143 int nPlotsMax = 1000;
144 cout <<
" check expectedData by category"<<endl;
148 cout <<
"Is a simultaneous PDF"<<endl;
151 cout <<
"Is not a simultaneous PDF"<<endl;
206 cout <<
"on type " << tt->
GetName() <<
" " << endl;
220 TCanvas*
c2 =
new TCanvas(
"c2");
231 if(strcmp(var->
GetName(),
"Lumi")==0){
232 cout <<
"working on lumi"<<endl;
246 if(strcmp(var->
GetName(),
"Lumi")==0){
247 cout <<
"working on lumi"<<endl;
251 var->
setVal(nSigmaToVary);
259 if(strcmp(var->
GetName(),
"Lumi")==0){
260 cout <<
"working on lumi"<<endl;
264 var->
setVal(-nSigmaToVary);
275 if(strcmp(var->
GetName(),
"Lumi")==0){
276 cout <<
"working on lumi"<<endl;
302 TCanvas*
c1 =
new TCanvas(
"c1",
"ProfileInspectorDemo",800,200);
311 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
static const char * filename()
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)
std::map< std::string, std::string >::const_iterator iter
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)
virtual Int_t GetSize() const
RooCmdArg Normalization(Double_t scaleFactor)
RooCmdArg LineWidth(Width_t width)
void StandardHistFactoryPlotsWithCategories(const char *infile="", const char *workspaceName="combined", const char *modelConfigName="ModelConfig", const char *dataName="obsData")
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 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.