59void StandardHistFactoryPlotsWithCategories(
const char *infile =
"",
const char *workspaceName =
"combined",
60 const char *modelConfigName =
"ModelConfig",
61 const char *dataName =
"obsData")
64 double nSigmaToVary = 5.;
71 const char *filename =
"";
72 if (!strcmp(infile,
"")) {
73 filename =
"results/example_combined_GaussExample_model.root";
78 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
82 cout <<
"will run standard hist2workspace example" << endl;
83 gROOT->ProcessLine(
".! prepareHistFactory .");
84 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
85 cout <<
"\n\n---------------------" << endl;
86 cout <<
"Done creating example input" << endl;
87 cout <<
"---------------------\n\n" << endl;
98 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
109 cout <<
"workspace not found" << endl;
122 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;
163 cout <<
Form(
"%s==%s::%s", channelCat->
GetName(), channelCat->
GetName(),
tt->GetName()) << endl;
164 cout <<
tt->GetName() <<
" " << channelCat->
getLabel() << endl;
204 cout <<
"on type " <<
tt->GetName() <<
" " << endl;
222 cout <<
Form(
"%s==%s::%s", channelCat->
GetName(), channelCat->
GetName(),
tt->GetName()) << endl;
223 cout <<
tt->GetName() <<
" " << channelCat->
getLabel() << endl;
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);
260 if (strcmp(var->
GetName(),
"Lumi") == 0) {
261 cout <<
"working on lumi" << endl;
265 var->
setVal(-nSigmaToVary);
275 if (strcmp(var->
GetName(),
"Lumi") == 0) {
276 cout <<
"working on lumi" << endl;
301 int nx = (int)
sqrt(
n);
307 for (
int i = 0; i < list->
GetSize(); ++i) {
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
TIterator * typeIterator() const
Return iterator over all defined states.
RooAbsArg * first() const
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
virtual Double_t sumEntries() const =0
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
Calls RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;.
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.
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 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
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
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
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
RooCategory represents a fundamental (non-derived) discrete value object.
virtual const char * getLabel() const
Return label string of current state.
RooDataSet is a container class to hold unbinned data.
A RooPlot is a plot frame and a container for graphics objects within that frame.
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
void SetYTitle(const char *title)
virtual 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.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
const RooAbsCategoryLValue & indexCat() const
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
The RooWorkspace is a persistable container for RooFit projects.
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
void Print(Option_t *opts=0) const
Print contents of the workspace.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
Iterator abstract base class.
virtual TObject * Next()=0
virtual void Add(TObject *obj)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Template specialisation used in RooAbsArg:
RooCmdArg LineWidth(Width_t width)
RooCmdArg MarkerSize(Size_t size)
RooCmdArg Cut(const char *cutSpec)
RooCmdArg DataError(Int_t)
RooCmdArg LineColor(Color_t color)
RooCmdArg Normalization(Double_t scaleFactor)
RooCmdArg LineStyle(Style_t style)
Namespace for the RooStats classes.
Int_t CeilNint(Double_t x)