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 std::map, std::vector, std::cout, std::endl;
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
206 // BB: This is the part needed in order to have scrollbars
207 fCan = new TGCanvas(this, 100, 100, kFixedSize);
208 AddFrame(fCan, new TGLayoutHints(kLHintsExpandY | kLHintsExpandX));
209 fVFrame = new TGVerticalFrame(fCan->GetViewPort(), 10, 10);
210 fCan->SetContainer(fVFrame);
211 // And that't it!
212 // Obviously, the parent of other subframes is now fVFrame instead of "this"...
213
214 for (auto *param : static_range_cast<RooRealVar *>(parameters)) {
215 cout << "Adding Slider for " << param->GetName() << endl;
216 TGHorizontalFrame *hframek = new TGHorizontalFrame(fVFrame, 0, 0, 0);
217
218 TGLabel *hlabel =
219 new TGLabel(hframek, Form("%s = %.3f +%.3f", param->GetName(), param->getVal(), param->getError()));
220 TGTripleHSlider *hsliderk = new TGTripleHSlider(hframek, 190, kDoubleScaleBoth, HSId1, kHorizontalFrame,
221 GetDefaultFrameBackground(), kFALSE, kFALSE, kFALSE, kFALSE);
222 hsliderk->Connect("PointerPositionChanged()", "ModelInspectorGUI", this, "DoSlider()");
223 hsliderk->Connect("PositionChanged()", "ModelInspectorGUI", this, "DoSlider()");
224 hsliderk->SetRange(param->getMin(), param->getMax());
225
226 hframek->Resize(200, 25);
227 fSliderList.Add(hsliderk);
228 fFrameList.Add(hframek);
229
230 hsliderk->SetPosition(param->getVal() - param->getError(), param->getVal() + param->getError());
231 hsliderk->SetPointerPosition(param->getVal());
232
233 hframek->AddFrame(hlabel, fBly);
234 hframek->AddFrame(hsliderk, fBly);
235 fVFrame->AddFrame(hframek, fBly);
236 fSliderMap[hsliderk] = param->GetName();
237 fLabelMap[hsliderk] = hlabel;
238 }
239
240 // Set main frame name, map sub windows (buttons), initialize layout
241 // algorithm via Resize() and map main frame
242 SetWindowName("RooFit/RooStats Model Inspector");
244 Resize(GetDefaultSize());
245 MapWindow();
246
247 DoSlider();
248}
249
250//______________________________________________________________________________
251ModelInspectorGUI::~ModelInspectorGUI()
252{
253 // Clean up
254
255 Cleanup();
256}
257
258//______________________________________________________________________________
259void ModelInspectorGUI::CloseWindow()
260{
261 // Called when window is closed via the window manager.
262
263 delete this;
264}
265
266//______________________________________________________________________________
267void ModelInspectorGUI::DoText(const char * /*text*/)
268{
269 // Handle text entry widgets.
270
272 Int_t id = te->WidgetId();
273
274 switch (id) {
275 case HId1: fHslider1->SetPosition(atof(fTbh1->GetString()), static_cast<double>(fHslider1->GetMaxPosition())); break;
276 case HId2: fHslider1->SetPointerPosition(atof(fTbh2->GetString())); break;
277 case HId3: fHslider1->SetPosition(static_cast<double>(fHslider1->GetMinPosition()), atof(fTbh1->GetString())); break;
278 default: break;
279 }
280 DoSlider();
281}
282
283//______________________________________________________________________________
284void ModelInspectorGUI::DoFit()
285{
286 fFitRes = fMC->GetPdf()->fitTo(*fData, Save());
287 map<TGTripleHSlider *, const char *>::iterator it;
288 ;
289 it = fSliderMap.begin();
290 for (; it != fSliderMap.end(); ++it) {
291 RooRealVar *param = fWS->var(it->second);
292 param = (RooRealVar *)fFitRes->floatParsFinal().find(it->second);
293 it->first->SetPosition(param->getVal() - param->getError(), param->getVal() + param->getError());
294 it->first->SetPointerPosition(param->getVal());
295 }
296 DoSlider();
297}
298
299//______________________________________________________________________________
300void ModelInspectorGUI::DoSlider(const char *text)
301{
302 cout << "." << text << endl;
303}
304
305//______________________________________________________________________________
306void ModelInspectorGUI::DoSlider()
307{
308 // Handle slider widgets.
309
310 // char buf[32];
311
312 RooSimultaneous *simPdf = nullptr;
313 Int_t numCats = 0;
314 if (strcmp(fMC->GetPdf()->ClassName(), "RooSimultaneous") == 0) {
315 simPdf = (RooSimultaneous *)(fMC->GetPdf());
316 RooCategory *channelCat = (RooCategory *)(&simPdf->indexCat());
317 numCats = channelCat->numTypes();
318 } else {
319 }
320
321 /////////////////////////////////////////////
322 if (!simPdf) {
323 /////////////////////////////////////////////
324 // if not SimPdf
325 /////////////////////////////////////////////
326
327 // pre loop
328 map<TGTripleHSlider *, const char *>::iterator it;
329 ;
330 delete fPlot;
331 fPlot = ((RooRealVar *)fMC->GetObservables()->first())->frame();
332 fData->plotOn(fPlot);
333 double normCount;
334
335 // high loop
336 it = fSliderMap.begin();
337 for (; it != fSliderMap.end(); ++it) {
338 const char *name = it->second;
339 fWS->var(name)->setVal(it->first->GetMaxPosition());
340 RooRealVar *param = fWS->var(name);
341 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(), it->first->GetPointerPosition(),
342 it->first->GetMinPosition(), it->first->GetMaxPosition()));
343 }
344 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
345 fMC->GetPdf()->plotOn(fPlot, LineColor(kRed), Normalization(normCount, RooAbsReal::NumEvent));
346
347 // low loop
348 it = fSliderMap.begin();
349 for (; it != fSliderMap.end(); ++it) {
350 const char *name = it->second;
351 fWS->var(name)->setVal(it->first->GetMinPosition());
352 }
353 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
354 fMC->GetPdf()->plotOn(fPlot, LineColor(kGreen), Normalization(normCount, RooAbsReal::NumEvent));
355
356 // central oop
357 it = fSliderMap.begin();
358 for (; it != fSliderMap.end(); ++it) {
359 const char *name = it->second;
360 fWS->var(name)->setVal(it->first->GetPointerPosition());
361 }
362 normCount = fMC->GetPdf()->expectedEvents(*fMC->GetObservables());
363 fMC->GetPdf()->plotOn(fPlot, LineColor(kBlue), Normalization(normCount, RooAbsReal::NumEvent));
364 fPlot->Draw();
365
366 fCanvas->GetCanvas()->Modified();
367 fCanvas->GetCanvas()->Update();
368 ////////////////////////////////////////////////////////////////////////////
369 } else {
370 ////////////////////////////////////////////////////////////////////////////
371 // else (is simpdf)
372 ////////////////////////////////////////////////////////////////////////////
373 RooCategory *channelCat = (RooCategory *)(&simPdf->indexCat());
374 // TIterator* iter = simPdf->indexCat().typeIterator() ;
375 Int_t frameIndex = 0;
376 for (auto const& tt : *channelCat) {
377 auto const& catName = tt.first;
378
379 ++frameIndex;
380 fCanvas->GetCanvas()->cd(frameIndex);
381
382 // pre loop
383 RooAbsPdf *pdftmp = simPdf->getPdf(catName.c_str());
384 RooArgSet *obstmp = pdftmp->getObservables(*fMC->GetObservables());
385 RooRealVar *obs = ((RooRealVar *)obstmp->first());
386
387 fPlot = fPlotList.at(frameIndex - 1);
388 if (fPlot)
389 delete fPlot;
390 fPlot = obs->frame();
391 fPlotList.at(frameIndex - 1) = fPlot;
392
395 fData->plotOn(fPlot, MarkerSize(1),
396 Cut(Form("%s==%s::%s", channelCat->GetName(), channelCat->GetName(), catName.c_str())),
399
400 map<TGTripleHSlider *, const char *>::iterator it;
401 ;
402 double normCount;
403
404 // high loop
405 it = fSliderMap.begin();
406 for (; it != fSliderMap.end(); ++it) {
407 const char *name = it->second;
408 fWS->var(name)->setVal(it->first->GetMaxPosition());
409 RooRealVar *param = fWS->var(name);
410 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
411 it->first->GetPointerPosition(), it->first->GetMinPosition(),
412 it->first->GetMaxPosition()));
413 }
414 normCount = pdftmp->expectedEvents(*obs);
415 pdftmp->plotOn(fPlot, LineColor(kRed), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
416
417 // low loop
418 it = fSliderMap.begin();
419 for (; it != fSliderMap.end(); ++it) {
420 const char *name = it->second;
421 fWS->var(name)->setVal(it->first->GetMinPosition());
422 RooRealVar *param = fWS->var(name);
423 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
424 it->first->GetPointerPosition(), it->first->GetMinPosition(),
425 it->first->GetMaxPosition()));
426 }
427 normCount = pdftmp->expectedEvents(*obs);
428 pdftmp->plotOn(fPlot, LineColor(kGreen), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
429
430 // central loop
431 it = fSliderMap.begin();
432 for (; it != fSliderMap.end(); ++it) {
433 const char *name = it->second;
434 fWS->var(name)->setVal(it->first->GetPointerPosition());
435 RooRealVar *param = fWS->var(name);
436 fLabelMap[it->first]->SetText(Form("%s = %.3f [%.3f,%.3f]", param->GetName(),
437 it->first->GetPointerPosition(), it->first->GetMinPosition(),
438 it->first->GetMaxPosition()));
439 }
440 normCount = pdftmp->expectedEvents(*obs);
441 if (!fFitRes)
442 pdftmp->plotOn(fPlot, LineColor(kBlue), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
443 else {
444 pdftmp->plotOn(fPlot, Normalization(normCount, RooAbsReal::NumEvent),
445 VisualizeError(*fFitRes, *fMC->GetNuisanceParameters()), FillColor(kYellow));
446 pdftmp->plotOn(fPlot, LineColor(kBlue), LineWidth(2.), Normalization(normCount, RooAbsReal::NumEvent));
449 fData->plotOn(fPlot, MarkerSize(1),
450 Cut(Form("%s==%s::%s", channelCat->GetName(), channelCat->GetName(), catName.c_str())),
453 }
454 fPlot->Draw();
455 }
456 fCanvas->GetCanvas()->Modified();
457 fCanvas->GetCanvas()->Update();
458 ///////////////////////////////////////////
459 // end if(simPdf)
460 }
461}
462
463//______________________________________________________________________________
464void ModelInspectorGUI::HandleButtons()
465{
466 // Handle different buttons.
467
468 TGButton *btn = (TGButton *)gTQSender;
469 Int_t id = btn->WidgetId();
470
471 switch (id) {
472 case HCId1: fHslider1->SetConstrained(fCheck1->GetState()); break;
473 case HCId2: fHslider1->SetRelative(fCheck2->GetState()); break;
474 default: break;
475 }
476}
477void ModelInspectorGUI::DoExit()
478{
479 printf("Exit application...");
481}
482
483void ModelInspector(const char *infile = "", const char *workspaceName = "combined",
484 const char *modelConfigName = "ModelConfig", const char *dataName = "obsData")
485{
486 // -------------------------------------------------------
487 // First part is just to access a user-defined file
488 // or create the standard example file if it doesn't exist
489
490 const char *filename = "";
491 if (!strcmp(infile, "")) {
492 filename = "results/example_combined_GaussExample_model.root";
493 bool fileExist = !gSystem->AccessPathName(filename); // note opposite return code
494 // if file does not exists generate with histfactory
495 if (!fileExist) {
496 // Normally this would be run on the command line
497 cout << "will run standard hist2workspace example" << endl;
498 gROOT->ProcessLine(".! prepareHistFactory .");
499 gROOT->ProcessLine(".! hist2workspace config/example.xml");
500 cout << "\n\n---------------------" << endl;
501 cout << "Done creating example input" << endl;
502 cout << "---------------------\n\n" << endl;
503 }
504
505 } else
506 filename = infile;
507
508 // Try to open the file
509 TFile *file = TFile::Open(filename);
510
511 // if input file was specified byt not found, quit
512 if (!file) {
513 cout << "StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
514 return;
515 }
516
517 // -------------------------------------------------------
518 // Tutorial starts here
519 // -------------------------------------------------------
520
521 // get the workspace out of the file
522 RooWorkspace *w = (RooWorkspace *)file->Get(workspaceName);
523 if (!w) {
524 cout << "workspace not found" << endl;
525 return;
526 }
527
528 // get the modelConfig out of the file
529 ModelConfig *mc = (ModelConfig *)w->obj(modelConfigName);
530
531 // get the modelConfig out of the file
532 RooAbsData *data = w->data(dataName);
533
534 // make sure ingredients are found
535 if (!data || !mc) {
536 w->Print();
537 cout << "data or ModelConfig was not found" << endl;
538 return;
539 }
540
541 new ModelInspectorGUI(w, mc, data);
542}
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
@ 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:156
@ 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:406
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
R__EXTERN TSystem * gSystem
Definition TSystem.h:561
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
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:124
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:24
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
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
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...
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
1-Dim function class
Definition TF1.h:233
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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:4089
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
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:1296
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
void removeTopic(RooFit::MsgTopic oldTopic)
auto * tt
Definition textangle.C:16