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(NULL),
51 fItems(),
52 fOtherItems(),
53 fRooPlot(NULL),
54 fLogXaxis(kFALSE),
55 fLogYaxis(kFALSE),
56 fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
57 fApplyStyle(kTRUE),
58 fFillStyle(3004)
59{
62 fBins = nbins;
63 fMarkerType = 20;
64 fColor = 1;
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// SamplingDistPlot constructor with bin size, min and max
69
71 fHist(0),
72 fLegend(NULL),
73 fItems(),
74 fOtherItems(),
75 fRooPlot(NULL),
76 fLogXaxis(kFALSE),
77 fLogYaxis(kFALSE),
78 fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
79 fApplyStyle(kTRUE),
80 fFillStyle(3004)
81{
84 fBins = nbins;
85 fMarkerType = 20;
86 fColor = 1;
87
88 SetXRange( min, max );
89}
90
91////////////////////////////////////////////////////////////////////////////////
92/// destructors - delete objects contained in the list
93
95{
96 fItems.Delete();
98 if (fRooPlot) delete fRooPlot;
99 if (fIterator) delete fIterator;
100}
101
102
103////////////////////////////////////////////////////////////////////////////////
104/// adds sampling distribution (and normalizes if "NORMALIZE" is given as an option)
105
107 fSamplingDistr = samplingDist->GetSamplingDistribution();
108 if( fSamplingDistr.empty() ) {
109 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
110 return 0.0;
111 }
112 SetSampleWeights(samplingDist);
113
114 TString options(drawOptions);
115 options.ToUpper();
116
118 // remove cases where xmin and xmax are +/- inf
119 for( unsigned int i=0; i < fSamplingDistr.size(); i++ ) {
120 if( fSamplingDistr[i] < xmin && fSamplingDistr[i] != -TMath::Infinity() ) {
121 xmin = fSamplingDistr[i];
122 }
123 if( fSamplingDistr[i] > xmax && fSamplingDistr[i] != TMath::Infinity() ) {
124 xmax = fSamplingDistr[i];
125 }
126 }
127 if( xmin >= xmax ) {
128 coutW(Plotting) << "Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
129 xmin = -1.0;
130 xmax = 1.0;
131 }
132
133
134 // add 1.5 bins left and right
135 assert(fBins > 1);
136 double binWidth = (xmax-xmin)/(fBins);
137 Double_t xlow = xmin - 1.5*binWidth;
138 Double_t xup = xmax + 1.5*binWidth;
139 if( !IsNaN(fXMin) ) xlow = fXMin;
140 if( !IsNaN(fXMax) ) xup = fXMax;
141
142 fHist = new TH1F(samplingDist->GetName(), samplingDist->GetTitle(), fBins, xlow, xup);
143 fHist->SetDirectory(0); // make the object managed by this class
144
145 if( fVarName.Length() == 0 ) fVarName = samplingDist->GetVarName();
147
148
149 std::vector<Double_t>::iterator valuesIt = fSamplingDistr.begin();
150 for (int w_idx = 0; valuesIt != fSamplingDistr.end(); ++valuesIt, ++w_idx) {
151 if (fIsWeighted) fHist->Fill(*valuesIt, fSampleWeights[w_idx]);
152 else fHist->Fill(*valuesIt);
153 }
154
155 // NORMALIZATION
156 fHist->Sumw2();
157 double weightSum = 1.0;
158 if(options.Contains("NORMALIZE")) {
159 weightSum = fHist->Integral("width");
160 fHist->Scale(1./weightSum);
161
162 options.ReplaceAll("NORMALIZE", "");
163 options.Strip();
164 }
165
166
167 //some basic aesthetics
171
172 fMarkerType++;
173 fColor++;
174
176
177 addObject(fHist, options.Data());
178
179 TString title = samplingDist->GetTitle();
180 if(fLegend && title.Length() > 0) fLegend->AddEntry(fHist, title, "L");
181
182 return 1./weightSum;
183}
184
185////////////////////////////////////////////////////////////////////////////////
186
188 if( samplingDist->GetSamplingDistribution().empty() ) {
189 coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
190 return 0.0;
191 }
192 Double_t scaleFactor = AddSamplingDistribution(samplingDist, drawOptions);
193
194 TH1F *shaded = (TH1F*)fHist->Clone((string(samplingDist->GetName())+string("_shaded")).c_str());
195 shaded->SetDirectory(0);
196 shaded->SetFillStyle(fFillStyle++);
197 shaded->SetLineWidth(1);
198
199 for (int i=0; i<shaded->GetNbinsX(); ++i) {
200 if (shaded->GetBinCenter(i) < minShaded || shaded->GetBinCenter(i) > maxShaded){
201 shaded->SetBinContent(i,0);
202 }
203 }
204
205 TString options(drawOptions);
206 options.ToUpper();
207 if(options.Contains("NORMALIZE")) {
208 options.ReplaceAll("NORMALIZE", "");
209 options.Strip();
210 }
211 addObject(shaded, options.Data());
212
213 return scaleFactor;
214}
215
216////////////////////////////////////////////////////////////////////////////////
217
219 TLine *line = new TLine(x1, y1, x2, y2);
220 line->SetLineWidth(3);
222
223 if(fLegend && title) fLegend->AddEntry(line, title, "L");
224
225 addOtherObject(line, ""); // no options
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// add an histogram (it will be cloned);
230
232 if(fLegend && h->GetTitle()) fLegend->AddEntry(h, h->GetTitle(), "L");
233 TH1 * hcopy = (TH1*) h->Clone();
234 hcopy->SetDirectory(0);
235 addObject(hcopy, drawOptions);
236}
237void SamplingDistPlot::AddTF1(TF1* f, const char* title, Option_t *drawOptions) {
238 if(fLegend && title) fLegend->AddEntry(f, title, "L");
239 addOtherObject(f->Clone(), drawOptions);
240}
241
242////////////////////////////////////////////////////////////////////////////////
243///Determine if the sampling distribution has weights and store them
244
246{
248
249 if(samplingDist->GetSampleWeights().size() != 0){
251 fSampleWeights = samplingDist->GetSampleWeights();
252 }
253
254 return;
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// Add a generic object to this plot. The specified options will be
259/// used to Draw() this object later. The caller transfers ownership
260/// of the object with this call, and the object will be deleted
261/// when its containing plot object is destroyed.
262
264{
265
266 if(0 == obj) {
267 std::cerr << fName << "::addObject: called with a null pointer" << std::endl;
268 return;
269 }
270
271 fItems.Add(obj,drawOptions);
272
273 return;
274}
275
276////////////////////////////////////////////////////////////////////////////////
277/// Add a generic object to this plot. The specified options will be
278/// used to Draw() this object later. The caller transfers ownership
279/// of the object with this call, and the object will be deleted
280/// when its containing plot object is destroyed.
281
283{
284 if(0 == obj) {
285 oocoutE(this,InputArguments) << fName << "::addOtherObject: called with a null pointer" << std::endl;
286 return;
287 }
288
289 fOtherItems.Add(obj,drawOptions);
290
291 return;
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Draw this plot and all of the elements it contains. The specified options
296/// only apply to the drawing of our frame. The options specified in our add...()
297/// methods will be used to draw each object we contain.
298
299void SamplingDistPlot::Draw(Option_t * /*options */) {
301
302 Double_t theMin(0.), theMax(0.), theYMin(NaN), theYMax(0.);
303 GetAbsoluteInterval(theMin, theMax, theYMax);
304 if( !IsNaN(fXMin) ) theMin = fXMin;
305 if( !IsNaN(fXMax) ) theMax = fXMax;
306 if( !IsNaN(fYMin) ) theYMin = fYMin;
307 if( !IsNaN(fYMax) ) theYMax = fYMax;
308
309 RooRealVar xaxis("xaxis", fVarName.Data(), theMin, theMax);
310
311 //L.M. by drawing many times we create a memory leak ???
312 if (fRooPlot) delete fRooPlot;
313
314 bool dirStatus = RooPlot::addDirectoryStatus();
315 // make the RooPlot managed by this class
317 fRooPlot = xaxis.frame();
319 if (!fRooPlot) {
320 oocoutE(this,InputArguments) << "invalid variable to plot" << std::endl;
321 return;
322 }
323 fRooPlot->SetTitle("");
324 if( !IsNaN(theYMax) ) {
325 //coutI(InputArguments) << "Setting maximum to " << theYMax << endl;
326 fRooPlot->SetMaximum(theYMax);
327 }
328 if( !IsNaN(theYMin) ) {
329 //coutI(InputArguments) << "Setting minimum to " << theYMin << endl;
330 fRooPlot->SetMinimum(theYMin);
331 }
332
333 fIterator->Reset();
334 TH1F *obj = 0;
335 while ((obj = (TH1F*) fIterator->Next())) {
336 //obj->Draw(fIterator->GetOption());
337 // add cloned objects to avoid mem leaks
338 TH1 * cloneObj = (TH1*)obj->Clone();
339 if( !IsNaN(theYMax) ) {
340 //coutI(InputArguments) << "Setting maximum of TH1 to " << theYMax << endl;
341 cloneObj->SetMaximum(theYMax);
342 }
343 if( !IsNaN(theYMin) ) {
344 //coutI(InputArguments) << "Setting minimum of TH1 to " << theYMin << endl;
345 cloneObj->SetMinimum(theYMin);
346 }
347 cloneObj->SetDirectory(0); // transfer ownership of the object
348 fRooPlot->addTH1(cloneObj, fIterator->GetOption());
349 }
350
352 TObject *otherObj = NULL;
353 while ((otherObj = otherIt->Next())) {
354 TObject * cloneObj = otherObj->Clone();
355 fRooPlot->addObject(cloneObj, otherIt->GetOption());
356 }
357 delete otherIt;
358
359
361
362 if(bool(gStyle->GetOptLogx()) != fLogXaxis) {
363 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogx(...)" << endl;
365 }
366 if(bool(gStyle->GetOptLogy()) != fLogYaxis) {
367 if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogy(...)" << endl;
369 }
370 fRooPlot->Draw();
371
372 // apply this since gStyle does not work for RooPlot
373 if (gPad) {
374 gPad->SetLogx(fLogXaxis);
375 gPad->SetLogy(fLogYaxis);
376 }
377
378 return;
379}
380
381////////////////////////////////////////////////////////////////////////////////
382
384 if(fApplyStyle) {
385 // use plain black on white colors
386 Int_t icol = 0;
387 gStyle->SetFrameBorderMode( icol );
389 gStyle->SetPadBorderMode( icol );
390 gStyle->SetPadColor( icol );
391 gStyle->SetCanvasColor( icol );
392 gStyle->SetStatColor( icol );
394
395 // set the paper & margin sizes
396 gStyle->SetPaperSize( 20, 26 );
397
398 if(fLegend) {
401 }
402 }
403}
404
405////////////////////////////////////////////////////////////////////////////////
406
408{
409 Double_t tmpmin = TMath::Infinity();
410 Double_t tmpmax = -TMath::Infinity();
411 Double_t tmpYmax = -TMath::Infinity();
412
413 fIterator->Reset();
414 TH1F *obj = 0;
415 while((obj = (TH1F*)fIterator->Next())) {
416 if(obj->GetXaxis()->GetXmin() < tmpmin) tmpmin = obj->GetXaxis()->GetXmin();
417 if(obj->GetXaxis()->GetXmax() > tmpmax) tmpmax = obj->GetXaxis()->GetXmax();
418 if(obj->GetMaximum() > tmpYmax) tmpYmax = obj->GetMaximum() + 0.1*obj->GetMaximum();
419 }
420
421 theMin = tmpmin;
422 theMax = tmpmax;
423 theYMax = tmpYmax;
424
425 return;
426}
427
428////////////////////////////////////////////////////////////////////////////////
429/// Sets line color for given sampling distribution and
430/// fill color for the associated shaded TH1F.
431
433 if (samplDist == 0) {
434 fHist->SetLineColor(color);
435
436 fIterator->Reset();
437 TH1F *obj = 0;
438
439 TString shadedName(fHist->GetName());
440 shadedName += "_shaded";
441
442 while ((obj = (TH1F*) fIterator->Next())) {
443 if (!strcmp(obj->GetName(), shadedName.Data())) {
444 obj->SetLineColor(color);
445 obj->SetFillColor(color);
446 //break;
447 }
448 }
449 } else {
450 fIterator->Reset();
451 TH1F *obj = 0;
452
453 TString shadedName(samplDist->GetName());
454 shadedName += "_shaded";
455
456 while ((obj = (TH1F*) fIterator->Next())) {
457 if (!strcmp(obj->GetName(), samplDist->GetName())) {
458 obj->SetLineColor(color);
459 //break;
460 }
461 if (!strcmp(obj->GetName(), shadedName.Data())) {
462 obj->SetLineColor(color);
463 obj->SetFillColor(color);
464 //break;
465 }
466 }
467 }
468
469 return;
470}
471
472////////////////////////////////////////////////////////////////////////////////
473
475{
476 if(samplDist == 0){
477 fHist->SetLineWidth(lwidth);
478 }
479 else{
480 fIterator->Reset();
481 TH1F *obj = 0;
482 while((obj = (TH1F*)fIterator->Next())) {
483 if(!strcmp(obj->GetName(),samplDist->GetName())){
484 obj->SetLineWidth(lwidth);
485 break;
486 }
487 }
488 }
489
490 return;
491}
492
493////////////////////////////////////////////////////////////////////////////////
494
496{
497 if(samplDist == 0){
499 }
500 else{
501 fIterator->Reset();
502 TH1F *obj = 0;
503 while((obj = (TH1F*)fIterator->Next())) {
504 if(!strcmp(obj->GetName(),samplDist->GetName())){
505 obj->SetLineStyle(style);
506 break;
507 }
508 }
509 }
510
511 return;
512}
513
514////////////////////////////////////////////////////////////////////////////////
515
517{
518 if(samplDist == 0){
520 }
521 else{
522 fIterator->Reset();
523 TH1F *obj = 0;
524 while((obj = (TH1F*)fIterator->Next())) {
525 if(!strcmp(obj->GetName(),samplDist->GetName())){
526 obj->SetMarkerStyle(style);
527 break;
528 }
529 }
530 }
531
532 return;
533}
534
535////////////////////////////////////////////////////////////////////////////////
536
538{
539 if(samplDist == 0){
540 fHist->SetMarkerColor(color);
541 }
542 else{
543 fIterator->Reset();
544 TH1F *obj = 0;
545 while((obj = (TH1F*)fIterator->Next())) {
546 if(!strcmp(obj->GetName(),samplDist->GetName())){
547 obj->SetMarkerColor(color);
548 break;
549 }
550 }
551 }
552
553 return;
554}
555
556////////////////////////////////////////////////////////////////////////////////
557
559{
560 if(samplDist == 0){
562 }
563 else{
564 fIterator->Reset();
565 TH1F *obj = 0;
566 while((obj = (TH1F*)fIterator->Next())) {
567 if(!strcmp(obj->GetName(),samplDist->GetName())){
568 obj->SetMarkerSize(size);
569 break;
570 }
571 }
572 }
573
574 return;
575}
576
577////////////////////////////////////////////////////////////////////////////////
578
580{
581 if(samplDist == NULL){
582 return fHist;
583 }else{
584 fIterator->Reset();
585 TH1F *obj = 0;
586 while((obj = (TH1F*)fIterator->Next())) {
587 if(!strcmp(obj->GetName(),samplDist->GetName())){
588 return obj;
589 }
590 }
591 }
592
593 return NULL;
594}
595
596////////////////////////////////////////////////////////////////////////////////
597
599{
600 if(samplDist == 0){
601 fHist->Rebin(rebinFactor);
602 }
603 else{
604 fIterator->Reset();
605 TH1F *obj = 0;
606 while((obj = (TH1F*)fIterator->Next())) {
607 if(!strcmp(obj->GetName(),samplDist->GetName())){
608 obj->Rebin(rebinFactor);
609 break;
610 }
611 }
612 }
613
614 return;
615}
616
617////////////////////////////////////////////////////////////////////////////////
618/// TODO test
619
620void SamplingDistPlot::DumpToFile(const char* RootFileName, Option_t *option, const char *ftitle, Int_t compress) {
621 // All the objects are written to rootfile
622
623 if(!fRooPlot) {
624 cout << "Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
625 return;
626 }
627
628 TFile ofile(RootFileName, option, ftitle, compress);
629 ofile.cd();
630 fRooPlot->Write();
631 ofile.Close();
632}
#define IsNaN(a)
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
static const double x2[5]
static const double x1[5]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define NaN
#define coutW(a)
#define oocoutE(o, a)
float Size_t
Definition RtypesCore.h:96
const Bool_t kFALSE
Definition RtypesCore.h:101
short Width_t
Definition RtypesCore.h:91
short Color_t
Definition RtypesCore.h:92
short Style_t
Definition RtypesCore.h:89
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
@ kBlack
Definition Rtypes.h:65
#define NaN
float xmin
float xmax
R__EXTERN TStyle * gStyle
Definition TStyle.h:413
#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,...
static Bool_t setAddDirectoryStatus(Bool_t flag)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:79
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
Definition RooPlot.cxx:392
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1257
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
Definition RooPlot.cxx:1061
void addTH1(TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:411
virtual void SetMaximum(Double_t maximum=-1111)
Set maximum value of Y axis.
Definition RooPlot.cxx:1051
static Bool_t addDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:78
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
Definition RooPlot.cxx:661
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:39
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.
void AddTF1(TF1 *f, const char *title=NULL, Option_t *drawOptions="SAME")
add a TF1
RooList fOtherItems
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 SetMarkerSize(Size_t size, const SamplingDistribution *samplDist=0)
void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char *title=NULL)
add a line
Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST")
adds the sampling distribution and returns the scale factor
void GetAbsoluteInterval(Double_t &theMin, Double_t &theMax, Double_t &theYMax) const
void SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist=0)
std::vector< Double_t > fSampleWeights
void addOtherObject(TObject *obj, Option_t *drawOptions=0)
Add a generic object to this plot.
void ApplyDefaultStyle(void)
Applies a predefined style if fApplyStyle is kTRUE (default).
void SetMarkerColor(Color_t color, const SamplingDistribution *samplDist=0)
RooPlot * fRooPlot
TODO remove class variable and instantiate locally as necessary.
void AddTH1(TH1 *h, Option_t *drawOptions="")
add a TH1
void SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist=0)
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
void RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist=0)
void SetLineStyle(Style_t style, const SamplingDistribution *samplDist=0)
void addObject(TObject *obj, Option_t *drawOptions=0)
Add a generic object to this plot.
std::vector< Double_t > fSamplingDistr
virtual ~SamplingDistPlot()
Destructor of SamplingDistribution.
SamplingDistPlot(Int_t nbins=100)
Constructors for SamplingDistribution.
void SetXRange(double mi, double ma)
change x range
TIterator * fIterator
other objects to be drawn like TLine etc.
TH1F * GetTH1F(const SamplingDistribution *samplDist=NULL)
Returns the TH1F associated with the give SamplingDistribution.
Double_t AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions="NORMALIZE HIST")
Like AddSamplingDistribution, but also sets a shaded area in the minShaded and maxShaded boundaries.
void SetLineColor(Color_t color, const SamplingDistribution *samplDist=0)
Sets line color for given sampling distribution and fill color for the associated shaded TH1F.
This class simply holds a sampling distribution of some test statistic.
const std::vector< Double_t > & GetSamplingDistribution() const
Get test statistics values.
const std::vector< Double_t > & GetSampleWeights() const
Get the sampling weights.
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:41
Double_t GetXmax() const
Definition TAxis.h:134
Double_t GetXmin() const
Definition TAxis.h:133
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:54
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:899
1-D histogram with a float per channel (see TH1 documentation)}
Definition TH1.h:575
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:8767
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition TH1.cxx:8971
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition TH1.h:320
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Definition TH1.cxx:2741
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
Definition TH1.cxx:8375
virtual Int_t GetNbinsX() const
Definition TH1.h:296
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:398
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3351
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:399
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7816
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:9052
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6553
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:8850
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8820
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
Definition TH1.cxx:6224
Iterator abstract base class.
Definition TIterator.h:30
virtual void Reset()=0
virtual TObject * Next()=0
virtual Option_t * GetOption() const
Definition TIterator.h:40
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition TLegend.cxx:330
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual void Add(TObject *obj)
Definition TList.h:81
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition TList.cxx:722
virtual void Delete(Option_t *option="")
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
TString fName
Definition TNamed.h:32
virtual const char * GetTitle() const
Returns title of object.
Definition TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47
Mother of all ROOT objects.
Definition TObject.h:41
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:868
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition TObject.cxx:216
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:473
virtual void SetBorderSize(Int_t bordersize=4)
Definition TPave.h:73
Basic string class.
Definition TString.h:136
Ssiz_t Length() const
Definition TString.h:410
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition TString.cxx:1131
const char * Data() const
Definition TString.h:369
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:692
void ToUpper()
Change string to upper case.
Definition TString.cxx:1163
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:624
Int_t GetOptLogy() const
Definition TStyle.h:239
void SetPadBorderMode(Int_t mode=1)
Definition TStyle.h:340
void SetOptLogx(Int_t logx=1)
Definition TStyle.h:313
void SetCanvasColor(Color_t color=19)
Definition TStyle.h:327
void SetCanvasBorderMode(Int_t mode=1)
Definition TStyle.h:329
void SetFrameFillStyle(Style_t styl=0)
Definition TStyle.h:357
void SetFrameBorderMode(Int_t mode=1)
Definition TStyle.h:361
void SetOptLogy(Int_t logy=1)
Definition TStyle.h:314
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
Definition TStyle.cxx:1654
void SetStatColor(Color_t color=19)
Definition TStyle.h:373
void SetPadColor(Color_t color=19)
Definition TStyle.h:338
Int_t GetOptLogx() const
Definition TStyle.h:238
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:864
TCanvas * style()
Definition style.C:1