ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ModelInspector.C
Go to the documentation of this file.
1 //////////////////////////////////////
2 // RooStats Model Inspector
3 // Author Kyle Cranmer <cranmer@cern.ch>
4 // Version 1, October 2011
5 // - based on tutorial macro by Bertrand Bellenot, Ilka Antcheva
6 // Version 2, November 2011
7 // - fixes from Bertrand Bellenot <Bertrand.Bellenot@cern.ch> for scrolling window for many parameters
8 //
9 //
10 // Usage:
11 // The usage is the same as the StandardXxxDemo.C macros.
12 // The macro expects a root file containing a workspace with a ModelConfig and a dataset
13 // $ root
14 // .L ModelInspector.C+
15 // ModelInspector(fileName, workspaceName, modelConfigName, dataSetName);
16 //
17 // Drag the sliders to adjust the parameters of the model.
18 // the min and max range of the sliders are used to define the upper & lower variation
19 // the pointer position of the slider is the central blue curve.
20 //
21 // Click the FIT button to
22 //
23 // To Do:
24 // - check boxes to specify which nuisance parameters used in making variation
25 // - a button to make the profile inspector plots
26 // - a check button to use MINOS errors
27 // - have fit button show the covariance matrix from the fit
28 // - a button to make the log likelihood plots
29 // - a dialog to open the desired file
30 // - ability to see teh signal and background contributions?
31 //
32 
33 #include "TGButton.h"
34 #include "TRootEmbeddedCanvas.h"
35 #include "TGLayout.h"
36 #include "TF1.h"
37 #include "TMath.h"
38 #include "TSystem.h"
39 #include "TCanvas.h"
40 #include "TGTextEntry.h"
41 #include "TGLabel.h"
42 #include "TGTripleSlider.h"
43 #include "RooWorkspace.h"
44 #include "RooStats/ModelConfig.h"
45 #include "TFile.h"
46 #include "RooArgSet.h"
47 #include "TList.h"
48 #include "RooAbsPdf.h"
49 #include "RooRealVar.h"
50 #include "RooPlot.h"
51 #include "TGButton.h"
52 #include <map>
53 #include "RooFitResult.h"
54 #include "TROOT.h"
55 #include <TApplication.h>
56 #include "RooSimultaneous.h"
57 #include "RooCategory.h"
58 
65 
67 };
68 
69 using namespace RooFit;
70 using namespace RooStats;
71 class ModelInspectorGUI : public TGMainFrame {
72 
73 private:
74  TRootEmbeddedCanvas *fCanvas;
75  TGLayoutHints *fLcan;
76  TF1 *fFitFcn;
77  RooPlot* fPlot;
78  RooWorkspace* fWS;
79  TFile* fFile;
80  ModelConfig* fMC;
81  RooAbsData* fData;
82  RooFitResult* fFitRes;
83 
84  TList fSliderList;
85  TList fFrameList;
86  vector<RooPlot*> fPlotList;
87  map<TGTripleHSlider*,const char*> fSliderMap;
88  map<TGTripleHSlider*,TGLabel*> fLabelMap;
89 
90  TGButton* fFitButton;
91  TGTextButton *fExitButton;
92 
93  // BB: a TGCanvas and a vertical frame are needed for using scrollbars
94  TGCanvas *fCan;
95  TGVerticalFrame *fVFrame;
96 
97  TGHorizontalFrame *fHframe0, *fHframe1, *fHframe2;
98  TGLayoutHints *fBly, *fBfly1, *fBfly2, *fBfly3;
99  TGTripleHSlider *fHslider1;
100  // TGTextEntry *fTeh1, *fTeh2, *fTeh3;
101  TGTextBuffer *fTbh1, *fTbh2, *fTbh3;
102  TGCheckButton *fCheck1, *fCheck2;
103 
104 public:
105  ModelInspectorGUI(RooWorkspace*, ModelConfig*, RooAbsData*);
106  virtual ~ModelInspectorGUI();
107 
108  void CloseWindow();
109  void DoText(const char *text);
110  void DoSlider();
111  void DoSlider(const char*);
112  void DoFit();
113  void DoExit();
114  void HandleButtons();
115 
116  ClassDef(ModelInspectorGUI, 0)
117 };
118 
119 //______________________________________________________________________________
120 ModelInspectorGUI::ModelInspectorGUI(RooWorkspace* w, ModelConfig* mc, RooAbsData* data)
121  : TGMainFrame(gClient->GetRoot(), 100, 100)
122 {
123 
125  fWS = w;
126  fMC = mc;
127  fData = data;
128  RooSimultaneous* simPdf = NULL;
129  Int_t numCats = 1;
130  if(strcmp(fMC->GetPdf()->ClassName(),"RooSimultaneous")==0){
131  cout <<"Is a simultaneous PDF"<< endl;
132  simPdf = (RooSimultaneous*)(fMC->GetPdf());
133  RooCategory* channelCat = (RooCategory*) (&simPdf->indexCat());
134  cout <<" with " << channelCat->numTypes() << " categories"<<endl;
135  numCats = channelCat->numTypes();
136  } else {
137  cout <<"Is not a simultaneous PDF"<<endl;
138  }
139  fFitRes=0;
140 
141 
142  //char buf[32];
143  SetCleanup(kDeepCleanup);
144 
145  // Create an embedded canvas and add to the main frame, centered in x and y
146  // and with 30 pixel margins all around
147  fCanvas = new TRootEmbeddedCanvas("Canvas", this, 600, 400);
148  fLcan = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 10);
149  AddFrame(fCanvas, fLcan);
150  fPlotList.resize(numCats);
151  if(numCats>1){
152  fCanvas->GetCanvas()->Divide(numCats);
153  for(int i=0; i<numCats; ++i){
154  // fCanvas->GetCanvas()->SetFillColor(33);
155  // fCanvas->GetCanvas()->SetFrameFillColor(41);
156  fCanvas->GetCanvas()->cd(i+1)->SetBorderMode(0);
157  fCanvas->GetCanvas()->cd(i+1)->SetGrid();
158  // fCanvas->GetCanvas()->SetLogy();
159  }
160  }
161 
162  fHframe0 = new TGHorizontalFrame(this, 0, 0, 0);
163 
164  fCheck1 = new TGCheckButton(fHframe0, "&Constrained", HCId1);
165  fCheck2 = new TGCheckButton(fHframe0, "&Relative", HCId2);
166  fCheck1->SetState(kButtonUp);
167  fCheck2->SetState(kButtonUp);
168  fCheck1->SetToolTipText("Pointer position constrained to slider sides");
169  fCheck2->SetToolTipText("Pointer position relative to slider position");
170 
171  fHframe0->Resize(200, 50);
172 
173 
174  fHframe2 = new TGHorizontalFrame(this, 0, 0, 0);
175 
176  fFitButton = new TGTextButton(fHframe2,"Fit");
177  fFitButton->Connect("Clicked()","ModelInspectorGUI",this,"DoFit()");
178  fExitButton = new TGTextButton(fHframe2, "Exit ");
179  fExitButton->Connect("Clicked()", "ModelInspectorGUI", this, "DoExit()");
180 
181 
182  fCheck1->Connect("Clicked()", "ModelInspectorGUI", this,
183  "HandleButtons()");
184  fCheck2->Connect("Clicked()", "ModelInspectorGUI", this,
185  "HandleButtons()");
186 
187  fHframe2->Resize(100, 25);
188 
189  //--- layout for buttons: top align, equally expand horizontally
190  fBly = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5);
191 
192  //--- layout for the frame: place at bottom, right aligned
193  fBfly1 = new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 5, 5);
194  fBfly2 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
195  fBfly3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 5, 5, 5, 5);
196 
197  // fHframe0->AddFrame(fCheck1, fBfly2);
198  // fHframe0->AddFrame(fCheck2, fBfly2);
199  fHframe2->AddFrame(fFitButton, fBfly2);
200  fHframe2->AddFrame(fExitButton, fBfly3);
201 
202  AddFrame(fHframe0, fBly);
203  AddFrame(fHframe2, fBly);
204 
205 
206  // Loop over POI & NP, create slider
207  // need maps of NP->slider? or just slider->NP
208  RooArgSet parameters;
209  parameters.add(*fMC->GetParametersOfInterest());
210  parameters.add(*fMC->GetNuisanceParameters());
211  TIterator* it = parameters.createIterator();
212  RooRealVar* param=NULL;
213 
214  // BB: This is the part needed in order to have scrollbars
215  fCan = new TGCanvas(this, 100, 100, kFixedSize);
216  AddFrame(fCan, new TGLayoutHints(kLHintsExpandY | kLHintsExpandX));
217  fVFrame = new TGVerticalFrame(fCan->GetViewPort(), 10, 10);
218  fCan->SetContainer(fVFrame);
219  // And that't it!
220  // Obviously, the parent of other subframes is now fVFrame instead of "this"...
221 
222  while( (param=(RooRealVar*)it->Next()) ){
223  cout <<"Adding Slider for "<<param->GetName()<<endl;
224  TGHorizontalFrame* hframek = new TGHorizontalFrame(fVFrame, 0, 0, 0);
225 
226  TGLabel* hlabel = new TGLabel(hframek,Form("%s = %.3f +%.3f",param->GetName(),param->getVal(),param->getError()));
227  TGTripleHSlider* hsliderk = new TGTripleHSlider(hframek, 190, kDoubleScaleBoth, HSId1,
229  GetDefaultFrameBackground(),
231  hsliderk->Connect("PointerPositionChanged()", "ModelInspectorGUI",
232  this, "DoSlider()");
233  hsliderk->Connect("PositionChanged()", "ModelInspectorGUI",
234  this, "DoSlider()");
235  hsliderk->SetRange(param->getMin(),param->getMax());
236 
237  hframek->Resize(200, 25);
238  fSliderList.Add(hsliderk);
239  fFrameList.Add(hframek);
240 
241  hsliderk->SetPosition(param->getVal()-param->getError(),param->getVal()+param->getError());
242  hsliderk->SetPointerPosition(param->getVal());
243 
244  hframek->AddFrame(hlabel, fBly);
245  hframek->AddFrame(hsliderk, fBly);
246  fVFrame->AddFrame(hframek, fBly);
247  fSliderMap[hsliderk]=param->GetName();
248  fLabelMap[hsliderk]=hlabel;
249  }
250 
251  // Set main frame name, map sub windows (buttons), initialize layout
252  // algorithm via Resize() and map main frame
253  SetWindowName("RooFit/RooStats Model Inspector");
254  MapSubwindows();
255  Resize(GetDefaultSize());
256  MapWindow();
257 
258  DoSlider();
259 }
260 
261 //______________________________________________________________________________
262 ModelInspectorGUI::~ModelInspectorGUI()
263 {
264  // Clean up
265 
266  Cleanup();
267 }
268 
269 //______________________________________________________________________________
270 void ModelInspectorGUI::CloseWindow()
271 {
272  // Called when window is closed via the window manager.
273 
274  delete this;
275 }
276 
277 //______________________________________________________________________________
278 void ModelInspectorGUI::DoText(const char * /*text*/)
279 {
280  // Handle text entry widgets.
281 
283  Int_t id = te->WidgetId();
284 
285  switch (id) {
286  case HId1:
287  fHslider1->SetPosition(atof(fTbh1->GetString()),
288  fHslider1->GetMaxPosition());
289  break;
290  case HId2:
291  fHslider1->SetPointerPosition(atof(fTbh2->GetString()));
292  break;
293  case HId3:
294  fHslider1->SetPosition(fHslider1->GetMinPosition(),
295  atof(fTbh1->GetString()));
296  break;
297  default:
298  break;
299  }
300  DoSlider();
301 }
302 
303 //______________________________________________________________________________
305 {
306  fFitRes = fMC->GetPdf()->fitTo(*fData,Save());
307  map<TGTripleHSlider*,const char*>::iterator it;;
308  it = fSliderMap.begin();
309  for(; it!=fSliderMap.end(); ++it){
310  RooRealVar* param=fWS->var(it->second);
311  param = (RooRealVar*) fFitRes->floatParsFinal().find(it->second);
312  it->first->SetPosition(param->getVal()-param->getError(),param->getVal()+param->getError());
313  it->first->SetPointerPosition(param->getVal());
314  }
315  DoSlider();
316 
317 }
318 
319 //______________________________________________________________________________
320 void ModelInspectorGUI::DoSlider(const char* text)
321 {
322  cout << "." << text <<endl;
323 }
324 
325 //______________________________________________________________________________
326 void ModelInspectorGUI::DoSlider()
327 {
328  // Handle slider widgets.
329 
330  //char buf[32];
331 
332  RooSimultaneous* simPdf = NULL;
333  Int_t numCats = 0;
334  if(strcmp(fMC->GetPdf()->ClassName(),"RooSimultaneous")==0){
335  simPdf = (RooSimultaneous*)(fMC->GetPdf());
336  RooCategory* channelCat = (RooCategory*) (&simPdf->indexCat());
337  numCats = channelCat->numTypes();
338  } else {
339  }
340 
341 
342  /////////////////////////////////////////////
343  if(!simPdf){
344  /////////////////////////////////////////////
345  // if not SimPdf
346  /////////////////////////////////////////////
347 
348  // pre loop
349  map<TGTripleHSlider*,const char*>::iterator it;;
350  delete fPlot;
351  fPlot = ((RooRealVar*)fMC->GetObservables()->first())->frame();
352  fData->plotOn(fPlot);
353  double normCount;
354 
355  // high loop
356  it = fSliderMap.begin();
357  for(; it!=fSliderMap.end(); ++it){
358  const char* name = it->second;
359  fWS->var(name)->setVal(it->first->GetMaxPosition());
360  RooRealVar* param = fWS->var(name);
361  fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]",param->GetName(),it->first->GetPointerPosition(),it->first->GetMinPosition(),it->first->GetMaxPosition()));
362  }
363  normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
364  fMC->GetPdf()->plotOn(fPlot,LineColor(kRed),Normalization(normCount,RooAbsReal::NumEvent));
365 
366  // low loop
367  it = fSliderMap.begin();
368  for(; it!=fSliderMap.end(); ++it){
369  const char* name = it->second;
370  fWS->var(name)->setVal(it->first->GetMinPosition());
371  }
372  normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
373  fMC->GetPdf()->plotOn(fPlot,LineColor(kGreen),Normalization(normCount,RooAbsReal::NumEvent));
374 
375  // central oop
376  it = fSliderMap.begin();
377  for(; it!=fSliderMap.end(); ++it){
378  const char* name = it->second;
379  fWS->var(name)->setVal(it->first->GetPointerPosition());
380  }
381  normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
382  fMC->GetPdf()->plotOn(fPlot,LineColor(kBlue),Normalization(normCount,RooAbsReal::NumEvent));
383  fPlot->Draw();
384 
385  fCanvas->GetCanvas()->Modified();
386  fCanvas->GetCanvas()->Update();
387  ////////////////////////////////////////////////////////////////////////////
388  } else {
389  ////////////////////////////////////////////////////////////////////////////
390  // else (is simpdf)
391  ////////////////////////////////////////////////////////////////////////////
392  RooCategory* channelCat = (RooCategory*) (&simPdf->indexCat());
393  // TIterator* iter = simPdf->indexCat().typeIterator() ;
394  TIterator* iter = channelCat->typeIterator() ;
395  RooCatType* tt = NULL;
396  Int_t frameIndex = 0;
397  while((tt=(RooCatType*) iter->Next())) {
398  ++frameIndex;
399  fCanvas->GetCanvas()->cd(frameIndex);
400 
401  // pre loop
402  RooAbsPdf* pdftmp = simPdf->getPdf(tt->GetName()) ;
403  RooArgSet* obstmp = pdftmp->getObservables(*fMC->GetObservables()) ;
404  RooRealVar* obs = ((RooRealVar*)obstmp->first());
405 
406  fPlot = fPlotList.at(frameIndex-1);
407  if(fPlot) delete fPlot;
408  fPlot = obs->frame();
409  fPlotList.at(frameIndex-1) = fPlot;
410 
413  fData->plotOn(fPlot,MarkerSize(1),Cut(Form("%s==%s::%s",channelCat->GetName(),channelCat->GetName(),tt->GetName())),DataError(RooAbsData::None));
415 
416 
417  map<TGTripleHSlider*,const char*>::iterator it;;
418  double normCount;
419 
420  // high loop
421  it = fSliderMap.begin();
422  for(; it!=fSliderMap.end(); ++it){
423  const char* name = it->second;
424  fWS->var(name)->setVal(it->first->GetMaxPosition());
425  RooRealVar* param = fWS->var(name);
426  fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]",param->GetName(),it->first->GetPointerPosition(),it->first->GetMinPosition(),it->first->GetMaxPosition()));
427  }
428  normCount = pdftmp->expectedEvents(*obs);
429  pdftmp->plotOn(fPlot,LineColor(kRed),LineWidth(2.),Normalization(normCount,RooAbsReal::NumEvent)) ;
430 
431 
432  // low loop
433  it = fSliderMap.begin();
434  for(; it!=fSliderMap.end(); ++it){
435  const char* name = it->second;
436  fWS->var(name)->setVal(it->first->GetMinPosition());
437  RooRealVar* param = fWS->var(name);
438  fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]",param->GetName(),it->first->GetPointerPosition(),it->first->GetMinPosition(),it->first->GetMaxPosition()));
439  }
440  normCount = pdftmp->expectedEvents(*obs);
441  pdftmp->plotOn(fPlot,LineColor(kGreen),LineWidth(2.),Normalization(normCount,RooAbsReal::NumEvent)) ;
442 
443  // central loop
444  it = fSliderMap.begin();
445  for(; it!=fSliderMap.end(); ++it){
446  const char* name = it->second;
447  fWS->var(name)->setVal(it->first->GetPointerPosition());
448  RooRealVar* param = fWS->var(name);
449  fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]",param->GetName(),it->first->GetPointerPosition(),it->first->GetMinPosition(),it->first->GetMaxPosition()));
450  }
451  normCount = pdftmp->expectedEvents(*obs);
452  if(!fFitRes)
453  pdftmp->plotOn(fPlot,LineColor(kBlue),LineWidth(2.),Normalization(normCount,RooAbsReal::NumEvent)) ;
454  else{
455  pdftmp->plotOn(fPlot,Normalization(normCount,RooAbsReal::NumEvent),VisualizeError(*fFitRes,*fMC->GetNuisanceParameters()),FillColor(kYellow)) ;
456  pdftmp->plotOn(fPlot,LineColor(kBlue),LineWidth(2.),Normalization(normCount,RooAbsReal::NumEvent)) ;
459  fData->plotOn(fPlot,MarkerSize(1),Cut(Form("%s==%s::%s",channelCat->GetName(),channelCat->GetName(),tt->GetName())),DataError(RooAbsData::None));
461  }
462  fPlot->Draw();
463  }
464  fCanvas->GetCanvas()->Modified();
465  fCanvas->GetCanvas()->Update();
466  ///////////////////////////////////////////
467  // end if(simPdf)
468  }
469 
470 
471 }
472 
473 //______________________________________________________________________________
474 void ModelInspectorGUI::HandleButtons()
475 {
476  // Handle different buttons.
477 
478  TGButton *btn = (TGButton *) gTQSender;
479  Int_t id = btn->WidgetId();
480 
481  switch (id) {
482  case HCId1:
483  fHslider1->SetConstrained(fCheck1->GetState());
484  break;
485  case HCId2:
486  fHslider1->SetRelative(fCheck2->GetState());
487  break;
488  default:
489  break;
490  }
491 }
492 void ModelInspectorGUI::DoExit()
493 {
494  printf("Exit application...");
496 }
497 
498 
499 void ModelInspector(const char* infile = "",
500  const char* workspaceName = "combined",
501  const char* modelConfigName = "ModelConfig",
502  const char* dataName = "obsData"){
503 
504 #ifdef __CINT__
505  cout <<"You must use ACLIC for this. Use ModelInspector.C+"<<endl;
506  return;
507 #endif
508 
509  /////////////////////////////////////////////////////////////
510  // First part is just to access a user-defined file
511  // or create the standard example file if it doesn't exist
512  ////////////////////////////////////////////////////////////
513 
514  const char* filename = "";
515  if (!strcmp(infile,"")) {
516  filename = "results/example_combined_GaussExample_model.root";
517  bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code
518  // if file does not exists generate with histfactory
519  if (!fileExist) {
520 #ifdef _WIN32
521  cout << "HistFactory file cannot be generated on Windows - exit" << endl;
522  return;
523 #endif
524  // Normally this would be run on the command line
525  cout <<"will run standard hist2workspace example"<<endl;
526  gROOT->ProcessLine(".! prepareHistFactory .");
527  gROOT->ProcessLine(".! hist2workspace config/example.xml");
528  cout <<"\n\n---------------------"<<endl;
529  cout <<"Done creating example input"<<endl;
530  cout <<"---------------------\n\n"<<endl;
531  }
532 
533  }
534  else
535  filename = infile;
536 
537  // Try to open the file
538  TFile *file = TFile::Open(filename);
539 
540  // if input file was specified byt not found, quit
541  if(!file ){
542  cout <<"StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
543  return;
544  }
545 
546 
547 
548  /////////////////////////////////////////////////////////////
549  // Tutorial starts here
550  ////////////////////////////////////////////////////////////
551 
552  // get the workspace out of the file
553  RooWorkspace* w = (RooWorkspace*) file->Get(workspaceName);
554  if(!w){
555  cout <<"workspace not found" << endl;
556  return;
557  }
558 
559  // get the modelConfig out of the file
560  ModelConfig* mc = (ModelConfig*) w->obj(modelConfigName);
561 
562  // get the modelConfig out of the file
563  RooAbsData* data = w->data(dataName);
564 
565  // make sure ingredients are found
566  if(!data || !mc){
567  w->Print();
568  cout << "data or ModelConfig was not found" <<endl;
569  return;
570  }
571 
572  new ModelInspectorGUI(w,mc,data);
573 }
574 
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1213
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:52
RooCmdArg Cut(const char *cutSpec)
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...
RooCmdArg VisualizeError(const RooDataSet &paramData, Double_t Z=1)
Definition: Rtypes.h:61
R__EXTERN void * gTQSender
Definition: TQObject.h:49
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Definition: RooAbsArg.h:194
const RooAbsCategoryLValue & indexCat() const
void DoFit(THnSparse *s, TF1 *f, ROOT::Fit::BinData &bd)
Definition: SparseFit4.cxx:162
static const char * filename()
#define gROOT
Definition: TROOT.h:344
#define gClient
Definition: TGClient.h:174
virtual Double_t getMin(const char *name=0) const
int Int_t
Definition: RtypesCore.h:41
StreamConfig & getStream(Int_t id)
const Bool_t kFALSE
Definition: Rtypes.h:92
void removeTopic(RooFit::MsgTopic oldTopic)
Definition: Rtypes.h:61
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
Definition: Rtypes.h:61
static RooMsgService & instance()
Return reference to singleton instance.
virtual void SetRange(Float_t min, Float_t max)
R__EXTERN TApplication * gApplication
Definition: TApplication.h:171
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.
Definition: RooAbsPdf.cxx:2930
Iterator abstract base class.
Definition: TIterator.h:32
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3851
RooAbsArg * first() const
ETestCommandIdentifiers
Definition: guitest.h:37
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooCmdArg MarkerSize(Size_t size)
RooCmdArg DataError(Int_t)
virtual void SetPointerPosition(Float_t pos)
Set pointer position in scaled (real) value.
Int_t numTypes(const char *=0) const
TIterator * createIterator(Bool_t dir=kIterForward) const
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:23
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:37
A doubly linked list.
Definition: TList.h:47
tuple infile
Definition: mrt.py:15
RooFit::MsgLevel globalKillBelow() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:1135
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
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.
Definition: RooAbsPdf.h:105
void ModelInspector(const char *infile="", const char *workspaceName="combined", const char *modelConfigName="ModelConfig", const char *dataName="obsData")
char * Form(const char *fmt,...)
tuple w
Definition: qtexample.py:51
void setGlobalKillBelow(RooFit::MsgLevel level)
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
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
RooCategory represents a fundamental (non-derived) discrete value object.
Definition: RooCategory.h:25
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
Definition: RooPlot.h:41
Int_t WidgetId() const
Definition: TGWidget.h:86
RooCmdArg FillColor(Color_t color)
tuple file
Definition: fildir.py:20
TText * text
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
RooCmdArg Normalization(Double_t scaleFactor)
RooCmdArg LineWidth(Width_t width)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
virtual Double_t getMax(const char *name=0) const
RooCmdArg Save(Bool_t flag=kTRUE)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual TObject * Next()=0
virtual void SetPosition(Float_t min, Float_t max)
#define NULL
Definition: Rtypes.h:82
Definition: Rtypes.h:61
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
virtual const Text_t * GetName() const
Returns name of object.
Definition: RooCatType.h:45
TIterator * typeIterator() const
Return iterator over all defined states.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
Definition: RooArgSet.cxx:448
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:42
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
Definition: RooPlot.cxx:559
Double_t getError() const
Definition: RooRealVar.h:54