Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ModelInspector.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_roostats
3/// RooStats Model Inspector
4///
5/// Usage:
6/// The usage is the same as the StandardXxxDemo.C macros.
7/// The macro expects a root file containing a workspace with a ModelConfig and a dataset
8///
9/// ~~~{.cpp}
10/// $ root
11/// .L ModelInspector.C+
12/// ModelInspector(fileName, workspaceName, modelConfigName, dataSetName);
13/// ~~~
14///
15/// Drag the sliders to adjust the parameters of the model.
16/// the min and max range of the sliders are used to define the upper & lower variation
17/// the pointer position of the slider is the central blue curve.
18///
19/// Click the FIT button to
20///
21/// To Do:
22/// - check boxes to specify which nuisance parameters used in making variation
23/// - a button to make the profile inspector plots
24/// - a check button to use MINOS errors
25/// - have fit button show the covariance matrix from the fit
26/// - a button to make the log likelihood plots
27/// - a dialog to open the desired file
28/// - ability to see the signal and background contributions?
29///
30/// \macro_code
31///
32/// - Version 1, October 2011
33/// - based on tutorial macro by Bertrand Bellenot, Ilka Antcheva
34/// - Version 2, November 2011
35/// - fixes from Bertrand Bellenot for scrolling window for many parameters
36///
37/// \author Kyle Cranmer
38
39#include "TGButton.h"
40#include "TRootEmbeddedCanvas.h"
41#include "TGLayout.h"
42#include "TF1.h"
43#include "TMath.h"
44#include "TSystem.h"
45#include "TCanvas.h"
46#include "TGTextEntry.h"
47#include "TGLabel.h"
48#include "TGTripleSlider.h"
49#include "RooWorkspace.h"
51#include "TFile.h"
52#include "RooArgSet.h"
53#include "TList.h"
54#include "RooAbsPdf.h"
55#include "RooRealVar.h"
56#include "RooPlot.h"
57#include "TGButton.h"
58#include <map>
59#include "RooFitResult.h"
60#include "TROOT.h"
61#include <TApplication.h>
62#include "RooSimultaneous.h"
63#include "RooCategory.h"
64
65enum ETestCommandIdentifiers {
66 HId1,
67 HId2,
68 HId3,
69 HCId1,
70 HCId2,
71
72 HSId1
73};
74
75using namespace std;
76using namespace RooFit;
77using namespace RooStats;
78
79class ModelInspectorGUI : public TGMainFrame {
80
81private:
82 TRootEmbeddedCanvas *fCanvas;
83 TGLayoutHints *fLcan;
84 TF1 *fFitFcn;
85 RooPlot *fPlot;
86 RooWorkspace *fWS;
87 TFile *fFile;
88 ModelConfig *fMC;
89 RooAbsData *fData;
90 RooFitResult *fFitRes;
91
92 TList fSliderList;
93 TList fFrameList;
94 vector<RooPlot *> fPlotList;
95 map<TGTripleHSlider *, const char *> fSliderMap;
96 map<TGTripleHSlider *, TGLabel *> fLabelMap;
97
98 TGButton *fFitButton;
99 TGTextButton *fExitButton;
100
101 // BB: a TGCanvas and a vertical frame are needed for using scrollbars
102 TGCanvas *fCan;
103 TGVerticalFrame *fVFrame;
104
105 TGHorizontalFrame *fHframe0, *fHframe1, *fHframe2;
106 TGLayoutHints *fBly, *fBfly1, *fBfly2, *fBfly3;
107 TGTripleHSlider *fHslider1;
108 TGTextBuffer *fTbh1, *fTbh2, *fTbh3;
109 TGCheckButton *fCheck1, *fCheck2;
110
111public:
112 ModelInspectorGUI(RooWorkspace *, ModelConfig *, RooAbsData *);
113 ~ModelInspectorGUI() override;
114
115 void CloseWindow() override;
116 void DoText(const char *text);
117 void DoSlider();
118 void DoSlider(const char *);
119 void DoFit();
120 void DoExit();
121 void HandleButtons();
122};
123
124
125//______________________________________________________________________________
126ModelInspectorGUI::ModelInspectorGUI(RooWorkspace *w, ModelConfig *mc, RooAbsData *data)
127 : TGMainFrame(gClient->GetRoot(), 100, 100)
128{
129
131 fWS = w;
132 fMC = mc;
133 fData = data;
134 RooSimultaneous *simPdf = nullptr;
135 Int_t numCats = 1;
136 if (strcmp(fMC->GetPdf()->ClassName(), "RooSimultaneous") == 0) {
137 cout << "Is a simultaneous PDF" << endl;
138 simPdf = (RooSimultaneous *)(fMC->GetPdf());
139 RooCategory *channelCat = (RooCategory *)(&simPdf->indexCat());
140 cout << " with " << channelCat->numTypes() << " categories" << endl;
141 numCats = channelCat->numTypes();
142 } else {
143 cout << "Is not a simultaneous PDF" << endl;
144 }
145 fFitRes = nullptr;
146
147 SetCleanup(kDeepCleanup);
148
149 // Create an embedded canvas and add to the main frame, centered in x and y
150 // and with 30 pixel margins all around
151 fCanvas = new TRootEmbeddedCanvas("Canvas", this, 600, 400);
152 fLcan = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 10);
153 AddFrame(fCanvas, fLcan);
154 fPlotList.resize(numCats);
155 if (numCats > 1) {
156 fCanvas->GetCanvas()->Divide(numCats);
157 for (int i = 0; i < numCats; ++i) {
158 fCanvas->GetCanvas()->cd(i + 1)->SetBorderMode(0);
159 fCanvas->GetCanvas()->cd(i + 1)->SetGrid();
160 }
161 }
162
163 fHframe0 = new TGHorizontalFrame(this, 0, 0, 0);
164
165 fCheck1 = new TGCheckButton(fHframe0, "&Constrained", HCId1);
166 fCheck2 = new TGCheckButton(fHframe0, "&Relative", HCId2);
167 fCheck1->SetState(kButtonUp);
168 fCheck2->SetState(kButtonUp);
169 fCheck1->SetToolTipText("Pointer position constrained to slider sides");
170 fCheck2->SetToolTipText("Pointer position relative to slider position");
171
172 fHframe0->Resize(200, 50);
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 fCheck1->Connect("Clicked()", "ModelInspectorGUI", this, "HandleButtons()");
182 fCheck2->Connect("Clicked()", "ModelInspectorGUI", this, "HandleButtons()");
183
184 fHframe2->Resize(100, 25);
185
186 //--- layout for buttons: top align, equally expand horizontally
187 fBly = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5);
188
189 //--- layout for the frame: place at bottom, right aligned
190 fBfly1 = new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 5, 5);
191 fBfly2 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
192 fBfly3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 5, 5, 5, 5);
193
194 fHframe2->AddFrame(fFitButton, fBfly2);
195 fHframe2->AddFrame(fExitButton, fBfly3);
196
197 AddFrame(fHframe0, fBly);
198 AddFrame(fHframe2, fBly);
199
200 // Loop over POI & NP, create slider
201 // need maps of NP->slider? or just slider->NP
202 RooArgSet parameters;
203 parameters.add(*fMC->GetParametersOfInterest());
204 parameters.add(*fMC->GetNuisanceParameters());
205 TIter it = parameters.createIterator();
206 RooRealVar *param = nullptr;
207
208 // BB: This is the part needed in order to have scrollbars
209 fCan = new TGCanvas(this, 100, 100, kFixedSize);
210 AddFrame(fCan, new TGLayoutHints(kLHintsExpandY | kLHintsExpandX));
211 fVFrame = new TGVerticalFrame(fCan->GetViewPort(), 10, 10);
212 fCan->SetContainer(fVFrame);
213 // And that't it!
214 // Obviously, the parent of other subframes is now fVFrame instead of "this"...
215
216 while ((param = (RooRealVar *)it.Next())) {
217 cout << "Adding Slider for " << param->GetName() << endl;
218 TGHorizontalFrame *hframek = new TGHorizontalFrame(fVFrame, 0, 0, 0);
219
220 TGLabel *hlabel =
221 new TGLabel(hframek, Form("%s = %.3f +%.3f", param->GetName(), param->getVal(), param->getError()));
222 TGTripleHSlider *hsliderk = new TGTripleHSlider(hframek, 190, kDoubleScaleBoth, HSId1, kHorizontalFrame,
223 GetDefaultFrameBackground(), kFALSE, kFALSE, kFALSE, kFALSE);
224 hsliderk->Connect("PointerPositionChanged()", "ModelInspectorGUI", this, "DoSlider()");
225 hsliderk->Connect("PositionChanged()", "ModelInspectorGUI", this, "DoSlider()");
226 hsliderk->SetRange(param->getMin(), param->getMax());
227
228 hframek->Resize(200, 25);
229 fSliderList.Add(hsliderk);
230 fFrameList.Add(hframek);
231
232 hsliderk->SetPosition(param->getVal() - param->getError(), param->getVal() + param->getError());
233 hsliderk->SetPointerPosition(param->getVal());
234
235 hframek->AddFrame(hlabel, fBly);
236 hframek->AddFrame(hsliderk, fBly);
237 fVFrame->AddFrame(hframek, fBly);
238 fSliderMap[hsliderk] = param->GetName();
239 fLabelMap[hsliderk] = hlabel;
240 }
241
242 // Set main frame name, map sub windows (buttons), initialize layout
243 // algorithm via Resize() and map main frame
244 SetWindowName("RooFit/RooStats Model Inspector");
246 Resize(GetDefaultSize());
247 MapWindow();
248
249 DoSlider();
250}
251
252//______________________________________________________________________________
253ModelInspectorGUI::~ModelInspectorGUI()
254{
255 // Clean up
256
257 Cleanup();
258}
259
260//______________________________________________________________________________
261void ModelInspectorGUI::CloseWindow()
262{
263 // Called when window is closed via the window manager.
264
265 delete this;
266}
267
268//______________________________________________________________________________
269void ModelInspectorGUI::DoText(const char * /*text*/)
270{
271 // Handle text entry widgets.
272
274 Int_t id = te->WidgetId();
275
276 switch (id) {
277 case HId1: fHslider1->SetPosition(atof(fTbh1->GetString()), static_cast<double>(fHslider1->GetMaxPosition())); break;
278 case HId2: fHslider1->SetPointerPosition(atof(fTbh2->GetString())); break;
279 case HId3: fHslider1->SetPosition(static_cast<double>(fHslider1->GetMinPosition()), atof(fTbh1->GetString())); break;
280 default: break;
281 }
282 DoSlider();
283}
284
285//______________________________________________________________________________
286void ModelInspectorGUI::DoFit()
287{
288 fFitRes = fMC->GetPdf()->fitTo(*fData, Save());
289 map<TGTripleHSlider *, const char *>::iterator it;
290 ;
291 it = fSliderMap.begin();
292 for (; it != fSliderMap.end(); ++it) {
293 RooRealVar *param = fWS->var(it->second);
294 param = (RooRealVar *)fFitRes->floatParsFinal().find(it->second);
295 it->first->SetPosition(param->getVal() - param->getError(), param->getVal() + param->getError());
296 it->first->SetPointerPosition(param->getVal());
297 }
298 DoSlider();
299}
300
301//______________________________________________________________________________
302void ModelInspectorGUI::DoSlider(const char *text)
303{
304 cout << "." << text << endl;
305}
306
307//______________________________________________________________________________
308void ModelInspectorGUI::DoSlider()
309{
310 // Handle slider widgets.
311
312 // char buf[32];
313
314 RooSimultaneous *simPdf = nullptr;
315 Int_t numCats = 0;
316 if (strcmp(fMC->GetPdf()->ClassName(), "RooSimultaneous") == 0) {
317 simPdf = (RooSimultaneous *)(fMC->GetPdf());
318 RooCategory *channelCat = (RooCategory *)(&simPdf->indexCat());
319 numCats = channelCat->numTypes();
320 } else {
321 }
322
323 /////////////////////////////////////////////
324 if (!simPdf) {
325 /////////////////////////////////////////////
326 // if not SimPdf
327 /////////////////////////////////////////////
328
329 // pre loop
330 map<TGTripleHSlider *, const char *>::iterator it;
331 ;
332 delete fPlot;
333 fPlot = ((RooRealVar *)fMC->GetObservables()->first())->frame();
334 fData->plotOn(fPlot);
335 double normCount;
336
337 // high loop
338 it = fSliderMap.begin();
339 for (; it != fSliderMap.end(); ++it) {
340 const char *name = it->second;
341 fWS->var(name)->setVal(it->first->GetMaxPosition());
342 RooRealVar *param = fWS->var(name);
343 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(), it->first->GetPointerPosition(),
344 it->first->GetMinPosition(), it->first->GetMaxPosition()));
345 }
346 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
347 fMC->GetPdf()->plotOn(fPlot, LineColor(kRed), Normalization(normCount, RooAbsReal::NumEvent));
348
349 // low loop
350 it = fSliderMap.begin();
351 for (; it != fSliderMap.end(); ++it) {
352 const char *name = it->second;
353 fWS->var(name)->setVal(it->first->GetMinPosition());
354 }
355 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
356 fMC->GetPdf()->plotOn(fPlot, LineColor(kGreen), Normalization(normCount, RooAbsReal::NumEvent));
357
358 // central oop
359 it = fSliderMap.begin();
360 for (; it != fSliderMap.end(); ++it) {
361 const char *name = it->second;
362 fWS->var(name)->setVal(it->first->GetPointerPosition());
363 }
364 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
365 fMC->GetPdf()->plotOn(fPlot, LineColor(kBlue), Normalization(normCount, RooAbsReal::NumEvent));
366 fPlot->Draw();
367
368 fCanvas->GetCanvas()->Modified();
369 fCanvas->GetCanvas()->Update();
370 ////////////////////////////////////////////////////////////////////////////
371 } else {
372 ////////////////////////////////////////////////////////////////////////////
373 // else (is simpdf)
374 ////////////////////////////////////////////////////////////////////////////
375 RooCategory *channelCat = (RooCategory *)(&simPdf->indexCat());
376 // TIterator* iter = simPdf->indexCat().typeIterator() ;
377 Int_t frameIndex = 0;
378 for (auto const& tt : *channelCat) {
379 auto const& catName = tt.first;
380
381 ++frameIndex;
382 fCanvas->GetCanvas()->cd(frameIndex);
383
384 // pre loop
385 RooAbsPdf *pdftmp = simPdf->getPdf(catName.c_str());
386 RooArgSet *obstmp = pdftmp->getObservables(*fMC->GetObservables());
387 RooRealVar *obs = ((RooRealVar *)obstmp->first());
388
389 fPlot = fPlotList.at(frameIndex - 1);
390 if (fPlot)
391 delete fPlot;
392 fPlot = obs->frame();
393 fPlotList.at(frameIndex - 1) = fPlot;
394
397 fData->plotOn(fPlot, MarkerSize(1),
398 Cut(Form("%s==%s::%s", channelCat->GetName(), channelCat->GetName(), catName.c_str())),
401
402 map<TGTripleHSlider *, const char *>::iterator it;
403 ;
404 double normCount;
405
406 // high loop
407 it = fSliderMap.begin();
408 for (; it != fSliderMap.end(); ++it) {
409 const char *name = it->second;
410 fWS->var(name)->setVal(it->first->GetMaxPosition());
411 RooRealVar *param = fWS->var(name);
412 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
413 it->first->GetPointerPosition(), it->first->GetMinPosition(),
414 it->first->GetMaxPosition()));
415 }
416 normCount = pdftmp->expectedEvents(*obs);
417 pdftmp->plotOn(fPlot, LineColor(kRed), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
418
419 // low loop
420 it = fSliderMap.begin();
421 for (; it != fSliderMap.end(); ++it) {
422 const char *name = it->second;
423 fWS->var(name)->setVal(it->first->GetMinPosition());
424 RooRealVar *param = fWS->var(name);
425 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
426 it->first->GetPointerPosition(), it->first->GetMinPosition(),
427 it->first->GetMaxPosition()));
428 }
429 normCount = pdftmp->expectedEvents(*obs);
430 pdftmp->plotOn(fPlot, LineColor(kGreen), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
431
432 // central loop
433 it = fSliderMap.begin();
434 for (; it != fSliderMap.end(); ++it) {
435 const char *name = it->second;
436 fWS->var(name)->setVal(it->first->GetPointerPosition());
437 RooRealVar *param = fWS->var(name);
438 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
439 it->first->GetPointerPosition(), it->first->GetMinPosition(),
440 it->first->GetMaxPosition()));
441 }
442 normCount = pdftmp->expectedEvents(*obs);
443 if (!fFitRes)
444 pdftmp->plotOn(fPlot, LineColor(kBlue), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
445 else {
446 pdftmp->plotOn(fPlot, Normalization(normCount, RooAbsReal::NumEvent),
447 VisualizeError(*fFitRes, *fMC->GetNuisanceParameters()), FillColor(kYellow));
448 pdftmp->plotOn(fPlot, LineColor(kBlue), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
451 fData->plotOn(fPlot, MarkerSize(1),
452 Cut(Form("%s==%s::%s", channelCat->GetName(), channelCat->GetName(), catName.c_str())),
455 }
456 fPlot->Draw();
457 }
458 fCanvas->GetCanvas()->Modified();
459 fCanvas->GetCanvas()->Update();
460 ///////////////////////////////////////////
461 // end if(simPdf)
462 }
463}
464
465//______________________________________________________________________________
466void ModelInspectorGUI::HandleButtons()
467{
468 // Handle different buttons.
469
470 TGButton *btn = (TGButton *)gTQSender;
471 Int_t id = btn->WidgetId();
472
473 switch (id) {
474 case HCId1: fHslider1->SetConstrained(fCheck1->GetState()); break;
475 case HCId2: fHslider1->SetRelative(fCheck2->GetState()); break;
476 default: break;
477 }
478}
479void ModelInspectorGUI::DoExit()
480{
481 printf("Exit application...");
483}
484
485void ModelInspector(const char *infile = "", const char *workspaceName = "combined",
486 const char *modelConfigName = "ModelConfig", const char *dataName = "obsData")
487{
488 // -------------------------------------------------------
489 // First part is just to access a user-defined file
490 // or create the standard example file if it doesn't exist
491
492 const char *filename = "";
493 if (!strcmp(infile, "")) {
494 filename = "results/example_combined_GaussExample_model.root";
495 bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code
496 // if file does not exists generate with histfactory
497 if (!fileExist) {
498 // Normally this would be run on the command line
499 cout << "will run standard hist2workspace example" << endl;
500 gROOT->ProcessLine(".! prepareHistFactory .");
501 gROOT->ProcessLine(".! hist2workspace config/example.xml");
502 cout << "\n\n---------------------" << endl;
503 cout << "Done creating example input" << endl;
504 cout << "---------------------\n\n" << endl;
505 }
506
507 } else
508 filename = infile;
509
510 // Try to open the file
512
513 // if input file was specified byt not found, quit
514 if (!file) {
515 cout << "StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
516 return;
517 }
518
519 // -------------------------------------------------------
520 // Tutorial starts here
521 // -------------------------------------------------------
522
523 // get the workspace out of the file
524 RooWorkspace *w = (RooWorkspace *)file->Get(workspaceName);
525 if (!w) {
526 cout << "workspace not found" << endl;
527 return;
528 }
529
530 // get the modelConfig out of the file
531 ModelConfig *mc = (ModelConfig *)w->obj(modelConfigName);
532
533 // get the modelConfig out of the file
534 RooAbsData *data = w->data(dataName);
535
536 // make sure ingredients are found
537 if (!data || !mc) {
538 w->Print();
539 cout << "data or ModelConfig was not found" << endl;
540 return;
541 }
542
543 new ModelInspectorGUI(w, mc, data);
544}
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
@ kRed
Definition Rtypes.h:66
@ kGreen
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
@ kYellow
Definition Rtypes.h:66
R__EXTERN TApplication * gApplication
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kDoubleScaleBoth
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition TGX11.cxx:110
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:407
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
Int_t numTypes(const char *=nullptr) const
Return number of types defined (in range named rangeName if rangeName!=nullptr)
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
RooAbsArg * first() const
TIterator * createIterator(bool dir=kIterForward) const
TIterator-style iteration over contained elements.
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
virtual double expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={}, const RooCmdArg &arg10={}) const override
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
Definition RooAbsPdf.h:123
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:103
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Object to represent discrete states.
Definition RooCategory.h:28
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
static RooMsgService & instance()
Return reference to singleton instance.
StreamConfig & getStream(Int_t id)
void setGlobalKillBelow(RooFit::MsgLevel level)
RooFit::MsgLevel globalKillBelow() const
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:37
double getError() const
Definition RooRealVar.h:58
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
RooAbsPdf * getPdf(RooStringView catName) const
Return the p.d.f associated with the given index category name.
const RooAbsCategoryLValue & indexCat() const
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition ModelConfig.h:35
Persistable container for RooFit projects.
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
1-Dim function class
Definition TF1.h:214
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
Definition TFile.h:53
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition TFile.cxx:4075
A button abstract base class.
Definition TGButton.h:68
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
Selects different options.
Definition TGButton.h:264
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1770
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
Int_t WidgetId() const
Definition TGWidget.h:68
TObject * Next()
A doubly linked list.
Definition TList.h:38
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
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:869
This class creates a TGCanvas in which a TCanvas is created.
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:1283
RooCmdArg Save(bool flag=true)
RooCmdArg DataError(Int_t)
RooCmdArg FillColor(Color_t color)
RooCmdArg LineWidth(Width_t width)
RooCmdArg Normalization(double scaleFactor)
RooCmdArg VisualizeError(const RooDataSet &paramData, double Z=1)
RooCmdArg MarkerSize(Size_t size)
RooCmdArg Cut(const char *cutSpec)
RooCmdArg LineColor(Color_t color)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition JSONIO.h:26
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
@ NumIntegration
Namespace for the RooStats classes.
Definition Asimov.h:19
Definition file.py:1
void removeTopic(RooFit::MsgTopic oldTopic)
auto * tt
Definition textangle.C:16