43 using namespace RooFit;
44 using namespace RooStats;
46 void StandardProfileInspectorDemo(
const char *infile =
"",
const char *workspaceName =
"combined",
47 const char *modelConfigName =
"ModelConfig",
const char *dataName =
"obsData")
54 const char *filename =
"";
55 if (!strcmp(infile,
"")) {
56 filename =
"results/example_combined_GaussExample_model.root";
57 bool fileExist = !gSystem->AccessPathName(filename);
61 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
65 cout <<
"will run standard hist2workspace example" << endl;
66 gROOT->ProcessLine(
".! prepareHistFactory .");
67 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
68 cout <<
"\n\n---------------------" << endl;
69 cout <<
"Done creating example input" << endl;
70 cout <<
"---------------------\n\n" << endl;
77 TFile *file = TFile::Open(filename);
81 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
90 RooWorkspace *w = (RooWorkspace *)file->Get(workspaceName);
92 cout <<
"workspace not found" << endl;
97 ModelConfig *mc = (ModelConfig *)w->obj(modelConfigName);
100 RooAbsData *data = w->data(dataName);
105 cout <<
"data or ModelConfig was not found" << endl;
112 TList *list = p.GetListOfProfilePlots(*data, mc);
115 TCanvas *c1 =
new TCanvas(
"c1",
"ProfileInspectorDemo", 800, 200);
116 if (list->GetSize() > 4) {
117 double n = list->GetSize();
118 int nx = (int)sqrt(n);
119 int ny = TMath::CeilNint(n / nx);
120 nx = TMath::CeilNint(sqrt(n));
123 c1->Divide(list->GetSize());
124 for (
int i = 0; i < list->GetSize(); ++i) {
126 list->At(i)->Draw(
"al");