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 <limits>
36#define NaN std::numeric_limits<float>::quiet_NaN()
37#include "TMath.h"
38#define IsNaN(a) TMath::IsNaN(a)
39
41
42using namespace RooStats;
43using namespace std;
44
45////////////////////////////////////////////////////////////////////////////////
46/// SamplingDistPlot default constructor with bin size
47
49 fHist(0),
50 fLegend(nullptr),
51 fItems(),
52 fOtherItems(),
53 fRooPlot(nullptr),
54 fLogXaxis(false),
55 fLogYaxis(false),
56 fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
57 fApplyStyle(true),
58 fFillStyle(3004)
59{
60 fIsWeighted = false;
61 fBins = nbins;
62 fMarkerType = 20;
63 fColor = 1;
64}
65
66////////////////////////////////////////////////////////////////////////////////
67/// SamplingDistPlot constructor with bin size, min and max
68
69SamplingDistPlot::SamplingDistPlot(Int_t nbins, double min, double max) :
70 fHist(0),
71 fLegend(nullptr),
72 fItems(),
73 fOtherItems(),
74 fRooPlot(nullptr),
75 fLogXaxis(false),
76 fLogYaxis(false),
77 fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
78 fApplyStyle(true),
79 fFillStyle(3004)
80{
81 fIsWeighted = false;
82 fBins = nbins;
83 fMarkerType = 20;
84 fColor = 1;
85
86 SetXRange( min, max );
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// destructors - delete objects contained in the list
91
93{
94 fItems.Delete();
96 if (fRooPlot) delete fRooPlot;
97}
98
99
100////////////////////////////////////////////////////////////////////////////////
101/// adds sampling distribution (and normalizes if "NORMALIZE" is given as an option)
102
104 fSamplingDistr = samplingDist->GetSamplingDistribution();
105 if( fSamplingDistr.empty() ) {
106 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
107 return 0.0;
108 }
109 SetSampleWeights(samplingDist);
110
111 TString options(drawOptions);
112 options.ToUpper();
113
115 // remove cases where xmin and xmax are +/- inf
116 for( unsigned int i=0; i < fSamplingDistr.size(); i++ ) {
117 if( fSamplingDistr[i] < xmin && fSamplingDistr[i] != -TMath::Infinity() ) {
118 xmin = fSamplingDistr[i];
119 }
120 if( fSamplingDistr[i] > xmax && fSamplingDistr[i] != TMath::Infinity() ) {
121 xmax = fSamplingDistr[i];
122 }
123 }
124 if( xmin >= xmax ) {
125 coutW(Plotting) << "Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
126 xmin = -1.0;
127 xmax = 1.0;
128 }
129
130
131 // add 1.5 bins left and right
132 assert(fBins > 1);
133 double binWidth = (xmax-xmin)/(fBins);
134 double xlow = xmin - 1.5*binWidth;
135 double xup = xmax + 1.5*binWidth;
136 if( !IsNaN(fXMin) ) xlow = fXMin;
137 if( !IsNaN(fXMax) ) xup = fXMax;
138
139 fHist = new TH1F(samplingDist->GetName(), samplingDist->GetTitle(), fBins, xlow, xup);
140 fHist->SetDirectory(0); // make the object managed by this class
141
142 if( fVarName.Length() == 0 ) fVarName = samplingDist->GetVarName();
144
145
146 std::vector<double>::iterator valuesIt = fSamplingDistr.begin();
147 for (int w_idx = 0; valuesIt != fSamplingDistr.end(); ++valuesIt, ++w_idx) {
148 if (fIsWeighted) fHist->Fill(*valuesIt, fSampleWeights[w_idx]);
149 else fHist->Fill(*valuesIt);
150 }
151
152 // NORMALIZATION
153 fHist->Sumw2();
154 double weightSum = 1.0;
155 if(options.Contains("NORMALIZE")) {
156 weightSum = fHist->Integral("width");
157 fHist->Scale(1./weightSum);
158
159 options.ReplaceAll("NORMALIZE", "");
160 options.Strip();
161 }
162
163
164 //some basic aesthetics
168
169 fMarkerType++;
170 fColor++;
171
172 fHist->SetStats(false);
173
174 addObject(fHist, options.Data());
175
176 TString title = samplingDist->GetTitle();
177 if(fLegend && title.Length() > 0) fLegend->AddEntry(fHist, title, "L");
178
179 return 1./weightSum;
180}
181
182////////////////////////////////////////////////////////////////////////////////
183
184double SamplingDistPlot::AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, double minShaded, double maxShaded, Option_t *drawOptions) {
185 if( samplingDist->GetSamplingDistribution().empty() ) {
186 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
187 return 0.0;
188 }
189 double scaleFactor = AddSamplingDistribution(samplingDist, drawOptions);
190
191 TH1F *shaded = (TH1F*)fHist->Clone((string(samplingDist->GetName())+string("_shaded")).c_str());
192 shaded->SetDirectory(0);
193 shaded->SetFillStyle(fFillStyle++);
194 shaded->SetLineWidth(1);
195
196 for (int i=0; i<shaded->GetNbinsX(); ++i) {
197 if (shaded->GetBinCenter(i) < minShaded || shaded->GetBinCenter(i) > maxShaded){
198 shaded->SetBinContent(i,0);
199 }
200 }
201
202 TString options(drawOptions);
203 options.ToUpper();
204 if(options.Contains("NORMALIZE")) {
205 options.ReplaceAll("NORMALIZE", "");
206 options.Strip();
207 }
208 addObject(shaded, options.Data());
209
210 return scaleFactor;
211}
212
213////////////////////////////////////////////////////////////////////////////////
214
215void SamplingDistPlot::AddLine(double x1, double y1, double x2, double y2, const char* title) {
216 TLine *line = new TLine(x1, y1, x2, y2);
217 line->SetLineWidth(3);
219
220 if(fLegend && title) fLegend->AddEntry(line, title, "L");
221
222 addOtherObject(line, ""); // no options
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// add an histogram (it will be cloned);
227
229 if(fLegend && h->GetTitle()) fLegend->AddEntry(h, h->GetTitle(), "L");
230 TH1 * hcopy = (TH1*) h->Clone();
231 hcopy->SetDirectory(0);
232 addObject(hcopy, drawOptions);
233}
234void SamplingDistPlot::AddTF1(TF1* f, const char* title, Option_t *drawOptions) {
235 if(fLegend && title) fLegend->AddEntry(f, title, "L");
236 addOtherObject(f->Clone(), drawOptions);
237}
238
239////////////////////////////////////////////////////////////////////////////////
240///Determine if the sampling distribution has weights and store them
241
243{
244 fIsWeighted = false;
245
246 if(!samplingDist->GetSampleWeights().empty()){
247 fIsWeighted = true;
248 fSampleWeights = samplingDist->GetSampleWeights();
249 }
250
251 return;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Add a generic object to this plot. The specified options will be
256/// used to Draw() this object later. The caller transfers ownership
257/// of the object with this call, and the object will be deleted
258/// when its containing plot object is destroyed.
259
261{
262
263 if(0 == obj) {
264 std::cerr << fName << "::addObject: called with a null pointer" << std::endl;
265 return;
266 }
267
268 fItems.Add(obj,drawOptions);
269
270 return;
271}
272
273////////////////////////////////////////////////////////////////////////////////
274/// Add a generic object to this plot. The specified options will be
275/// used to Draw() this object later. The caller transfers ownership
276/// of the object with this call, and the object will be deleted
277/// when its containing plot object is destroyed.
278
280{
281 if(0 == obj) {
282 coutE(InputArguments) << fName << "::addOtherObject: called with a null pointer" << std::endl;
283 return;
284 }
285
286 fOtherItems.Add(obj,drawOptions);
287
288 return;
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Draw this plot and all of the elements it contains. The specified options
293/// only apply to the drawing of our frame. The options specified in our add...()
294/// methods will be used to draw each object we contain.
295
296void SamplingDistPlot::Draw(Option_t * /*options */) {
298
299 double theMin(0.), theMax(0.), theYMin(NaN), theYMax(0.);
300 GetAbsoluteInterval(theMin, theMax, theYMax);
301 if( !IsNaN(fXMin) ) theMin = fXMin;
302 if( !IsNaN(fXMax) ) theMax = fXMax;
303 if( !IsNaN(fYMin) ) theYMin = fYMin;
304 if( !IsNaN(fYMax) ) theYMax = fYMax;
305
306 RooRealVar xaxis("xaxis", fVarName.Data(), theMin, theMax);
307
308 //L.M. by drawing many times we create a memory leak ???
309 if (fRooPlot) delete fRooPlot;
310
311 bool dirStatus = RooPlot::addDirectoryStatus();
312 // make the RooPlot managed by this class
314 fRooPlot = xaxis.frame();
316 if (!fRooPlot) {
317 coutE(InputArguments) << "invalid variable to plot" << std::endl;
318 return;
319 }
320 fRooPlot->SetTitle("");
321 if( !IsNaN(theYMax) ) {
322 //coutI(InputArguments) << "Setting maximum to " << theYMax << endl;
323 fRooPlot->SetMaximum(theYMax);
324 }
325 if( !IsNaN(theYMin) ) {
326 //coutI(InputArguments) << "Setting minimum to " << theYMin << endl;
327 fRooPlot->SetMinimum(theYMin);
328 }
329
330 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
331 //obj->Draw(fIterator->GetOption());
332 // add cloned objects to avoid mem leaks
333 TH1 * cloneObj = (TH1*)obj->Clone();
334 if( !IsNaN(theYMax) ) {
335 //coutI(InputArguments) << "Setting maximum of TH1 to " << theYMax << endl;
336 cloneObj->SetMaximum(theYMax);
337 }
338 if( !IsNaN(theYMin) ) {
339 //coutI(InputArguments) << "Setting minimum of TH1 to " << theYMin << endl;
340 cloneObj->SetMinimum(theYMin);
341 }
342 cloneObj->SetDirectory(0); // transfer ownership of the object
343 fRooPlot->addTH1(cloneObj, obj->GetOption());
344 }
345
346 for(TObject * otherObj : fOtherItems) {
347 TObject * cloneObj = otherObj->Clone();
348 fRooPlot->addObject(cloneObj, otherObj->GetOption());
349 }
350
351
353
354 if(bool(gStyle->GetOptLogx()) != fLogXaxis) {
355 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogx(...)" << endl;
357 }
358 if(bool(gStyle->GetOptLogy()) != fLogYaxis) {
359 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogy(...)" << endl;
361 }
362 fRooPlot->Draw();
363
364 // apply this since gStyle does not work for RooPlot
365 if (gPad) {
366 gPad->SetLogx(fLogXaxis);
367 gPad->SetLogy(fLogYaxis);
368 }
369
370 return;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374
376 if(fApplyStyle) {
377 // use plain black on white colors
378 Int_t icol = 0;
379 gStyle->SetFrameBorderMode( icol );
381 gStyle->SetPadBorderMode( icol );
382 gStyle->SetPadColor( icol );
383 gStyle->SetCanvasColor( icol );
384 gStyle->SetStatColor( icol );
386
387 // set the paper & margin sizes
388 gStyle->SetPaperSize( 20, 26 );
389
390 if(fLegend) {
393 }
394 }
395}
396
397////////////////////////////////////////////////////////////////////////////////
398
399void SamplingDistPlot::GetAbsoluteInterval(double &theMin, double &theMax, double &theYMax) const
400{
401 double tmpmin = TMath::Infinity();
402 double tmpmax = -TMath::Infinity();
403 double tmpYmax = -TMath::Infinity();
404
405 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
406 if(obj->GetXaxis()->GetXmin() < tmpmin) tmpmin = obj->GetXaxis()->GetXmin();
407 if(obj->GetXaxis()->GetXmax() > tmpmax) tmpmax = obj->GetXaxis()->GetXmax();
408 if(obj->GetMaximum() > tmpYmax) tmpYmax = obj->GetMaximum() + 0.1*obj->GetMaximum();
409 }
410
411 theMin = tmpmin;
412 theMax = tmpmax;
413 theYMax = tmpYmax;
414
415 return;
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Sets line color for given sampling distribution and
420/// fill color for the associated shaded TH1F.
421
423 if (samplDist == 0) {
424 fHist->SetLineColor(color);
425
426 TString shadedName(fHist->GetName());
427 shadedName += "_shaded";
428
429 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
430 if (!strcmp(obj->GetName(), shadedName.Data())) {
431 obj->SetLineColor(color);
432 obj->SetFillColor(color);
433 //break;
434 }
435 }
436 } else {
437
438 TString shadedName(samplDist->GetName());
439 shadedName += "_shaded";
440
441 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
442 if (!strcmp(obj->GetName(), samplDist->GetName())) {
443 obj->SetLineColor(color);
444 //break;
445 }
446 if (!strcmp(obj->GetName(), shadedName.Data())) {
447 obj->SetLineColor(color);
448 obj->SetFillColor(color);
449 //break;
450 }
451 }
452 }
453
454 return;
455}
456
457////////////////////////////////////////////////////////////////////////////////
458
460{
461 if(samplDist == 0){
462 fHist->SetLineWidth(lwidth);
463 }
464 else{
465 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
466 if(!strcmp(obj->GetName(),samplDist->GetName())){
467 obj->SetLineWidth(lwidth);
468 break;
469 }
470 }
471 }
472
473 return;
474}
475
476////////////////////////////////////////////////////////////////////////////////
477
479{
480 if(samplDist == 0){
482 }
483 else{
484 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
485 if(!strcmp(obj->GetName(),samplDist->GetName())){
486 obj->SetLineStyle(style);
487 break;
488 }
489 }
490 }
491
492 return;
493}
494
495////////////////////////////////////////////////////////////////////////////////
496
498{
499 if(samplDist == 0){
501 }
502 else{
503 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
504 if(!strcmp(obj->GetName(),samplDist->GetName())){
505 obj->SetMarkerStyle(style);
506 break;
507 }
508 }
509 }
510
511 return;
512}
513
514////////////////////////////////////////////////////////////////////////////////
515
517{
518 if(samplDist == 0){
519 fHist->SetMarkerColor(color);
520 }
521 else{
522 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
523 if(!strcmp(obj->GetName(),samplDist->GetName())){
524 obj->SetMarkerColor(color);
525 break;
526 }
527 }
528 }
529
530 return;
531}
532
533////////////////////////////////////////////////////////////////////////////////
534
536{
537 if(samplDist == 0){
539 }
540 else{
541 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
542 if(!strcmp(obj->GetName(),samplDist->GetName())){
543 obj->SetMarkerSize(size);
544 break;
545 }
546 }
547 }
548
549 return;
550}
551
552////////////////////////////////////////////////////////////////////////////////
553
555{
556 if(samplDist == nullptr){
557 return fHist;
558 }else{
559 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
560 if(!strcmp(obj->GetName(),samplDist->GetName())){
561 return obj;
562 }
563 }
564 }
565
566 return nullptr;
567}
568
569////////////////////////////////////////////////////////////////////////////////
570
572{
573 if(samplDist == 0){
574 fHist->Rebin(rebinFactor);
575 }
576 else{
577 for(auto * obj : static_range_cast<TH1F*>(fItems)) {
578 if(!strcmp(obj->GetName(),samplDist->GetName())){
579 obj->Rebin(rebinFactor);
580 break;
581 }
582 }
583 }
584
585 return;
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// TODO test
590
591void SamplingDistPlot::DumpToFile(const char* RootFileName, Option_t *option, const char *ftitle, Int_t compress) {
592 // All the objects are written to rootfile
593
594 if(!fRooPlot) {
595 cout << "Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
596 return;
597 }
598
599 TFile ofile(RootFileName, option, ftitle, compress);
600 ofile.cd();
601 fRooPlot->Write();
602 ofile.Close();
603}
#define IsNaN(a)
#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 NaN
#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
#define NaN
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:414
#define gPad
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) 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:380
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:399
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
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
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:213
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition TFile.h:51
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:914
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:8803
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition TH1.cxx:9007
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:3338
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:7851
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:9088
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
Rebin this histogram.
Definition TH1.cxx:6257
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6586
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2727
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:8886
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8856
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:874
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:240
void SetPadBorderMode(Int_t mode=1)
Definition TStyle.h:341
void SetOptLogx(Int_t logx=1)
Definition TStyle.h:314
void SetCanvasColor(Color_t color=19)
Definition TStyle.h:328
void SetCanvasBorderMode(Int_t mode=1)
Definition TStyle.h:330
void SetFrameFillStyle(Style_t styl=0)
Definition TStyle.h:358
void SetFrameBorderMode(Int_t mode=1)
Definition TStyle.h:362
void SetOptLogy(Int_t logy=1)
Definition TStyle.h:315
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
Definition TStyle.cxx:1653
void SetStatColor(Color_t color=19)
Definition TStyle.h:374
void SetPadColor(Color_t color=19)
Definition TStyle.h:339
Int_t GetOptLogx() const
Definition TStyle.h:239
TLine * line
Namespace for the RooStats classes.
Definition Asimov.h:19
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
Definition TMath.h:915