Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
LikelihoodIntervalPlot.cxx
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2
3/*************************************************************************
4 * Project: RooStats *
5 * Package: RooFit/RooStats *
6 * Authors: *
7 * Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke *
8 *************************************************************************
9 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16
17/** \class RooStats::LikelihoodIntervalPlot
18 \ingroup Roostats
19
20 This class provides simple and straightforward utilities to plot a LikelihoodInterval
21 object.
22
23*/
24
26
27#include <algorithm>
28#include <iostream>
29#include <cmath>
30
31#include "TROOT.h"
32#include "TLine.h"
33#include "TObjArray.h"
34#include "TList.h"
35#include "TGraph.h"
36#include "TPad.h"
37#include "TCanvas.h"
38// need chisquare_quantile function - can use mathcore implementation
39// for plotting not crucial that is less precise
41
42
43#include "RooRealVar.h"
44#include "RooPlot.h"
45#include "RooMsgService.h"
46#include "RooProfileLL.h"
47#include "TF1.h"
48
49/// ClassImp for building the THtml documentation of the class
50
51using namespace RooStats;
52
53////////////////////////////////////////////////////////////////////////////////
54/// LikelihoodIntervalPlot default constructor
55/// with default parameters
56
58
59////////////////////////////////////////////////////////////////////////////////
60/// LikelihoodIntervalPlot copy constructor
61
67
68////////////////////////////////////////////////////////////////////////////////
69
78
79////////////////////////////////////////////////////////////////////////////////
80
82{
83 fNdimPlot = params->size();
84 fParamsPlot = static_cast<RooArgSet*>(params->clone((std::string(params->GetName())+"_clone").c_str()));
85
86 return;
87}
88
89
90////////////////////////////////////////////////////////////////////////////////
91/// draw the log of the profiled likelihood function in 1D with the interval or
92/// as a 2D plot with the contours.
93/// Higher dimensional intervals cannot be drawn. One needs to call
94/// SetPlotParameters to project interval in 1 or 2dim
95///
96/// ### Options for drawing 1D intervals
97///
98/// For 1D problem the log of the profiled likelihood function is drawn by default in a RooPlot as a
99/// RooCurve
100/// The plotting range (default is the full parameter range) and the precision of the RooCurve
101/// can be specified by using SetRange(x1,x2) and SetPrecision(eps).
102/// SetNPoints(npoints) can also be used (default is npoints=100)
103/// Optionally the function can be drawn as a TF1 (option="tf1") obtained by sampling the given npoints
104/// in the given range
105///
106/// ### Options for drawing 2D intervals
107///
108/// For 2D case, a contour and optionally the profiled likelihood function is drawn by sampling npoints in
109/// the given range. A 2d histogram of nbinsX=nbinsY = sqrt(npoints) is used for sampling the profiled likelihood.
110/// The contour can be obtained by using Minuit or by the sampled histogram,
111/// If using Minuit, the number of points specifies the number of contour points. If using an histogram the number of
112/// points is approximately the total number of bins of the histogram.
113/// Possible options:
114/// - minuit/nominuit: use minuit for computing the contour
115/// - hist/nohist : sample in an histogram the profiled likelihood
116///
117/// Note that one can have both a drawing of the sampled likelihood and of the contour using minuit.
118/// The default options is "minuit nohist"
119/// The sampled histogram is drawn first by default using the option "colz" and then 8 probability contours at
120/// these CL are drawn: { 0.1,0.3,0.5,0.683,0.95,0.9973,0.9999366575,0.9999994267} re-drawing the histogram with the
121/// option "cont3"
122///
123/// The drawn object (RooPlot or sampled histogram) is saved in the class and can be retrieved using GetPlottedObject()
124/// In this way the user can eventually customize further the plot.
125/// Note that the class does not delete the plotted object. It needs, if needed, to be deleted by the user
126
128{
129 // we need to check if parameters to plot is different than parameters of interval
132 for (auto const *arg : *fParamsPlot) {
133 if (!intervalParams->contains(*arg) ) {
134 ccoutE(InputArguments) << "Parameter " << arg->GetName() << "is not in the list of LikelihoodInterval parameters "
135 << " - do not use for plotting " << std::endl;
136 fNdimPlot--;
137 extraParams.add(*arg);
138 }
139 }
140 if (!extraParams.empty())
141 fParamsPlot->remove(extraParams,true,true);
142
143 if(fNdimPlot > 2){
144 ccoutE(InputArguments) << "LikelihoodIntervalPlot::Draw(" << GetName()
145 << ") ERROR: contours for more than 2 dimensions not implemented!" << std::endl;
146 return;
147 }
148
149 // if the number of parameters to plot is less to the number of parameters of the LikelihoodInterval
150 // we need to re-do the profile likelihood function, otherwise those parameters will not be profiled
151 // when plotting
152 RooAbsReal* newProfile = nullptr;
153 std::unique_ptr<RooAbsReal> newProfileOwner;
155 if (fNdimPlot != int(intervalParams->size()) ) {
156 RooProfileLL * profilell = dynamic_cast<RooProfileLL*>(oldProfile);
157 if (!profilell) return;
158 RooAbsReal & nll = profilell->nll();
159 newProfileOwner = std::unique_ptr<RooAbsReal>{nll.createProfile(*fParamsPlot)};
161 }
162 else {
164 }
165
166 auto *myparam = static_cast<RooRealVar*>((*fParamsPlot)[0]);
167
168 // do a dummy evaluation around minimum to be sure profile has right minimum
171 newProfile->getVal();
172 }
173
174 // analyze options
175 TString opt = options;
176 opt.ToLower();
177
178 TString title = GetTitle();
179 int nPoints = fNPoints;
180
181 if(fNdimPlot == 1) {
182
183 // 1D drawing options
184 // use RooPLot for drawing the 1D PL
185 // if option is TF1 use TF1 for drawing
186 bool useRooPlot = opt.Contains("rooplot") || ! (opt.Contains("tf1"));
187 opt.ReplaceAll("rooplot","");
188 opt.ReplaceAll("tf1","");
189
190
191 // if (title.Length() == 0)
192 // title = "- log profile likelihood ratio";
193
194 if (nPoints <=0) nPoints = 100; // default in 1D
195
196 const double xcont_min = fInterval->LowerLimit(*myparam);
197 const double xcont_max = fInterval->UpperLimit(*myparam);
198
199 RooRealVar* myarg = static_cast<RooRealVar *>(newProfile->getVariables()->find(myparam->GetName()));
200 double x1 = myarg->getMin();
201 double x2 = myarg->getMax();
202
203 // default color values
204 if (fColor == 0) fColor = kBlue;
205 if (fLineColor == 0) fLineColor = kGreen;
206
207 RooPlot * frame = nullptr;
208
209 // use TF1 for drawing the function
210 if (!useRooPlot) {
211
212 // set a first estimate of range including 2 times upper and lower limit
213 double xmin = std::max( x1, 2*xcont_min - xcont_max);
214 double xmax = std::min( x2, 2*xcont_max - xcont_min);
215 if (fXmin < fXmax) { xmin = fXmin; xmax = fXmax; }
216
217 TF1 * tmp = newProfile->asTF(*myarg);
218 assert(tmp != nullptr);
219 tmp->SetRange(xmin, xmax);
220 tmp->SetNpx(nPoints);
221
222 // clone the function to avoid later to sample it
223 TF1 * f1 = static_cast<TF1*>(tmp->Clone());
224 delete tmp;
225
226 f1->SetTitle(title);
227 TString name = TString(GetName()) + TString("_PLL_") + TString(myarg->GetName());
228 f1->SetName(name);
229
230 // set range for displaying x values where function <= fMaximum
231 // if no range is set amd
232 // if no reasonable value found maintain first estimate
233 x1 = xmin; x2 = xmax;
234 if (fMaximum > 0 && fXmin >= fXmax ) {
235 double x0 = f1->GetX(0, xmin, xmax);
236 // check that minimum is between xmin and xmax
237 if ( x0 > x1 && x0 < x2) {
238 x1 = f1->GetX(fMaximum, xmin, x0);
239 x2 = f1->GetX(fMaximum, x0, xmax);
241 //std::cout << "setting range to " << x1 << " , " << x2 << " x0 = " << x0 << std::endl;
242 }
243 }
244
245 f1->SetRange(x1,x2);
246
247
249 f1->GetXaxis()->SetTitle(myarg->GetName());
250 f1->GetYaxis()->SetTitle(Form("- log #lambda(%s)",myparam->GetName()));
251 f1->Draw(opt);
253
254 }
255 else {
256 // use a RooPlot for drawing the PL function
257 double xmin = myparam->getMin(); double xmax = myparam->getMax();
258 if (fXmin < fXmax) { xmin = fXmin; xmax = fXmax; }
259
260 // set nbins (must be used in combination with precision )
261 // the curve will evaluate 2 * nbins if precision is > 1
262 int prevBins = myarg->getBins();
263 myarg->setBins(fNPoints);
264
265 // want to set range on frame not function
266 frame = myarg->frame(xmin,xmax,nPoints);
267 // for ycutoff line
268 x1= xmin;
269 x2=xmax;
270 frame->SetTitle(title);
271 frame->GetYaxis()->SetTitle(Form("- log #lambda(%s)",myparam->GetName()));
272 // frame->GetYaxis()->SetTitle("- log profile likelihood ratio");
273
274
275 // plot
278 newProfile->plotOn(frame,cmd,RooFit::LineColor(fColor));
279
280 frame->SetMaximum(fMaximum);
281 frame->SetMinimum(0.);
282
283 myarg->setBins(prevBins);
284 fPlotObject = frame;
285 }
286
287
288 //myarg->setVal(xcont_max);
289 //const double Yat_Xmax = newProfile->getVal();
291
295
296 Yline_cutoff->SetLineColor(fLineColor);
297 Yline_min->SetLineColor(fLineColor);
298 Yline_max->SetLineColor(fLineColor);
299
300 if (!useRooPlot) {
301 // need to draw the line
302 Yline_cutoff->Draw();
303 Yline_min->Draw();
304 Yline_max->Draw();
305 }
306 else {
307 // add line in the RooPlot
308 frame->addObject(Yline_min);
309 frame->addObject(Yline_max);
310 frame->addObject(Yline_cutoff);
311 frame->Draw(opt);
312 }
313
314
315 return;
316 }
317
318 // case of 2 dimensions
319
320 else if(fNdimPlot == 2){
321
322 //2D drawing options
323
324 // use Minuit for drawing the contours of the PL (default case)
325 bool useMinuit = !opt.Contains("nominuit");
326 // plot histogram in 2D
327 bool plotHist = !opt.Contains("nohist");
328 opt.ReplaceAll("nominuit","");
329 opt.ReplaceAll("nohist","");
330 if (opt.Contains("minuit") ) useMinuit= true;
331 if (useMinuit) plotHist = false; // switch off hist by default in case of Minuit
332 if (opt.Contains("hist") ) plotHist= true;
333 opt.ReplaceAll("minuit","");
334 opt.ReplaceAll("hist","");
335
336 auto *myparamY = static_cast<RooRealVar*>((*fParamsPlot)[1]);
337
339 cont_level = cont_level/2; // since we are plotting -log LR
340
341 RooArgList params(*newProfile->getVariables());
342 // set values and error for the POI to the best fit values
343 for (std::size_t i = 0; i < params.size(); ++i) {
344 RooRealVar & par = static_cast<RooRealVar &>( params[i]);
345 RooRealVar * fitPar = static_cast<RooRealVar *> (fInterval->GetBestFitParameters()->find(par.GetName() ) );
346 if (fitPar) {
347 par.setVal( fitPar->getVal() );
348 }
349 }
350 // do a profile evaluation to start from the best fit values of parameters
351 newProfile->getVal();
352
353 if (title.Length() == 0)
354 title = TString("Contour of ") + TString(myparamY->GetName() ) + TString(" vs ") + TString(myparam->GetName() );
355 // add also labels
356 title = TString::Format("%s;%s;%s",title.Data(),myparam->GetName(),myparamY->GetName());
357
358 if (nPoints <=0) nPoints = 40; // default in 2D
359
360 double xmin = myparam->getMin(); double xmax = myparam->getMax();
361 double ymin = myparamY->getMin(); double ymax = myparamY->getMax();
362 if (fXmin < fXmax) { xmin = fXmin; xmax = fXmax; }
363 if (fYmin < fYmax) { ymin = fYmin; ymax = fYmax; }
364
365
366 if (!useMinuit || plotHist) {
367
368 // find contour from a scanned histogram of points
369
370 // draw directly the TH2 from the profile LL
371 TString histName = TString::Format("_hist2D__%s_%s",myparam->GetName(),myparamY->GetName() );
372 int nBins = int( std::sqrt(double(nPoints)) + 0.5 );
373 TH2* hist2D = new TH2D(histName, title, nBins, xmin, xmax, nBins, ymin, ymax );
374 newProfile->fillHistogram(hist2D, RooArgList(*myparam,*myparamY), 1, nullptr, false, nullptr, false);
375
376 hist2D->SetTitle(title);
377 hist2D->SetStats(false);
378
379 //need many color levels for drawing with option colz
380 if (plotHist) {
381
382 const int nLevels = 51;
383 double contLevels[nLevels];
384 contLevels[0] = 0.01;
385 double maxVal = (fMaximum > 0) ? fMaximum : hist2D->GetMaximum();
386 for (int k = 1; k < nLevels; ++k) {
387 contLevels[k] = k*maxVal/double(nLevels-1);
388 }
389 hist2D->SetContour(nLevels,contLevels);
390
391 if (fMaximum>0) hist2D->SetMaximum(fMaximum);
392
393 hist2D->DrawClone("COLZ");
394 }
395
396
397 //need now less contours for drawing with option cont
398
399 const int nLevels = 8;
400 double contLevels[nLevels];
401 // last 3 are the 3,4,5 sigma levels
402 double confLevels[nLevels] = { 0.1,0.3,0.5,0.683,0.95,0.9973,0.9999366575,0.9999994267};
403 for (int k = 0; k < nLevels; ++k) {
404 //contLevels[k] = 0.5*ROOT::Math::chisquared_quantile(1.-2.*ROOT::Math::normal_cdf_c(nSigmaLevels[k],1),2);
406 }
407 hist2D->SetContour(nLevels,contLevels);
408 if (fLineColor) hist2D->SetLineColor(fLineColor);
409
410 // default options for drawing a second histogram
411 TString tmpOpt = opt;
412 tmpOpt.ReplaceAll("same","");
413 if (tmpOpt.Length() < 3) opt += "cont3";
414 // if histo is plotted draw on top
415 if (plotHist) opt += TString(" same");
416 hist2D->Draw(opt.Data());
417 gPad->Update();
418
419 // case of plotting contours without minuit
420 if (!useMinuit) {
421
422 // set levels of contours if make contours without minuit
423 TH2 * h = static_cast<TH2*>(hist2D->Clone());
425
427 // o a temporary draw to get the contour graph
428 TCanvas * tmpCanvas = new TCanvas("tmpCanvas","tmpCanvas");
429 h->Draw("CONT LIST");
430 gPad->Update();
431
432 // get graphs from the contours
433 TObjArray *contoursOrig = static_cast<TObjArray*>(gROOT->GetListOfSpecials()->FindObject("contours"));
434 // CLONE THE LIST IN CASE IT GETS DELETED
435 TObjArray *contours = nullptr;
436 if (contoursOrig) contours = static_cast<TObjArray*>(contoursOrig->Clone());
437
438 delete tmpCanvas;
439 delete h;
441
442
443 // in case of option CONT4 I need to re-make the Pad
444 if (tmpOpt.Contains("cont4")) {
445 double bm = gPad->GetBottomMargin();
446 double lm = gPad->GetLeftMargin();
447 double rm = gPad->GetRightMargin();
448 double tm = gPad->GetTopMargin();
449 double x1 = hist2D->GetXaxis()->GetXmin();
450 double y1 = hist2D->GetYaxis()->GetXmin();
451 double x2 = hist2D->GetXaxis()->GetXmax();
452 double y2 = hist2D->GetYaxis()->GetXmax();
453
454 TPad *null=new TPad("null","null",0,0,1,1);
455 null->SetFillStyle(0);
456 null->SetFrameFillStyle(0);
457 null->Draw();
458 null->cd();
459 null->Range(x1-(x2-x1)*(lm/(1-rm-lm)),
460 y1-(y2-y1)*(bm/(1-tm-lm)),
461 x2+(x2-x1)*(rm/(1-rm-lm)),
462 y2+(y2-y1)*(tm/(1-tm-lm)));
463
464 gPad->Update();
465 }
466
467
468 if (contours) {
469 int ncontours = contours->GetSize();
470 for (int icont = 0; icont < ncontours; ++icont) {
471 TList * contourList = static_cast<TList*>(contours->At(icont));
472 if (contourList && contourList->GetSize() > 0) {
476 gr->SetLineWidth(3);
477 if (fColor) {
479 gr->Draw("FL");
480 }
481 else
482 gr->Draw("L");
483 }
484 }
485 }
486 }
487 else {
488 ccoutE(InputArguments) << "LikelihoodIntervalPlot::Draw(" << GetName()
489 << ") ERROR: no contours found in ListOfSpecial" << std::endl;
490 }
491
493
494 }
495 }
496 if (useMinuit) {
497
498 // find contours using Minuit
499 TGraph * gr = new TGraph(nPoints+1);
500
502
503 if (int(ncp) < nPoints) {
504 std::cout << "Warning - Less points calculated in contours np = " << ncp << " / " << nPoints << std::endl;
505 for (int i = ncp; i < nPoints; ++i) gr->RemovePoint(i);
506 }
507 // add last point to same as first one to close the contour
508 gr->SetPoint(ncp, gr->GetX()[0], gr->GetY()[0] );
509 if (!opt.Contains("c")) opt.Append("L"); // use by default option L if C is not specified
510 // draw first a dummy 2d histogram gfor the axis
511 if (!opt.Contains("same") && !plotHist) {
512
513 TH2F* hist2D = new TH2F("_hist2D",title, nPoints, xmin, xmax, nPoints, ymin, ymax );
514 hist2D->GetXaxis()->SetTitle(myparam->GetName());
515 hist2D->GetYaxis()->SetTitle(myparamY->GetName());
516 hist2D->SetBit(TH1::kNoStats); // do not draw statistics
517 hist2D->SetFillStyle(fFillStyle);
518 hist2D->SetMaximum(1); // to avoid problem with subsequents draws
519 hist2D->Draw("AXIS");
520 }
522 if (fColor) {
523 // draw contour as filled area (add option "F")
525 opt.Append("F");
526 }
527 gr->SetLineWidth(3);
528 if (opt.Contains("same")) gr->SetFillStyle(fFillStyle); // put transparent
529 gr->Draw(opt);
530 TString name = TString("Graph_of_") + TString(fInterval->GetName());
531 gr->SetName(name);
532
533 if (!fPlotObject) fPlotObject = gr;
534 else if (fPlotObject->IsA() != TH2D::Class() ) fPlotObject = gr;
535
536 }
537
538 // draw also the minimum
539 const RooArgSet * bestFitParams = fInterval->GetBestFitParameters();
540 if (bestFitParams) {
541 TGraph * gr0 = new TGraph(1);
542 double x0 = bestFitParams->getRealValue(myparam->GetName());
543 double y0 = bestFitParams->getRealValue(myparamY->GetName());
544 gr0->SetPoint(0,x0,y0);
545 gr0->SetMarkerStyle(33);
546 if (fColor) {
547 if (fColor != kBlack) gr0->SetMarkerColor(fColor+4);
548 else gr0->SetMarkerColor(kGray);
549 }
550 gr0->Draw("P");
551 delete bestFitParams;
552 }
553
554
555
556 }
557
558 return;
559}
#define h(i)
Definition RSha256.hxx:106
#define ccoutE(a)
const char Option_t
Definition RtypesCore.h:66
@ kGray
Definition Rtypes.h:65
@ kBlack
Definition Rtypes.h:65
@ kGreen
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
@ kDashed
Definition TAttLine.h:52
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void GetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Stores the parameters of the given function into pars.
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:110
float xmin
float ymin
float xmax
float ymax
#define gROOT
Definition TROOT.h:406
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
#define gPad
double getRealValue(const char *name, double defVal=0.0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
const char * GetName() const override
Returns name of object.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
Storage_t::size_type size() const
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
TObject * clone(const char *newname) const override
Definition RooArgSet.h:111
Named container for two doubles, two integers two object points and three string pointers that can be...
Definition RooCmdArg.h:26
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1202
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition RooPlot.cxx:325
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
Definition RooPlot.cxx:1006
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
Definition RooPlot.cxx:996
TAxis * GetYaxis() const
Definition RooPlot.cxx:1223
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Definition RooPlot.cxx:596
Implements the profile likelihood estimator for a given likelihood and set of parameters of interest.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
void setVal(double value) override
Set value of variable to 'value'.
Color_t fColor
color for the contour (for 2D) or function (in 1D)
void SetPlotParameters(const RooArgSet *params)
Int_t fNPoints
number of points used to scan the PL, default depends if 1D or 2D
Style_t fFillStyle
fill style for contours, half transparent by default
void Draw(const Option_t *options=nullptr) override
draw the likelihood interval or contour for the 1D case a RooPlot is drawn by default of the profiled...
LikelihoodIntervalPlot()
LikelihoodIntervalPlot default constructor with default parameters.
double fPrecision
RooCurve precision, use default in case of -1.
void SetLikelihoodInterval(LikelihoodInterval *theInterval)
Color_t fLineColor
line color for the interval (1D) or for other contours (2D)
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
double ConfidenceLevel() const override
return confidence level
double UpperLimit(const RooRealVar &param)
return the upper bound of the interval on a given parameter
Int_t GetContourPoints(const RooRealVar &paramX, const RooRealVar &paramY, double *x, double *y, Int_t npoints=30)
return the 2D-contour points for the given subset of parameters by default make the contour using 30 ...
RooArgSet * GetParameters() const override
return a cloned list of parameters of interest. User manages the return object
double LowerLimit(const RooRealVar &param)
return the lower bound of the interval on a given parameter
RooAbsReal * GetLikelihoodRatio()
return the profile log-likelihood ratio function
const RooArgSet * GetBestFitParameters() const
return a pointer to a snapshot with best fit parameter of interest
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:38
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:40
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:44
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:45
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:42
The Canvas class.
Definition TCanvas.h:23
1-Dim function class
Definition TF1.h:233
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to visualise the function Note that this histogram is managed ...
Definition TF1.cxx:1584
TAxis * GetYaxis() const
Get y axis of the function.
Definition TF1.cxx:2411
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn,...
Definition TF1.cxx:3401
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
Definition TF1.cxx:3535
void SetTitle(const char *title="") override
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
Definition TF1.cxx:3565
void Draw(Option_t *option="") override
Draw this function with its current attributes.
Definition TF1.cxx:1333
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
Definition TF1.cxx:1863
TAxis * GetXaxis() const
Get x axis of the function.
Definition TF1.cxx:2400
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition TGraph.cxx:2291
Double_t * GetY() const
Definition TGraph.h:139
Double_t * GetX() const
Definition TGraph.h:138
virtual Int_t RemovePoint()
Delete point close to the mouse position Returns index of removed point (or -1 if nothing was changed...
Definition TGraph.cxx:2038
void SetName(const char *name="") override
Set graph name.
Definition TGraph.cxx:2330
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
Definition TGraph.cxx:833
@ kNoStats
Don't draw stats box.
Definition TH1.h:176
virtual void SetContour(Int_t nlevels, const Double_t *levels=nullptr)
Set the number and values of contour levels.
Definition TH1.cxx:8470
2-D histogram with a double per channel (see TH1 documentation)
Definition TH2.h:356
static TClass * Class()
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:307
Service class for 2-D histogram classes.
Definition TH2.h:30
Use the TLine constructor to create a simple line.
Definition TLine.h:22
A doubly linked list.
Definition TList.h:38
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:174
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:150
An array of TObjects.
Definition TObjArray.h:31
virtual TClass * IsA() const
Definition TObject.h:247
The most important graphics class in the ROOT system.
Definition TPad.h:28
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
void ToLower()
Change string to lower-case.
Definition TString.cxx:1182
const char * Data() const
Definition TString.h:376
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
TString & Append(const char *cs)
Definition TString.h:572
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
RooCmdArg Precision(double prec)
RooCmdArg LineColor(TColorNumber color)
double chisquared_quantile(double z, double r)
Inverse ( ) of the cumulative distribution function of the lower tail of the distribution with degr...
TGraphErrors * gr
Definition legend1.C:25
TF1 * f1
Definition legend1.C:11
Namespace for the RooStats classes.
Definition CodegenImpl.h:58