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 std::cout, std::endl, std::string;
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
80 double xmin(TMath::Infinity());
81 double xmax(-TMath::Infinity());
82 // remove cases where xmin and xmax are +/- inf
83 for( unsigned int i=0; i < fSamplingDistr.size(); i++ ) {
84 if( fSamplingDistr[i] < xmin && fSamplingDistr[i] != -TMath::Infinity() ) {
86 }
89 }
90 }
91 if( xmin >= xmax ) {
92 coutW(Plotting) << "Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
93 xmin = -1.0;
94 xmax = 1.0;
95 }
96
97
98 // add 1.5 bins left and right
99 assert(fBins > 1);
100 double binWidth = (xmax-xmin)/(fBins);
101 double xlow = xmin - 1.5*binWidth;
102 double xup = xmax + 1.5*binWidth;
103 if( !TMath::IsNaN(fXMin) ) xlow = fXMin;
104 if( !TMath::IsNaN(fXMax) ) xup = fXMax;
105
106 fHist = new TH1F(samplingDist->GetName(), samplingDist->GetTitle(), fBins, xlow, xup);
107 fHist->SetDirectory(nullptr); // make the object managed by this class
108
109 if( fVarName.Length() == 0 ) fVarName = samplingDist->GetVarName();
111
112
113 std::vector<double>::iterator valuesIt = fSamplingDistr.begin();
114 for (int w_idx = 0; valuesIt != fSamplingDistr.end(); ++valuesIt, ++w_idx) {
115 if (fIsWeighted) fHist->Fill(*valuesIt, fSampleWeights[w_idx]);
116 else fHist->Fill(*valuesIt);
117 }
118
119 // NORMALIZATION
120 fHist->Sumw2();
121 double weightSum = 1.0;
122 if(options.Contains("NORMALIZE")) {
123 weightSum = fHist->Integral("width");
124 fHist->Scale(1./weightSum);
125
126 options.ReplaceAll("NORMALIZE", "");
127 options.Strip();
128 }
129
130
131 //some basic aesthetics
135
136 fMarkerType++;
137 fColor++;
138
139 fHist->SetStats(false);
140
141 addObject(fHist, options.Data());
142
143 TString title = samplingDist->GetTitle();
144 if(fLegend && title.Length() > 0) fLegend->AddEntry(fHist, title, "L");
145
146 return 1./weightSum;
147}
148
149////////////////////////////////////////////////////////////////////////////////
150
151double SamplingDistPlot::AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, double minShaded, double maxShaded, Option_t *drawOptions) {
152 if( samplingDist->GetSamplingDistribution().empty() ) {
153 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
154 return 0.0;
155 }
156 double scaleFactor = AddSamplingDistribution(samplingDist, drawOptions);
157
158 TH1F *shaded = static_cast<TH1F*>(fHist->Clone((string(samplingDist->GetName())+string("_shaded")).c_str()));
159 shaded->SetDirectory(nullptr);
160 shaded->SetFillStyle(fFillStyle++);
161 shaded->SetLineWidth(1);
162
163 for (int i=0; i<shaded->GetNbinsX(); ++i) {
164 if (shaded->GetBinCenter(i) < minShaded || shaded->GetBinCenter(i) > maxShaded){
165 shaded->SetBinContent(i,0);
166 }
167 }
168
169 TString options(drawOptions);
170 options.ToUpper();
171 if(options.Contains("NORMALIZE")) {
172 options.ReplaceAll("NORMALIZE", "");
173 options.Strip();
174 }
175 addObject(shaded, options.Data());
176
177 return scaleFactor;
178}
179
180////////////////////////////////////////////////////////////////////////////////
181
182void SamplingDistPlot::AddLine(double x1, double y1, double x2, double y2, const char* title) {
183 TLine *line = new TLine(x1, y1, x2, y2);
184 line->SetLineWidth(3);
186
187 if(fLegend && title) fLegend->AddEntry(line, title, "L");
188
189 addOtherObject(line, ""); // no options
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// add an histogram (it will be cloned);
194
196 if(fLegend && h->GetTitle()) fLegend->AddEntry(h, h->GetTitle(), "L");
197 TH1 * hcopy = static_cast<TH1*>(h->Clone());
198 hcopy->SetDirectory(nullptr);
199 addObject(hcopy, drawOptions);
200}
201void SamplingDistPlot::AddTF1(TF1* f, const char* title, Option_t *drawOptions) {
202 if(fLegend && title) fLegend->AddEntry(f, title, "L");
203 addOtherObject(f->Clone(), drawOptions);
204}
205
206////////////////////////////////////////////////////////////////////////////////
207///Determine if the sampling distribution has weights and store them
208
210{
211 fIsWeighted = false;
212
213 if(!samplingDist->GetSampleWeights().empty()){
214 fIsWeighted = true;
215 fSampleWeights = samplingDist->GetSampleWeights();
216 }
217
218 return;
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Add a generic object to this plot. The specified options will be
223/// used to Draw() this object later. The caller transfers ownership
224/// of the object with this call, and the object will be deleted
225/// when its containing plot object is destroyed.
226
228{
229
230 if(nullptr == obj) {
231 std::cerr << fName << "::addObject: called with a null pointer" << std::endl;
232 return;
233 }
234
235 fItems.Add(obj,drawOptions);
236
237 return;
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Add a generic object to this plot. The specified options will be
242/// used to Draw() this object later. The caller transfers ownership
243/// of the object with this call, and the object will be deleted
244/// when its containing plot object is destroyed.
245
247{
248 if(nullptr == obj) {
249 coutE(InputArguments) << fName << "::addOtherObject: called with a null pointer" << std::endl;
250 return;
251 }
252
253 fOtherItems.Add(obj,drawOptions);
254
255 return;
256}
257
258////////////////////////////////////////////////////////////////////////////////
259/// Draw this plot and all of the elements it contains. The specified options
260/// only apply to the drawing of our frame. The options specified in our add...()
261/// methods will be used to draw each object we contain.
262
263void SamplingDistPlot::Draw(Option_t * /*options */) {
265
266 double theMin(0.);
267 double theMax(0.);
268 double theYMin(std::numeric_limits<float>::quiet_NaN());
269 double theYMax(0.);
270 GetAbsoluteInterval(theMin, theMax, theYMax);
271 if( !TMath::IsNaN(fXMin) ) theMin = fXMin;
272 if( !TMath::IsNaN(fXMax) ) theMax = fXMax;
273 if( !TMath::IsNaN(fYMin) ) theYMin = fYMin;
274 if( !TMath::IsNaN(fYMax) ) theYMax = fYMax;
275
276 RooRealVar xaxis("xaxis", fVarName.Data(), theMin, theMax);
277
278 //L.M. by drawing many times we create a memory leak ???
279 if (fRooPlot) delete fRooPlot;
280
281 bool dirStatus = RooPlot::addDirectoryStatus();
282 // make the RooPlot managed by this class
284 fRooPlot = xaxis.frame();
286 if (!fRooPlot) {
287 coutE(InputArguments) << "invalid variable to plot" << std::endl;
288 return;
289 }
290 fRooPlot->SetTitle("");
291 if( !TMath::IsNaN(theYMax) ) {
292 //coutI(InputArguments) << "Setting maximum to " << theYMax << endl;
293 fRooPlot->SetMaximum(theYMax);
294 }
295 if( !TMath::IsNaN(theYMin) ) {
296 //coutI(InputArguments) << "Setting minimum to " << theYMin << endl;
297 fRooPlot->SetMinimum(theYMin);
298 }
299
300 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
301 //obj->Draw(fIterator->GetOption());
302 // add cloned objects to avoid mem leaks
303 TH1 * cloneObj = static_cast<TH1*>(obj->Clone());
304 if( !TMath::IsNaN(theYMax) ) {
305 //coutI(InputArguments) << "Setting maximum of TH1 to " << theYMax << endl;
306 cloneObj->SetMaximum(theYMax);
307 }
308 if( !TMath::IsNaN(theYMin) ) {
309 //coutI(InputArguments) << "Setting minimum of TH1 to " << theYMin << endl;
310 cloneObj->SetMinimum(theYMin);
311 }
312 cloneObj->SetDirectory(nullptr); // transfer ownership of the object
313 fRooPlot->addTH1(cloneObj, obj->GetOption());
314 }
315
316 for(TObject * otherObj : fOtherItems) {
317 TObject * cloneObj = otherObj->Clone();
318 fRooPlot->addObject(cloneObj, otherObj->GetOption());
319 }
320
321
323
324 if(bool(gStyle->GetOptLogx()) != fLogXaxis) {
325 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogx(...)" << endl;
327 }
328 if(bool(gStyle->GetOptLogy()) != fLogYaxis) {
329 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogy(...)" << endl;
331 }
332 fRooPlot->Draw();
333
334 // apply this since gStyle does not work for RooPlot
335 if (gPad) {
336 gPad->SetLogx(fLogXaxis);
337 gPad->SetLogy(fLogYaxis);
338 }
339
340 return;
341}
342
343////////////////////////////////////////////////////////////////////////////////
344
346 if(fApplyStyle) {
347 // use plain black on white colors
348 Int_t icol = 0;
349 gStyle->SetFrameBorderMode( icol );
351 gStyle->SetPadBorderMode( icol );
352 gStyle->SetPadColor( icol );
353 gStyle->SetCanvasColor( icol );
354 gStyle->SetStatColor( icol );
356
357 // set the paper & margin sizes
358 gStyle->SetPaperSize( 20, 26 );
359
360 if(fLegend) {
363 }
364 }
365}
366
367////////////////////////////////////////////////////////////////////////////////
368
369void SamplingDistPlot::GetAbsoluteInterval(double &theMin, double &theMax, double &theYMax) const
370{
371 double tmpmin = TMath::Infinity();
372 double tmpmax = -TMath::Infinity();
373 double tmpYmax = -TMath::Infinity();
374
375 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
376 if(obj->GetXaxis()->GetXmin() < tmpmin) tmpmin = obj->GetXaxis()->GetXmin();
377 if(obj->GetXaxis()->GetXmax() > tmpmax) tmpmax = obj->GetXaxis()->GetXmax();
378 if(obj->GetMaximum() > tmpYmax) tmpYmax = obj->GetMaximum() + 0.1*obj->GetMaximum();
379 }
380
381 theMin = tmpmin;
382 theMax = tmpmax;
383 theYMax = tmpYmax;
384
385 return;
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// Sets line color for given sampling distribution and
390/// fill color for the associated shaded TH1F.
391
393 if (samplDist == nullptr) {
394 fHist->SetLineColor(color);
395
396 TString shadedName(fHist->GetName());
397 shadedName += "_shaded";
398
399 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
400 if (!strcmp(obj->GetName(), shadedName.Data())) {
401 obj->SetLineColor(color);
402 obj->SetFillColor(color);
403 //break;
404 }
405 }
406 } else {
407
408 TString shadedName(samplDist->GetName());
409 shadedName += "_shaded";
410
411 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
412 if (!strcmp(obj->GetName(), samplDist->GetName())) {
413 obj->SetLineColor(color);
414 //break;
415 }
416 if (!strcmp(obj->GetName(), shadedName.Data())) {
417 obj->SetLineColor(color);
418 obj->SetFillColor(color);
419 //break;
420 }
421 }
422 }
423
424 return;
425}
426
427////////////////////////////////////////////////////////////////////////////////
428
430{
431 if(samplDist == nullptr){
432 fHist->SetLineWidth(lwidth);
433 }
434 else{
435 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
436 if(!strcmp(obj->GetName(),samplDist->GetName())){
437 obj->SetLineWidth(lwidth);
438 break;
439 }
440 }
441 }
442
443 return;
444}
445
446////////////////////////////////////////////////////////////////////////////////
447
449{
450 if(samplDist == nullptr){
452 }
453 else{
454 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
455 if(!strcmp(obj->GetName(),samplDist->GetName())){
456 obj->SetLineStyle(style);
457 break;
458 }
459 }
460 }
461
462 return;
463}
464
465////////////////////////////////////////////////////////////////////////////////
466
468{
469 if(samplDist == nullptr){
471 }
472 else{
473 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
474 if(!strcmp(obj->GetName(),samplDist->GetName())){
475 obj->SetMarkerStyle(style);
476 break;
477 }
478 }
479 }
480
481 return;
482}
483
484////////////////////////////////////////////////////////////////////////////////
485
487{
488 if(samplDist == nullptr){
489 fHist->SetMarkerColor(color);
490 }
491 else{
492 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
493 if(!strcmp(obj->GetName(),samplDist->GetName())){
494 obj->SetMarkerColor(color);
495 break;
496 }
497 }
498 }
499
500 return;
501}
502
503////////////////////////////////////////////////////////////////////////////////
504
506{
507 if(samplDist == nullptr){
509 }
510 else{
511 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
512 if(!strcmp(obj->GetName(),samplDist->GetName())){
513 obj->SetMarkerSize(size);
514 break;
515 }
516 }
517 }
518
519 return;
520}
521
522////////////////////////////////////////////////////////////////////////////////
523
525{
526 if(samplDist == nullptr){
527 return fHist;
528 }else{
529 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
530 if(!strcmp(obj->GetName(),samplDist->GetName())){
531 return obj;
532 }
533 }
534 }
535
536 return nullptr;
537}
538
539////////////////////////////////////////////////////////////////////////////////
540
542{
543 if(samplDist == nullptr){
544 fHist->Rebin(rebinFactor);
545 }
546 else{
547 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
548 if(!strcmp(obj->GetName(),samplDist->GetName())){
549 obj->Rebin(rebinFactor);
550 break;
551 }
552 }
553 }
554
555 return;
556}
557
558////////////////////////////////////////////////////////////////////////////////
559/// TODO test
560
561void SamplingDistPlot::DumpToFile(const char* RootFileName, Option_t *option, const char *ftitle, Int_t compress) {
562 // All the objects are written to rootfile
563
564 if(!fRooPlot) {
565 cout << "Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
566 return;
567 }
568
569 TFile ofile(RootFileName, option, ftitle, compress);
570 ofile.cd();
571 fRooPlot->Write();
572 ofile.Close();
573}
#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:1255
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition RooPlot.cxx:378
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:397
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
Definition RooPlot.cxx:1059
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:1049
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Definition RooPlot.cxx:649
static bool setAddDirectoryStatus(bool flag)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:80
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: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
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:943
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:621
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
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:8905
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition TH1.cxx:9109
Option_t * GetOption() const override
Definition TH1.h:303
TAxis * GetXaxis()
Definition TH1.h:324
virtual Int_t GetNbinsX() const
Definition TH1.h:297
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:403
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3344
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:404
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7909
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:9190
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
Rebin this histogram.
Definition TH1.cxx:6243
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6572
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2752
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:8988
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8958
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:468
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)
Sets the border size of the TPave box and shadow.
Definition TPave.h:77
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition TString.cxx:1163
const char * Data() const
Definition TString.h:376
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
void ToUpper()
Change string to upper case.
Definition TString.cxx:1195
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
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