Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
SamplingDistPlot.cxx
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Authors: Sven Kreiss June 2010
3// Authors: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
4/*************************************************************************
5 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class RooStats::SamplingDistPlot
13 \ingroup Roostats
14
15This class provides simple and straightforward utilities to plot SamplingDistribution
16objects.
17*/
18
20
22
23#include "RooRealVar.h"
24#include "TStyle.h"
25#include "TLine.h"
26#include "TFile.h"
27#include "TVirtualPad.h" // for gPad
28
29#include <algorithm>
30#include <iostream>
31
32
33#include "RooMsgService.h"
34
35#include "TMath.h"
36
38
39using namespace RooStats;
40using namespace std;
41
42////////////////////////////////////////////////////////////////////////////////
43/// SamplingDistPlot default constructor with bin size
44
46
47////////////////////////////////////////////////////////////////////////////////
48/// SamplingDistPlot constructor with bin size, min and max
49
50SamplingDistPlot::SamplingDistPlot(Int_t nbins, double min, double max) : fBins{nbins}
51{
52 SetXRange(min, max);
53}
54
55////////////////////////////////////////////////////////////////////////////////
56/// destructors - delete objects contained in the list
57
59{
60 fItems.Delete();
62 if (fRooPlot) delete fRooPlot;
63}
64
65
66////////////////////////////////////////////////////////////////////////////////
67/// adds sampling distribution (and normalizes if "NORMALIZE" is given as an option)
68
71 if( fSamplingDistr.empty() ) {
72 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
73 return 0.0;
74 }
75 SetSampleWeights(samplingDist);
76
77 TString options(drawOptions);
78 options.ToUpper();
79
81 // remove cases where xmin and xmax are +/- inf
82 for( unsigned int i=0; i < fSamplingDistr.size(); i++ ) {
83 if( fSamplingDistr[i] < xmin && fSamplingDistr[i] != -TMath::Infinity() ) {
85 }
88 }
89 }
90 if( xmin >= xmax ) {
91 coutW(Plotting) << "Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
92 xmin = -1.0;
93 xmax = 1.0;
94 }
95
96
97 // add 1.5 bins left and right
98 assert(fBins > 1);
99 double binWidth = (xmax-xmin)/(fBins);
100 double xlow = xmin - 1.5*binWidth;
101 double xup = xmax + 1.5*binWidth;
102 if( !TMath::IsNaN(fXMin) ) xlow = fXMin;
103 if( !TMath::IsNaN(fXMax) ) xup = fXMax;
104
105 fHist = new TH1F(samplingDist->GetName(), samplingDist->GetTitle(), fBins, xlow, xup);
106 fHist->SetDirectory(nullptr); // make the object managed by this class
107
108 if( fVarName.Length() == 0 ) fVarName = samplingDist->GetVarName();
110
111
112 std::vector<double>::iterator valuesIt = fSamplingDistr.begin();
113 for (int w_idx = 0; valuesIt != fSamplingDistr.end(); ++valuesIt, ++w_idx) {
114 if (fIsWeighted) fHist->Fill(*valuesIt, fSampleWeights[w_idx]);
115 else fHist->Fill(*valuesIt);
116 }
117
118 // NORMALIZATION
119 fHist->Sumw2();
120 double weightSum = 1.0;
121 if(options.Contains("NORMALIZE")) {
122 weightSum = fHist->Integral("width");
123 fHist->Scale(1./weightSum);
124
125 options.ReplaceAll("NORMALIZE", "");
126 options.Strip();
127 }
128
129
130 //some basic aesthetics
134
135 fMarkerType++;
136 fColor++;
137
138 fHist->SetStats(false);
139
140 addObject(fHist, options.Data());
141
142 TString title = samplingDist->GetTitle();
143 if(fLegend && title.Length() > 0) fLegend->AddEntry(fHist, title, "L");
144
145 return 1./weightSum;
146}
147
148////////////////////////////////////////////////////////////////////////////////
149
150double SamplingDistPlot::AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, double minShaded, double maxShaded, Option_t *drawOptions) {
151 if( samplingDist->GetSamplingDistribution().empty() ) {
152 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
153 return 0.0;
154 }
155 double scaleFactor = AddSamplingDistribution(samplingDist, drawOptions);
156
157 TH1F *shaded = (TH1F*)fHist->Clone((string(samplingDist->GetName())+string("_shaded")).c_str());
158 shaded->SetDirectory(nullptr);
159 shaded->SetFillStyle(fFillStyle++);
160 shaded->SetLineWidth(1);
161
162 for (int i=0; i<shaded->GetNbinsX(); ++i) {
163 if (shaded->GetBinCenter(i) < minShaded || shaded->GetBinCenter(i) > maxShaded){
164 shaded->SetBinContent(i,0);
165 }
166 }
167
168 TString options(drawOptions);
169 options.ToUpper();
170 if(options.Contains("NORMALIZE")) {
171 options.ReplaceAll("NORMALIZE", "");
172 options.Strip();
173 }
174 addObject(shaded, options.Data());
175
176 return scaleFactor;
177}
178
179////////////////////////////////////////////////////////////////////////////////
180
181void SamplingDistPlot::AddLine(double x1, double y1, double x2, double y2, const char* title) {
182 TLine *line = new TLine(x1, y1, x2, y2);
183 line->SetLineWidth(3);
185
186 if(fLegend && title) fLegend->AddEntry(line, title, "L");
187
188 addOtherObject(line, ""); // no options
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// add an histogram (it will be cloned);
193
195 if(fLegend && h->GetTitle()) fLegend->AddEntry(h, h->GetTitle(), "L");
196 TH1 * hcopy = (TH1*) h->Clone();
197 hcopy->SetDirectory(nullptr);
198 addObject(hcopy, drawOptions);
199}
200void SamplingDistPlot::AddTF1(TF1* f, const char* title, Option_t *drawOptions) {
201 if(fLegend && title) fLegend->AddEntry(f, title, "L");
202 addOtherObject(f->Clone(), drawOptions);
203}
204
205////////////////////////////////////////////////////////////////////////////////
206///Determine if the sampling distribution has weights and store them
207
209{
210 fIsWeighted = false;
211
212 if(!samplingDist->GetSampleWeights().empty()){
213 fIsWeighted = true;
214 fSampleWeights = samplingDist->GetSampleWeights();
215 }
216
217 return;
218}
219
220////////////////////////////////////////////////////////////////////////////////
221/// Add a generic object to this plot. The specified options will be
222/// used to Draw() this object later. The caller transfers ownership
223/// of the object with this call, and the object will be deleted
224/// when its containing plot object is destroyed.
225
227{
228
229 if(nullptr == obj) {
230 std::cerr << fName << "::addObject: called with a null pointer" << std::endl;
231 return;
232 }
233
234 fItems.Add(obj,drawOptions);
235
236 return;
237}
238
239////////////////////////////////////////////////////////////////////////////////
240/// Add a generic object to this plot. The specified options will be
241/// used to Draw() this object later. The caller transfers ownership
242/// of the object with this call, and the object will be deleted
243/// when its containing plot object is destroyed.
244
246{
247 if(nullptr == obj) {
248 coutE(InputArguments) << fName << "::addOtherObject: called with a null pointer" << std::endl;
249 return;
250 }
251
252 fOtherItems.Add(obj,drawOptions);
253
254 return;
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// Draw this plot and all of the elements it contains. The specified options
259/// only apply to the drawing of our frame. The options specified in our add...()
260/// methods will be used to draw each object we contain.
261
262void SamplingDistPlot::Draw(Option_t * /*options */) {
264
265 double theMin(0.), theMax(0.), theYMin(std::numeric_limits<float>::quiet_NaN()), theYMax(0.);
266 GetAbsoluteInterval(theMin, theMax, theYMax);
267 if( !TMath::IsNaN(fXMin) ) theMin = fXMin;
268 if( !TMath::IsNaN(fXMax) ) theMax = fXMax;
269 if( !TMath::IsNaN(fYMin) ) theYMin = fYMin;
270 if( !TMath::IsNaN(fYMax) ) theYMax = fYMax;
271
272 RooRealVar xaxis("xaxis", fVarName.Data(), theMin, theMax);
273
274 //L.M. by drawing many times we create a memory leak ???
275 if (fRooPlot) delete fRooPlot;
276
277 bool dirStatus = RooPlot::addDirectoryStatus();
278 // make the RooPlot managed by this class
280 fRooPlot = xaxis.frame();
282 if (!fRooPlot) {
283 coutE(InputArguments) << "invalid variable to plot" << std::endl;
284 return;
285 }
286 fRooPlot->SetTitle("");
287 if( !TMath::IsNaN(theYMax) ) {
288 //coutI(InputArguments) << "Setting maximum to " << theYMax << endl;
289 fRooPlot->SetMaximum(theYMax);
290 }
291 if( !TMath::IsNaN(theYMin) ) {
292 //coutI(InputArguments) << "Setting minimum to " << theYMin << endl;
293 fRooPlot->SetMinimum(theYMin);
294 }
295
296 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
297 //obj->Draw(fIterator->GetOption());
298 // add cloned objects to avoid mem leaks
299 TH1 * cloneObj = (TH1*)obj->Clone();
300 if( !TMath::IsNaN(theYMax) ) {
301 //coutI(InputArguments) << "Setting maximum of TH1 to " << theYMax << endl;
302 cloneObj->SetMaximum(theYMax);
303 }
304 if( !TMath::IsNaN(theYMin) ) {
305 //coutI(InputArguments) << "Setting minimum of TH1 to " << theYMin << endl;
306 cloneObj->SetMinimum(theYMin);
307 }
308 cloneObj->SetDirectory(nullptr); // transfer ownership of the object
309 fRooPlot->addTH1(cloneObj, obj->GetOption());
310 }
311
312 for(TObject * otherObj : fOtherItems) {
313 TObject * cloneObj = otherObj->Clone();
314 fRooPlot->addObject(cloneObj, otherObj->GetOption());
315 }
316
317
319
320 if(bool(gStyle->GetOptLogx()) != fLogXaxis) {
321 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogx(...)" << endl;
323 }
324 if(bool(gStyle->GetOptLogy()) != fLogYaxis) {
325 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogy(...)" << endl;
327 }
328 fRooPlot->Draw();
329
330 // apply this since gStyle does not work for RooPlot
331 if (gPad) {
332 gPad->SetLogx(fLogXaxis);
333 gPad->SetLogy(fLogYaxis);
334 }
335
336 return;
337}
338
339////////////////////////////////////////////////////////////////////////////////
340
342 if(fApplyStyle) {
343 // use plain black on white colors
344 Int_t icol = 0;
345 gStyle->SetFrameBorderMode( icol );
347 gStyle->SetPadBorderMode( icol );
348 gStyle->SetPadColor( icol );
349 gStyle->SetCanvasColor( icol );
350 gStyle->SetStatColor( icol );
352
353 // set the paper & margin sizes
354 gStyle->SetPaperSize( 20, 26 );
355
356 if(fLegend) {
359 }
360 }
361}
362
363////////////////////////////////////////////////////////////////////////////////
364
365void SamplingDistPlot::GetAbsoluteInterval(double &theMin, double &theMax, double &theYMax) const
366{
367 double tmpmin = TMath::Infinity();
368 double tmpmax = -TMath::Infinity();
369 double tmpYmax = -TMath::Infinity();
370
371 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
372 if(obj->GetXaxis()->GetXmin() < tmpmin) tmpmin = obj->GetXaxis()->GetXmin();
373 if(obj->GetXaxis()->GetXmax() > tmpmax) tmpmax = obj->GetXaxis()->GetXmax();
374 if(obj->GetMaximum() > tmpYmax) tmpYmax = obj->GetMaximum() + 0.1*obj->GetMaximum();
375 }
376
377 theMin = tmpmin;
378 theMax = tmpmax;
379 theYMax = tmpYmax;
380
381 return;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Sets line color for given sampling distribution and
386/// fill color for the associated shaded TH1F.
387
389 if (samplDist == nullptr) {
390 fHist->SetLineColor(color);
391
392 TString shadedName(fHist->GetName());
393 shadedName += "_shaded";
394
395 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
396 if (!strcmp(obj->GetName(), shadedName.Data())) {
397 obj->SetLineColor(color);
398 obj->SetFillColor(color);
399 //break;
400 }
401 }
402 } else {
403
404 TString shadedName(samplDist->GetName());
405 shadedName += "_shaded";
406
407 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
408 if (!strcmp(obj->GetName(), samplDist->GetName())) {
409 obj->SetLineColor(color);
410 //break;
411 }
412 if (!strcmp(obj->GetName(), shadedName.Data())) {
413 obj->SetLineColor(color);
414 obj->SetFillColor(color);
415 //break;
416 }
417 }
418 }
419
420 return;
421}
422
423////////////////////////////////////////////////////////////////////////////////
424
426{
427 if(samplDist == nullptr){
428 fHist->SetLineWidth(lwidth);
429 }
430 else{
431 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
432 if(!strcmp(obj->GetName(),samplDist->GetName())){
433 obj->SetLineWidth(lwidth);
434 break;
435 }
436 }
437 }
438
439 return;
440}
441
442////////////////////////////////////////////////////////////////////////////////
443
445{
446 if(samplDist == nullptr){
448 }
449 else{
450 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
451 if(!strcmp(obj->GetName(),samplDist->GetName())){
452 obj->SetLineStyle(style);
453 break;
454 }
455 }
456 }
457
458 return;
459}
460
461////////////////////////////////////////////////////////////////////////////////
462
464{
465 if(samplDist == nullptr){
467 }
468 else{
469 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
470 if(!strcmp(obj->GetName(),samplDist->GetName())){
471 obj->SetMarkerStyle(style);
472 break;
473 }
474 }
475 }
476
477 return;
478}
479
480////////////////////////////////////////////////////////////////////////////////
481
483{
484 if(samplDist == nullptr){
485 fHist->SetMarkerColor(color);
486 }
487 else{
488 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
489 if(!strcmp(obj->GetName(),samplDist->GetName())){
490 obj->SetMarkerColor(color);
491 break;
492 }
493 }
494 }
495
496 return;
497}
498
499////////////////////////////////////////////////////////////////////////////////
500
502{
503 if(samplDist == nullptr){
505 }
506 else{
507 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
508 if(!strcmp(obj->GetName(),samplDist->GetName())){
509 obj->SetMarkerSize(size);
510 break;
511 }
512 }
513 }
514
515 return;
516}
517
518////////////////////////////////////////////////////////////////////////////////
519
521{
522 if(samplDist == nullptr){
523 return fHist;
524 }else{
525 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
526 if(!strcmp(obj->GetName(),samplDist->GetName())){
527 return obj;
528 }
529 }
530 }
531
532 return nullptr;
533}
534
535////////////////////////////////////////////////////////////////////////////////
536
538{
539 if(samplDist == nullptr){
540 fHist->Rebin(rebinFactor);
541 }
542 else{
543 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
544 if(!strcmp(obj->GetName(),samplDist->GetName())){
545 obj->Rebin(rebinFactor);
546 break;
547 }
548 }
549 }
550
551 return;
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// TODO test
556
557void SamplingDistPlot::DumpToFile(const char* RootFileName, Option_t *option, const char *ftitle, Int_t compress) {
558 // All the objects are written to rootfile
559
560 if(!fRooPlot) {
561 cout << "Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
562 return;
563 }
564
565 TFile ofile(RootFileName, option, ftitle, compress);
566 ofile.cd();
567 fRooPlot->Write();
568 ofile.Close();
569}
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define coutW(a)
#define coutE(a)
short Style_t
Definition RtypesCore.h:89
short Color_t
Definition RtypesCore.h:92
float Size_t
Definition RtypesCore.h:96
short Width_t
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
@ kBlack
Definition Rtypes.h:65
Option_t Option_t option
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 style
Option_t Option_t TPoint TPoint const char y1
float xmin
float xmax
R__EXTERN TStyle * gStyle
Definition TStyle.h:433
#define gPad
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,...
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1258
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition RooPlot.cxx:383
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:402
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
Definition RooPlot.cxx:1062
static bool addDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:79
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
Definition RooPlot.cxx:1052
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Definition RooPlot.cxx:652
static bool setAddDirectoryStatus(bool flag)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:80
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:37
This class provides simple and straightforward utilities to plot SamplingDistribution objects.
void SetSampleWeights(const SamplingDistribution *samplingDist)
Determine if the sampling distribution has weights and store them.
TList fItems
holds TH1Fs only
void DumpToFile(const char *RootFileName, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
write to Root file
void RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist=nullptr)
~SamplingDistPlot() override
Destructor of SamplingDistribution.
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
void GetAbsoluteInterval(double &theMin, double &theMax, double &theYMax) const
void SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist=nullptr)
void SetLineStyle(Style_t style, const SamplingDistribution *samplDist=nullptr)
double AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, double minShaded, double maxShaded, Option_t *drawOptions="NORMALIZE HIST")
Like AddSamplingDistribution, but also sets a shaded area in the minShaded and maxShaded boundaries.
void SetMarkerColor(Color_t color, const SamplingDistribution *samplDist=nullptr)
std::vector< double > fSampleWeights
void AddLine(double x1, double y1, double x2, double y2, const char *title=nullptr)
add a line
void SetLineColor(Color_t color, const SamplingDistribution *samplDist=nullptr)
Sets line color for given sampling distribution and fill color for the associated shaded TH1F.
void ApplyDefaultStyle(void)
Applies a predefined style if fApplyStyle is true (default).
void AddTH1(TH1 *h, Option_t *drawOptions="")
add a TH1
std::vector< double > fSamplingDistr
void AddTF1(TF1 *f, const char *title=nullptr, Option_t *drawOptions="SAME")
add a TF1
double AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST")
adds the sampling distribution and returns the scale factor
void addOtherObject(TObject *obj, Option_t *drawOptions=nullptr)
Add a generic object to this plot.
void addObject(TObject *obj, Option_t *drawOptions=nullptr)
Add a generic object to this plot.
void SetMarkerSize(Size_t size, const SamplingDistribution *samplDist=nullptr)
TH1F * GetTH1F(const SamplingDistribution *samplDist=nullptr)
Returns the TH1F associated with the give SamplingDistribution.
SamplingDistPlot(Int_t nbins=100)
Constructors for SamplingDistribution.
void SetXRange(double mi, double ma)
change x range
void SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist=nullptr)
TList fOtherItems
other objects to be drawn like TLine etc.
This class simply holds a sampling distribution of some test statistic.
const std::vector< double > & GetSampleWeights() const
Get the sampling weights.
const std::vector< double > & GetSamplingDistribution() const
Get test statistics values.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:42
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:45
Bool_t cd() override
Change current directory to "this" directory.
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
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:936
1-D histogram with a float per channel (see TH1 documentation)}
Definition TH1.h:577
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8854
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition TH1.cxx:9058
Option_t * GetOption() const override
Definition TH1.h:301
TAxis * GetXaxis()
Definition TH1.h:322
virtual Int_t GetNbinsX() const
Definition TH1.h:295
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:400
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3345
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:401
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7858
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Definition TH1.cxx:9139
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
Rebin this histogram.
Definition TH1.cxx:6264
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6593
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2734
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:8937
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8907
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition TLegend.cxx:317
Use the TLine constructor to create a simple line.
Definition TLine.h:22
void Add(TObject *obj) override
Definition TList.h:81
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:470
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
TString fName
Definition TNamed.h:32
Mother of all ROOT objects.
Definition TObject.h:41
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition TObject.cxx:223
virtual Option_t * GetOption() const
Definition TObject.h:139
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:880
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:483
virtual void SetBorderSize(Int_t bordersize=4)
Definition TPave.h:73
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition TString.cxx:1151
const char * Data() const
Definition TString.h:380
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
void ToUpper()
Change string to upper case.
Definition TString.cxx:1183
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:636
Int_t GetOptLogy() const
Definition TStyle.h:246
void SetPadBorderMode(Int_t mode=1)
Definition TStyle.h:354
void SetOptLogx(Int_t logx=1)
Definition TStyle.h:327
void SetCanvasColor(Color_t color=19)
Definition TStyle.h:341
void SetCanvasBorderMode(Int_t mode=1)
Definition TStyle.h:343
void SetFrameFillStyle(Style_t styl=0)
Definition TStyle.h:371
void SetFrameBorderMode(Int_t mode=1)
Definition TStyle.h:375
void SetOptLogy(Int_t logy=1)
Definition TStyle.h:328
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
Definition TStyle.cxx:1700
void SetStatColor(Color_t color=19)
Definition TStyle.h:387
void SetPadColor(Color_t color=19)
Definition TStyle.h:352
Int_t GetOptLogx() const
Definition TStyle.h:245
TLine * line
Namespace for the RooStats classes.
Definition Asimov.h:19
Bool_t IsNaN(Double_t x)
Definition TMath.h:892
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
Definition TMath.h:917