Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPlot.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooPlot.cxx
19\class RooPlot
20\ingroup Roofitcore
21
22A RooPlot is a plot frame and a container for graphics objects
23within that frame. As a frame, it provides the TH1-style public interface
24for setting plot ranges, configuring axes, etc. As a container, it
25holds an arbitrary set of objects that might be histograms of data,
26curves representing a fit model, or text labels. Use the Draw()
27method to draw a frame and the objects it contains. Use the various
28add...() methods to add objects to be drawn. In general, the
29add...() methods create a private copy of the object you pass them
30and return a pointer to this copy. The caller owns the input object
31and this class owns the returned object.
32All RooAbsReal and RooAbsData derived classes implement plotOn()
33functions that facilitate to plot themselves on a given RooPlot, e.g.
34~~~ {.cpp}
35RooPlot *frame = x.frame() ;
36data.plotOn(frame) ;
37pdf.plotOn(frame) ;
38~~~
39These high level functions also take care of any projections
40or other mappings that need to be made to plot a multi-dimensional
41object onto a one-dimensional plot.
42**/
43
44#include "RooPlot.h"
45
46#include "RooAbsReal.h"
47#include "RooAbsRealLValue.h"
48#include "RooPlotable.h"
49#include "RooArgSet.h"
50#include "RooCurve.h"
51#include "RooHist.h"
52#include "RooMsgService.h"
53
54#include "TClass.h"
55#include "TBuffer.h"
56#include "TH1D.h"
57#include "TBrowser.h"
58#include "TVirtualPad.h"
59
60#include "TAttLine.h"
61#include "TAttFill.h"
62#include "TAttMarker.h"
63#include "TAttText.h"
64#include "TDirectoryFile.h"
65#include "TLegend.h"
66#include "strlcpy.h"
67
68#include <iostream>
69#include <cstring>
70
71using namespace std;
72
74
75
77
79Bool_t RooPlot::setAddDirectoryStatus(Bool_t flag) { Bool_t ret = flag ; _addDirStatus = flag ; return ret ; }
80
81
82////////////////////////////////////////////////////////////////////////////////
83/// Default constructor
84/// coverity[UNINIT_CTOR]
85
86RooPlot::RooPlot() : _hist(0), _plotVarClone(0), _plotVarSet(0), _normVars(0), _normObj(0), _dir(0)
87{
90 }
91}
92
93
94////////////////////////////////////////////////////////////////////////////////
95/// Constructor of RooPlot with range [xmin,xmax]
96
98 _hist(0), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0),
99 _defYmin(1e-5), _defYmax(1), _dir(0)
100{
101 _hist = new TH1D(histName(),"A RooPlot",100,xmin,xmax) ;
102 _hist->Sumw2(kFALSE) ;
103 _hist->GetSumw2()->Set(0) ;
104 _hist->SetDirectory(nullptr);
105
106 // Create an empty frame with the specified x-axis limits.
107 initialize();
108
109}
110
111
112
113////////////////////////////////////////////////////////////////////////////////
114/// Construct of a two-dimensional RooPlot with ranges [xmin,xmax] x [ymin,ymax]
115
117 _hist(0), _items(), _plotVarClone(0),
118 _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0), _dir(0)
119{
120 _hist = new TH1D(histName(),"A RooPlot",100,xmin,xmax) ;
121 _hist->Sumw2(kFALSE) ;
122 _hist->GetSumw2()->Set(0) ;
123 _hist->SetDirectory(nullptr);
124
127 initialize();
128}
129
130
131////////////////////////////////////////////////////////////////////////////////
132/// Construct a two-dimensional RooPlot with ranges and properties taken
133/// from variables var1 and var2
134
136 _hist(0), _items(),
137 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0), _dir(0)
138{
139 _hist = new TH1D(histName(),"A RooPlot",100,var1.getMin(),var1.getMax()) ;
140 _hist->Sumw2(kFALSE) ;
141 _hist->GetSumw2()->Set(0) ;
142 _hist->SetDirectory(nullptr);
143
144 if(!var1.hasMin() || !var1.hasMax()) {
145 coutE(InputArguments) << "RooPlot::RooPlot: cannot create plot for variable without finite limits: "
146 << var1.GetName() << endl;
147 return;
148 }
149 if(!var2.hasMin() || !var2.hasMax()) {
150 coutE(InputArguments) << "RooPlot::RooPlot: cannot create plot for variable without finite limits: "
151 << var1.GetName() << endl;
152 return;
153 }
154 SetMinimum(var2.getMin());
155 SetMaximum(var2.getMax());
156 SetXTitle(var1.getTitle(kTRUE));
157 SetYTitle(var2.getTitle(kTRUE));
158 initialize();
159}
160
161
162////////////////////////////////////////////////////////////////////////////////
163/// Construct a two-dimensional RooPlot with ranges and properties taken
164/// from variables var1 and var2 but with an overriding range definition
165/// of [xmin,xmax] x [ymin,ymax]
166
169 _hist(0), _items(), _plotVarClone(0),
170 _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0), _dir(0)
171{
172 _hist = new TH1D(histName(),"A RooPlot",100,xmin,xmax) ;
173 _hist->Sumw2(kFALSE) ;
174 _hist->GetSumw2()->Set(0) ;
175 _hist->SetDirectory(nullptr);
176
179 SetXTitle(var1.getTitle(kTRUE));
180 SetYTitle(var2.getTitle(kTRUE));
181 initialize();
182}
183
184
185////////////////////////////////////////////////////////////////////////////////
186/// Create an 1-dimensional with all properties taken from 'var', but
187/// with an explicit range [xmin,xmax] and a default binning of 'nbins'
188
189RooPlot::RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nbins) :
190 _hist(0), _items(),
191 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(1), _dir(0)
192{
193 _hist = new TH1D(name,title,nbins,xmin,xmax) ;
194 _hist->Sumw2(kFALSE) ;
195 _hist->GetSumw2()->Set(0) ;
196 _hist->SetDirectory(nullptr);
197
198 // plotVar can be a composite in case of a RooDataSet::plot, need deepClone
201
202 TString xtitle= var.getTitle(kTRUE);
203 SetXTitle(xtitle.Data());
204
205 initialize();
206
207 _normBinWidth = (xmax-xmin)/nbins ;
208}
209
210
211////////////////////////////////////////////////////////////////////////////////
212/// Create an 1-dimensional with all properties taken from 'var', but
213/// with an explicit range [xmin,xmax] and a default binning of 'nbins'
214
216 _hist(0), _items(),
217 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(1), _dir(0)
218{
219 _hist = new TH1D(histName(),"RooPlot",nbins,xmin,xmax) ;
220 _hist->Sumw2(kFALSE) ;
221 _hist->GetSumw2()->Set(0) ;
222 _hist->SetDirectory(nullptr);
223
224 // plotVar can be a composite in case of a RooDataSet::plot, need deepClone
227
228 TString xtitle= var.getTitle(kTRUE);
229 SetXTitle(xtitle.Data());
230
231 TString title("A RooPlot of \"");
232 title.Append(var.getTitle());
233 title.Append("\"");
234 SetTitle(title.Data());
235 initialize();
236
237 _normBinWidth = (xmax-xmin)/nbins ;
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Create a new frame for a given variable in x. This is just a
242/// wrapper for the RooPlot constructor with the same interface.
243///
244/// More details.
245/// \param[in] var The variable on the x-axis
246/// \param[in] xmin Left edge of the x-axis
247/// \param[in] xmax Right edge of the x-axis
248/// \param[in] nBins number of bins on the x-axis
250 return new RooPlot(var,xmin,xmax,nBins);
251}
252
253////////////////////////////////////////////////////////////////////////////////
254/// Create a new frame for a given variable in x, adding bin labels.
255/// The binning will be extracted from the variable given. The bin
256/// labels will be set as "%g-%g" for the left and right edges of each
257/// bin of the given variable.
258///
259/// More details.
260/// \param[in] var The variable on the x-axis
262 RooPlot* pl = new RooPlot();
263 int nbins = var.getBinning().numBins();
264
265 pl->_hist = new TH1D(pl->histName(),"RooPlot",nbins,var.getMin(),var.getMax()) ;
266 pl->_hist->Sumw2(kFALSE) ;
267 pl->_hist->GetSumw2()->Set(0) ;
268 pl->_hist->SetDirectory(nullptr);
269
270 pl->_hist->SetNdivisions(-nbins);
271 for(int i=0; i<nbins; ++i){
272 TString s = TString::Format("%g-%g",var.getBinning().binLow(i),var.getBinning().binHigh(i));
273 pl->_hist->GetXaxis()->SetBinLabel(i+1,s);
274 }
275
276 // plotVar can be a composite in case of a RooDataSet::plot, need deepClone
277 pl->_plotVarSet = (RooArgSet*) RooArgSet(var).snapshot() ;
279
280 TString xtitle= var.getTitle(kTRUE);
281 pl->SetXTitle(xtitle.Data());
282
283 TString title("A RooPlot of \"");
284 title.Append(var.getTitle());
285 title.Append("\"");
286 pl->SetTitle(title.Data());
287 pl->initialize();
288
289 pl->_normBinWidth = 1.;
290 return pl;
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// Return empty clone of current RooPlot
295
297{
299 clone->SetName(name) ;
300 return clone ;
301}
302
303
304////////////////////////////////////////////////////////////////////////////////
305/// Perform initialization that is common to all constructors.
306
308{
309 SetName(histName()) ;
310
313 }
314
315 // We do not have useful stats of our own
317 _hist->SetDirectory(nullptr);
318 // Default vertical padding of our enclosed objects
319 setPadFactor(0.05);
320 // We don't know our normalization yet
321 _normNumEvts= 0;
322 _normBinWidth = 0;
323 _normVars= 0;
324}
325
326
327////////////////////////////////////////////////////////////////////////////////
328/// Construct automatic name of internal TH1
329
331{
332 if (_plotVarClone) {
333 return TString(Form("frame_%s_%lx",_plotVarClone->GetName(),(ULong_t)this)) ;
334 } else {
335 return TString(Form("frame_%lx",(ULong_t)this)) ;
336 }
337}
338
339
340////////////////////////////////////////////////////////////////////////////////
341/// Destructor
342
344{
345 // Delete the items in our container and our iterator.
346 if (_dir) {
347 _dir->GetList()->RecursiveRemove(this) ;
348 }
349
350 _items.Delete();
351 if(_plotVarSet) delete _plotVarSet;
352 if(_normVars) delete _normVars;
353 delete _hist ;
354
355}
356
357
358////////////////////////////////////////////////////////////////////////////////
359/// Set the directory that this plot is associated to.
360/// Setting it to `nullptr` will remove the object from all directories.
361/// Like TH1::SetDirectory.
363 if (_dir) {
364 _dir->GetList()->RecursiveRemove(this);
365 }
366 _dir = dir;
367 if (_dir) {
368 _dir->Append(this);
369 }
370}
371
372
373////////////////////////////////////////////////////////////////////////////////
374/// Install the given set of observables are reference normalization
375/// variables for this frame. These observables are e.g. later used
376/// to automatically project out observables when plotting functions
377/// on this frame. This function is only effective when called the
378/// first time on a frame
379
381{
382 if(0 == _normVars) _normVars= (RooArgSet*) vars.snapshot(kTRUE);
383}
384
385
386////////////////////////////////////////////////////////////////////////////////
387/// A plot object is a frame without any bin contents of its own so this
388/// method always returns zero.
389
391 return 0;
392}
393
394
395////////////////////////////////////////////////////////////////////////////////
396/// A plot object is a frame without any bin contents of its own so this
397/// method always returns zero.
398
400{
401 return 0;
402}
403
404
405////////////////////////////////////////////////////////////////////////////////
406/// A plot object is a frame without any bin contents of its own so this
407/// method always returns zero.
408
410{
411 return 0;
412}
413
414
415
416////////////////////////////////////////////////////////////////////////////////
417/// Add a generic object to this plot. The specified options will be
418/// used to Draw() this object later. The caller transfers ownership
419/// of the object with this call, and the object will be deleted
420/// when its containing plot object is destroyed.
421
422void RooPlot::addObject(TObject *obj, Option_t *drawOptions, Bool_t invisible)
423{
424 if(0 == obj) {
425 coutE(InputArguments) << fName << "::addObject: called with a null pointer" << endl;
426 return;
427 }
428 DrawOpt opt(drawOptions) ;
429 opt.invisible = invisible ;
430 _items.Add(obj,opt.rawOpt());
431}
432
433
434////////////////////////////////////////////////////////////////////////////////
435/// Add a TH1 histogram object to this plot. The specified options
436/// will be used to Draw() this object later. "SAME" will be added to
437/// the options if they are not already present. The caller transfers
438/// ownership of the object with this call, and the object will be
439/// deleted when its containing plot object is destroyed.
440
441void RooPlot::addTH1(TH1 *hist, Option_t *drawOptions, Bool_t invisible)
442{
443 if(0 == hist) {
444 coutE(InputArguments) << fName << "::addTH1: called with a null pointer" << endl;
445 return;
446 }
447 // check that this histogram is really 1D
448 if(1 != hist->GetDimension()) {
449 coutE(InputArguments) << fName << "::addTH1: cannot plot histogram with "
450 << hist->GetDimension() << " dimensions" << endl;
451 return;
452 }
453
454 // add option "SAME" if necessary
455 TString options(drawOptions);
456 options.ToUpper();
457 if(!options.Contains("SAME")) options.Append("SAME");
458
459 // update our y-axis label and limits
460 updateYAxis(hist->GetMinimum(),hist->GetMaximum(),hist->GetYaxis()->GetTitle());
461
462 // use this histogram's normalization if necessary
463 updateFitRangeNorm(hist);
464
465 // add the histogram to our list
466 addObject(hist,options.Data(),invisible);
467}
468
469
470namespace {
471 // this helper function is intended to translate a graph from a regular axis to a labelled axis
472 // this version uses TGraph, which is a parent of RooCurve
473 void translateGraph(TH1* hist, RooAbsRealLValue* xvar, TGraph* graph){
474 // if the graph already has a labelled axis, don't do anything
475 if(graph->GetXaxis()->IsAlphanumeric()) return;
476 double xmin = hist->GetXaxis()->GetXmin();
477 double xmax = hist->GetXaxis()->GetXmax();
478 if(graph->TestBit(TGraph::kIsSortedX)){
479 // sorted graphs are "line graphs"
480 // evaluate the graph at the lower and upper edge as well as the center of each bin
481 std::vector<double> x;
482 std::vector<double> y;
483 x.push_back(xmin);
484 y.push_back(graph->Eval(xvar->getBinning().binLow(0)));
485 for(int i=0; i<hist->GetNbinsX(); ++i){
486 x.push_back(hist->GetXaxis()->GetBinUpEdge(i+1));
487 y.push_back(graph->Eval(xvar->getBinning().binHigh(i)));
488 x.push_back(hist->GetXaxis()->GetBinCenter(i+1));
489 y.push_back(graph->Eval(xvar->getBinning().binCenter(i)));
490 }
491 int n = x.size();
492 graph->Set(n);
493 for(int i=0; i<n; ++i){
494 graph->SetPoint(i,x[i],y[i]);
495 }
496 graph->Sort();
497 } else {
498 // unsorted graphs are "area graphs"
499 std::map<int,double> minValues;
500 std::map<int,double> maxValues;
501 int n = graph->GetN();
502 double x, y;
503 // for each bin, find the min and max points to form an envelope
504 for(int i=0; i<n; ++i){
505 graph->GetPoint(i,x,y);
506 int bin = xvar->getBinning().binNumber(x)+1;
507 if(maxValues.find(bin)!=maxValues.end()){
508 maxValues[bin] = std::max(maxValues[bin],y);
509 } else {
510 maxValues[bin] = y;
511 }
512 if(minValues.find(bin)!=minValues.end()){
513 minValues[bin] = std::min(minValues[bin],y);
514 } else {
515 minValues[bin] = y;
516 }
517 }
518 double xminY = graph->Eval(xmin);
519 double xmaxY = graph->Eval(xmax);
520 graph->Set(hist->GetNbinsX()+2);
521 int np=0;
522 graph->SetPoint(np,xmin,xminY);
523 // assign the calculated envelope boundaries to the bin centers of the bins
524 for(auto it = maxValues.begin(); it != maxValues.end(); ++it){
525 graph->SetPoint(++np,hist->GetXaxis()->GetBinCenter(it->first),it->second);
526 }
527 graph->SetPoint(++np,xmax,xmaxY);
528 for(auto it = minValues.rbegin(); it != minValues.rend(); ++it){
529 graph->SetPoint(++np,hist->GetXaxis()->GetBinCenter(it->first),it->second);
530 }
531 graph->SetPoint(++np,xmin,xminY);
532 }
533 // make sure that the graph also has the labels set, such that subsequent calls to translate this graph will not do anything
534 graph->GetXaxis()->Set(hist->GetNbinsX(),xmin,xmax);
535 for(int i=0; i<hist->GetNbinsX(); ++i){
536 graph->GetXaxis()->SetBinLabel(i+1,hist->GetXaxis()->GetBinLabel(i+1));
537 }
538 }
539 // this version uses TGraphErrors, which is a parent of RooHist
540 void translateGraph(TH1* hist, RooAbsRealLValue* xvar, TGraphAsymmErrors* graph){
541 // if the graph already has a labelled axis, don't do anything
542 if(graph->GetXaxis()->IsAlphanumeric()) return;
543 int n = graph->GetN();
544 double xmin = hist->GetXaxis()->GetXmin();
545 double xmax = hist->GetXaxis()->GetXmax();
546 double x, y;
547 // as this graph is histogram-like, we expect there to be one point per bin
548 // we just move these points to the respective bin centers
549 for(int i=0; i<n; ++i){
550 if(graph->GetPoint(i,x,y)!=i) break;
551 int bin = xvar->getBinning().binNumber(x);
552 graph->SetPoint(i,hist->GetXaxis()->GetBinCenter(bin+1),y);
553 graph->SetPointEXhigh(i,0.5*hist->GetXaxis()->GetBinWidth(bin+1));
554 graph->SetPointEXlow(i,0.5*hist->GetXaxis()->GetBinWidth(bin+1));
555 }
556 graph->GetXaxis()->Set(hist->GetNbinsX(),xmin,xmax);
557 // make sure that the graph also has the labels set, such that subsequent calls to translate this graph will not do anything
558 for(int i=0; i<hist->GetNbinsX(); ++i){
559 graph->GetXaxis()->SetBinLabel(i+1,hist->GetXaxis()->GetBinLabel(i+1));
560 }
561 }
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// Add the specified plotable object to our plot. Increase our y-axis
566/// limits to fit this object if necessary. The default lower-limit
567/// is zero unless we are plotting an object that takes on negative values.
568/// This call transfers ownership of the plotable object to this class.
569/// The plotable object will be deleted when this plot object is deleted.
570void RooPlot::addPlotable(RooPlotable *plotable, Option_t *drawOptions, Bool_t invisible, Bool_t refreshNorm)
571{
572 // update our y-axis label and limits
573 updateYAxis(plotable->getYAxisMin(),plotable->getYAxisMax(),plotable->getYAxisLabel());
574
575 // use this object's normalization if necessary
576 updateFitRangeNorm(plotable,refreshNorm) ;
577
578 // add this element to our list and remember its drawing option
579 TObject *obj= plotable->crossCast();
580 if(0 == obj) {
581 coutE(InputArguments) << fName << "::add: cross-cast to TObject failed (nothing added)" << endl;
582 }
583 else {
584 // if the frame axis is alphanumeric, the coordinates of the graph need to be translated to this binning
585 if(this->_hist->GetXaxis()->IsAlphanumeric()){
586 if(obj->InheritsFrom(RooCurve::Class())){
587 ::translateGraph(this->_hist,_plotVarClone,static_cast<RooCurve*>(obj));
588 } else if(obj->InheritsFrom(RooHist::Class())){
589 ::translateGraph(this->_hist,_plotVarClone,static_cast<RooHist*>(obj));
590 }
591 }
592
593 DrawOpt opt(drawOptions) ;
594 opt.invisible = invisible ;
595 _items.Add(obj,opt.rawOpt());
596 }
597}
598
599
600////////////////////////////////////////////////////////////////////////////////
601/// Update our plot normalization over our plot variable's fit range,
602/// which will be determined by the first suitable object added to our plot.
603
605{
606 const TAxis* xa = ((TH1*)hist)->GetXaxis() ;
607 _normBinWidth = (xa->GetXmax()-xa->GetXmin())/hist->GetNbinsX() ;
609}
610
611
612////////////////////////////////////////////////////////////////////////////////
613/// Update our plot normalization over our plot variable's fit range,
614/// which will be determined by the first suitable object added to our plot.
615
617{
618 if (_normNumEvts != 0) {
619
620 // If refresh feature is disabled stop here
621 if (!refreshNorm) return ;
622
623 Double_t corFac(1.0) ;
624 if (dynamic_cast<const RooHist*>(rp)) corFac = _normBinWidth/rp->getFitRangeBinW() ;
625
626
627 if (fabs(rp->getFitRangeNEvt()/corFac-_normNumEvts)>1e-6) {
628 coutI(Plotting) << "RooPlot::updateFitRangeNorm: New event count of " << rp->getFitRangeNEvt()/corFac
629 << " will supercede previous event count of " << _normNumEvts << " for normalization of PDF projections" << endl ;
630 }
631
632 // Nominal bin width (i.e event density) is already locked in by previously drawn histogram
633 // scale this histogram to match that density
634 _normNumEvts = rp->getFitRangeNEvt()/corFac ;
635 _normObj = rp ;
636 // cout << "correction factor = " << _normBinWidth << "/" << rp->getFitRangeBinW() << endl ;
637 // cout << "updating numevts to " << _normNumEvts << endl ;
638
639 } else {
640
641 _normObj = rp ;
643 if (rp->getFitRangeBinW()) {
645 }
646
647 // cout << "updating numevts to " << _normNumEvts << endl ;
648 }
649
650}
651
652
653
654////////////////////////////////////////////////////////////////////////////////
655/// Update our y-axis limits to accomodate an object whose spread
656/// in y is (ymin,ymax). Use the specified y-axis label if we don't
657/// have one assigned already.
658
660{
661 // force an implicit lower limit of zero if appropriate
662 if(GetMinimum() == 0 && ymin > 0) ymin= 0;
663
664 // calculate padded values
665 Double_t ypad= getPadFactor()*(ymax-ymin);
666 ymax+= ypad;
667 if(ymin < 0) ymin-= ypad;
668
669 // update our limits if necessary
670 if(GetMaximum() < ymax) {
671 _defYmax = ymax ;
673 // if we don't do this - Unzoom on y-axis will reset upper bound to 1
675 }
676 if(GetMinimum() > ymin) {
677 _defYmin = ymin ;
679 }
680
681 // use the specified y-axis label if we don't have one already
682 if(0 == strlen(_hist->GetYaxis()->GetTitle())) _hist->SetYTitle(label);
683}
684
685
686////////////////////////////////////////////////////////////////////////////////
687/// Draw this plot and all of the elements it contains. The specified options
688/// only apply to the drawing of our frame. The options specified in our add...()
689/// methods will be used to draw each object we contain.
690
692{
693 TString optArg = option ;
694 optArg.ToLower() ;
695
696 // This draw options prevents the histogram with one dummy entry
697 // to be drawn
698 if (optArg.Contains("same")) {
699 _hist->Draw("FUNCSAME");
700 } else {
701 _hist->Draw("FUNC");
702 }
703
704 std::unique_ptr<TIterator> _iterator(_items.MakeIterator());
705 TObject *obj = 0;
706 while((obj= _iterator->Next())) {
707 DrawOpt opt(_iterator->GetOption()) ;
708 if (!opt.invisible) {
709 //LM: in case of a TGraph derived object, do not use default "" option
710 // which is "ALP" from 5.34.10 (and will then redrawn the axis) but use "LP"
711 if (!strlen(opt.drawOptions) && obj->IsA()->InheritsFrom(TGraph::Class()) ) strlcpy(opt.drawOptions,"LP",3);
712 obj->Draw(opt.drawOptions);
713 }
714 }
715
716 _hist->Draw("AXISSAME");
717}
718
719
720
721////////////////////////////////////////////////////////////////////////////////
722/// Print frame name
723
724void RooPlot::printName(ostream& os) const
725{
726 os << GetName() ;
727}
728
729
730////////////////////////////////////////////////////////////////////////////////
731/// Print frame title
732
733void RooPlot::printTitle(ostream& os) const
734{
735 os << GetTitle() ;
736}
737
738
739////////////////////////////////////////////////////////////////////////////////
740/// Print frame class name
741
742void RooPlot::printClassName(ostream& os) const
743{
744 os << IsA()->GetName() ;
745}
746
747
748
749////////////////////////////////////////////////////////////////////////////////
750
751void RooPlot::printArgs(ostream& os) const
752{
753 if (_plotVarClone) {
754 os << "[" ;
756 os << "]" ;
757 }
758}
759
760
761
762////////////////////////////////////////////////////////////////////////////////
763/// Print frame arguments
764
765void RooPlot::printValue(ostream& os) const
766{
767 os << "(" ;
768 std::unique_ptr<TIterator> _iterator(_items.MakeIterator());
769 TObject *obj = 0;
771 while((obj= _iterator->Next())) {
772 if (first) {
773 first=kFALSE ;
774 } else {
775 os << "," ;
776 }
777 if(obj->IsA()->InheritsFrom(RooPrintable::Class())) {
778 RooPrintable* po = dynamic_cast<RooPrintable*>(obj) ;
779 // coverity[FORWARD_NULL]
781 }
782 // is it a TNamed subclass?
783 else {
784 os << obj->ClassName() << "::" << obj->GetName() ;
785 }
786 }
787 os << ")" ;
788}
789
790
791////////////////////////////////////////////////////////////////////////////////
792/// Frame detailed printing
793
794void RooPlot::printMultiline(ostream& os, Int_t /*content*/, Bool_t verbose, TString indent) const
795{
796 TString deeper(indent);
797 deeper.Append(" ");
798 if(0 != _plotVarClone) {
799 os << indent << "RooPlot " << GetName() << " (" << GetTitle() << ") plots variable ";
801 }
802 else {
803 os << indent << "RooPlot " << GetName() << " (" << GetTitle() << ") has no associated plot variable" << endl ;
804 }
805 os << indent << " Plot frame contains " << _items.GetSize() << " object(s):" << endl;
806
807 if(verbose) {
808 std::unique_ptr<TIterator> _iterator(_items.MakeIterator());
809 TObject *obj = 0;
810 Int_t i=0 ;
811 while((obj= _iterator->Next())) {
812 os << deeper << "[" << i++ << "] (Options=\"" << _iterator->GetOption() << "\") ";
813 // Is this a printable object?
814 if(obj->IsA()->InheritsFrom(RooPrintable::Class())) {
815 RooPrintable* po = dynamic_cast<RooPrintable*>(obj) ;
816 if (po) {
818 }
819 }
820 // is it a TNamed subclass?
821 else {
822 os << obj->ClassName() << "::" << obj->GetName() << endl;
823 }
824 }
825 }
826}
827
828
829
830////////////////////////////////////////////////////////////////////////////////
831/// Return the name of the object at slot 'idx' in this RooPlot.
832/// If the given index is out of range, return a null pointer
833
834const char* RooPlot::nameOf(Int_t idx) const
835{
836 TObject* obj = _items.At(idx) ;
837 if (!obj) {
838 coutE(InputArguments) << "RooPlot::nameOf(" << GetName() << ") index " << idx << " out of range" << endl ;
839 return 0 ;
840 }
841 return obj->GetName() ;
842}
843
844
845
846////////////////////////////////////////////////////////////////////////////////
847/// Return the name of the object at slot 'idx' in this RooPlot.
848/// If the given index is out of range, return a null pointer
849
851{
852 TObject* obj = _items.At(idx) ;
853 if (!obj) {
854 coutE(InputArguments) << "RooPlot::getObject(" << GetName() << ") index " << idx << " out of range" << endl ;
855 return 0 ;
856 }
857 return obj ;
858}
859
860
861
862////////////////////////////////////////////////////////////////////////////////
863/// Return a pointer to the line attributes of the named object in this plot,
864/// or zero if the named object does not exist or does not have line attributes.
865
867{
868 return dynamic_cast<TAttLine*>(findObject(name));
869}
870
871
872////////////////////////////////////////////////////////////////////////////////
873/// Return a pointer to the fill attributes of the named object in this plot,
874/// or zero if the named object does not exist or does not have fill attributes.
875
877{
878 return dynamic_cast<TAttFill*>(findObject(name));
879}
880
881
882////////////////////////////////////////////////////////////////////////////////
883/// Return a pointer to the marker attributes of the named object in this plot,
884/// or zero if the named object does not exist or does not have marker attributes.
885
887{
888 return dynamic_cast<TAttMarker*>(findObject(name));
889}
890
891
892////////////////////////////////////////////////////////////////////////////////
893/// Return a pointer to the text attributes of the named object in this plot,
894/// or zero if the named object does not exist or does not have text attributes.
895
897{
898 return dynamic_cast<TAttText*>(findObject(name));
899}
900
901
902
903////////////////////////////////////////////////////////////////////////////////
904/// Return a RooCurve pointer of the named object in this plot,
905/// or zero if the named object does not exist or is not a RooCurve
906
907RooCurve* RooPlot::getCurve(const char* name) const
908{
909 return dynamic_cast<RooCurve*>(findObject(name)) ;
910}
911
912
913////////////////////////////////////////////////////////////////////////////////
914/// Return a RooCurve pointer of the named object in this plot,
915/// or zero if the named object does not exist or is not a RooCurve
916
917RooHist* RooPlot::getHist(const char* name) const
918{
919 return dynamic_cast<RooHist*>(findObject(name)) ;
920}
921
922
923
924////////////////////////////////////////////////////////////////////////////////
925/// Remove object with given name, or last object added if no name is given.
926/// If deleteToo is true (default), the object removed from the RooPlot is
927/// also deleted.
928
929void RooPlot::remove(const char* name, Bool_t deleteToo)
930{
931 TObject* obj = findObject(name) ;
932 if (!obj) {
933 if (name) {
934 coutE(InputArguments) << "RooPlot::remove(" << GetName() << ") ERROR: no object found with name " << name << endl ;
935 } else {
936 coutE(InputArguments) << "RooPlot::remove(" << GetName() << ") ERROR: plot frame is empty, cannot remove last object" << endl ;
937 }
938 return ;
939 }
940
941 _items.Remove(obj) ;
942
943 if (deleteToo) {
944 delete obj ;
945 }
946}
947
948
949////////////////////////////////////////////////////////////////////////////////
950/// Change the order in which our contained objects are drawn so that
951/// the target object is drawn just before the specified object.
952/// Returns kFALSE if either object does not exist.
953
954Bool_t RooPlot::drawBefore(const char *before, const char *target)
955{
956 return _items.moveBefore(before, target, caller("drawBefore"));
957}
958
959
960////////////////////////////////////////////////////////////////////////////////
961/// Change the order in which our contained objects are drawn so that
962/// the target object is drawn just after the specified object.
963/// Returns kFALSE if either object does not exist.
964
965Bool_t RooPlot::drawAfter(const char *after, const char *target)
966{
967 return _items.moveAfter(after, target, caller("drawAfter"));
968}
969
970
971////////////////////////////////////////////////////////////////////////////////
972/// Find the named object in our list of items and return a pointer
973/// to it. Return zero and print a warning message if the named
974/// object cannot be found. If no name is supplied the last object
975/// added is returned.
976///
977/// Note that the returned pointer is to a
978/// TObject and so will generally need casting. Use the getAtt...()
979/// methods to change the drawing style attributes of a contained
980/// object directly.
981
982TObject *RooPlot::findObject(const char *name, const TClass* clas) const
983{
984 TObject *obj = 0;
985 TObject *ret = 0;
986
987 TIterator* iter = _items.MakeIterator() ;
988 while((obj=iter->Next())) {
989 if ((!name || !TString(name).CompareTo(obj->GetName())) &&
990 (!clas || (obj->IsA()==clas))) {
991 ret = obj ;
992 }
993 }
994 delete iter ;
995
996 if (ret==0) {
997 coutE(InputArguments) << "RooPlot::findObject(" << GetName() << ") cannot find object " << (name?name:"<last>") << endl ;
998 }
999 return ret ;
1000}
1001
1002
1003////////////////////////////////////////////////////////////////////////////////
1004/// Return the Draw() options registered for the named object. Return
1005/// an empty string if the named object cannot be found.
1006
1008{
1009 TObjOptLink *link= _items.findLink(name,caller("getDrawOptions"));
1010 DrawOpt opt(0 == link ? "" : link->GetOption()) ;
1011 return TString(opt.drawOptions) ;
1012}
1013
1014
1015////////////////////////////////////////////////////////////////////////////////
1016/// Register the specified drawing options for the named object.
1017/// Return kFALSE if the named object cannot be found.
1018
1020{
1021 TObjOptLink *link= _items.findLink(name,caller("setDrawOptions"));
1022 if(0 == link) return kFALSE;
1023
1024 DrawOpt opt(link->GetOption()) ;
1025 strlcpy(opt.drawOptions,options,128) ;
1026 link->SetOption(opt.rawOpt());
1027 return kTRUE;
1028}
1029
1030
1031////////////////////////////////////////////////////////////////////////////////
1032/// Returns true of object with given name is set to be invisible
1033
1035{
1036 TObjOptLink *link= _items.findLink(name,caller("getInvisible"));
1037 if(0 == link) return kFALSE;
1038
1039 return DrawOpt(link->GetOption()).invisible ;
1040}
1041
1042
1043////////////////////////////////////////////////////////////////////////////////
1044/// If flag is true object with 'name' is set to be invisible
1045/// i.e. it is not drawn when Draw() is called
1046
1047void RooPlot::setInvisible(const char* name, Bool_t flag)
1048{
1049 TObjOptLink *link= _items.findLink(name,caller("getInvisible"));
1050
1051 DrawOpt opt ;
1052
1053 if(link) {
1054 opt.initialize(link->GetOption()) ;
1055 opt.invisible = flag ;
1056 link->SetOption(opt.rawOpt()) ;
1057 }
1058
1059}
1060
1061
1062
1063////////////////////////////////////////////////////////////////////////////////
1064/// Utility function
1065
1066TString RooPlot::caller(const char *method) const
1067{
1069 if(strlen(method)) {
1070 name.Append("::");
1071 name.Append(method);
1072 }
1073 return name;
1074}
1075
1076
1077
1078////////////////////////////////////////////////////////////////////////////////
1079/// Set maximum value of Y axis
1080
1082{
1083 _hist->SetMaximum(maximum==-1111?_defYmax:maximum) ;
1084}
1085
1086
1087
1088////////////////////////////////////////////////////////////////////////////////
1089/// Set minimum value of Y axis
1090
1092{
1093 _hist->SetMinimum(minimum==-1111?_defYmin:minimum) ;
1094}
1095
1096
1097
1098////////////////////////////////////////////////////////////////////////////////
1099/// Calculate and return reduced chi-squared of curve with given name with respect
1100/// to histogram with given name.
1101///
1102/// \param[in] curvename Name of the curve or nullptr for last curve
1103/// \param[in] histname Name of the histogram to compare to or nullptr for last added histogram
1104/// \param[in] nFitParam If non-zero, reduce the number of degrees of freedom by this
1105/// number. This means that the curve was fitted to the data with nFitParam floating
1106/// parameters, which needs to be reflected in the calculation of \f$\chi^2 / \mathrm{ndf}\f$.
1107///
1108/// \return \f$ \chi^2 / \mathrm{ndf} \f$
1109
1110Double_t RooPlot::chiSquare(const char* curvename, const char* histname, int nFitParam) const
1111{
1112
1113 // Find curve object
1114 RooCurve* curve = (RooCurve*) findObject(curvename,RooCurve::Class()) ;
1115 if (!curve) {
1116 coutE(InputArguments) << "RooPlot::chiSquare(" << GetName() << ") cannot find curve" << endl ;
1117 return -1. ;
1118 }
1119
1120 // Find histogram object
1121 RooHist* hist = (RooHist*) findObject(histname,RooHist::Class()) ;
1122 if (!hist) {
1123 coutE(InputArguments) << "RooPlot::chiSquare(" << GetName() << ") cannot find histogram" << endl ;
1124 return -1. ;
1125 }
1126
1127 return curve->chiSquare(*hist,nFitParam) ;
1128}
1129
1130
1131////////////////////////////////////////////////////////////////////////////////
1132/// Return a RooHist (derives from TGraphAsymErrors) containing the residuals of histogram 'histname' with respect
1133/// to curve 'curvename'. If normalize is true, the residuals are divided by the error
1134/// of the histogram, effectively returning a pull histogram.
1135/// The plotting range of the graph is adapted to the plotting range of the current plot.
1136/// If `useAverage` is true, the histogram is compared with the curve's average values within a given bin.
1137/// Otherwise, the curve is interpolated at the bin centres, which is not accurate for curved distributions.
1138RooHist* RooPlot::residHist(const char* histname, const char* curvename, bool normalize, bool useAverage) const
1139{
1140 // Find curve object
1141 RooCurve* curve = (RooCurve*) findObject(curvename,RooCurve::Class()) ;
1142 if (!curve) {
1143 coutE(InputArguments) << "RooPlot::residHist(" << GetName() << ") cannot find curve" << endl ;
1144 return 0 ;
1145 }
1146
1147 // Find histogram object
1148 RooHist* hist = (RooHist*) findObject(histname,RooHist::Class()) ;
1149 if (!hist) {
1150 coutE(InputArguments) << "RooPlot::residHist(" << GetName() << ") cannot find histogram" << endl ;
1151 return 0 ;
1152 }
1153
1154 auto residhist = hist->makeResidHist(*curve,normalize,useAverage);
1156
1157 return residhist;
1158}
1159
1160
1161
1162////////////////////////////////////////////////////////////////////////////////
1163/// Initialize the DrawOpt helper class
1164
1165void RooPlot::DrawOpt::initialize(const char* inRawOpt)
1166{
1167 if (!inRawOpt) {
1168 drawOptions[0] = 0 ;
1170 return ;
1171 }
1172 strlcpy(drawOptions,inRawOpt,128) ;
1173 strtok(drawOptions,":") ;
1174 const char* extraOpt = strtok(0,":") ;
1175 if (extraOpt) {
1176 invisible = (extraOpt[0]=='I') ;
1177 }
1178}
1179
1180
1181////////////////////////////////////////////////////////////////////////////////
1182/// Return the raw draw options
1183
1184const char* RooPlot::DrawOpt::rawOpt() const
1185{
1186 static char buf[128] ;
1187 strlcpy(buf,drawOptions,128) ;
1188 if (invisible) {
1189 strlcat(buf,":I",128) ;
1190 }
1191 return buf ;
1192}
1193
1194
1195
1196////////////////////////////////////////////////////////////////////////////////
1197/// Return the number of events that is associated with the range [xlo,xhi]
1198/// This method is only fully functional for ranges not equal to the full
1199/// range if the object that inserted the normalization data provided
1200/// a link to an external object that can calculate the event count in
1201/// in sub ranges. An error will be printed if this function is used
1202/// on sub-ranges while that information is not available
1203
1205{
1206 Double_t scaleFactor = 1.0 ;
1207 if (_normObj) {
1208 scaleFactor = _normObj->getFitRangeNEvt(xlo,xhi)/_normObj->getFitRangeNEvt() ;
1209 } else {
1210 coutW(Plotting) << "RooPlot::getFitRangeNEvt(" << GetName() << ") WARNING: Unable to obtain event count in range "
1211 << xlo << " to " << xhi << ", substituting full event count" << endl ;
1212 }
1213 return getFitRangeNEvt()*scaleFactor ;
1214}
1215
1216
1217////////////////////////////////////////////////////////////////////////////////
1218/// Set the name of the RooPlot to 'name'
1219
1220void RooPlot::SetName(const char *name)
1221{
1222 if (_dir) _dir->GetList()->Remove(this);
1224 if (_dir) _dir->GetList()->Add(this);
1225}
1226
1227
1228////////////////////////////////////////////////////////////////////////////////
1229/// Set the name and title of the RooPlot to 'name' and 'title'
1230
1231void RooPlot::SetNameTitle(const char *name, const char* title)
1232{
1233 if (_dir) _dir->GetList()->Remove(this);
1234 TNamed::SetNameTitle(name,title) ;
1235 if (_dir) _dir->GetList()->Add(this);
1236}
1237
1238
1239////////////////////////////////////////////////////////////////////////////////
1240/// Set the title of the RooPlot to 'title'
1241
1242void RooPlot::SetTitle(const char* title)
1243{
1244 TNamed::SetTitle(title) ;
1245 _hist->SetTitle(title) ;
1246}
1247
1248
1249
1250////////////////////////////////////////////////////////////////////////////////
1251/// Define default print options, for a given print style
1252
1254{
1255 return kName|kArgs|kValue ;
1256}
1257
1258
1259
1260/// \see TH1::GetXaxis()
1261TAxis* RooPlot::GetXaxis() const { return _hist->GetXaxis() ; }
1262/// \see TH1::GetYaxis()
1263TAxis* RooPlot::GetYaxis() const { return _hist->GetYaxis() ; }
1264/// \see TH1::GetNbinsX()
1266/// \see TH1::GetNdivisions()
1268/// \see TH1::GetMinimum()
1269Double_t RooPlot::GetMinimum(Double_t minval) const { return _hist->GetMinimum(minval) ; }
1270/// \see TH1::GetMaximum()
1271Double_t RooPlot::GetMaximum(Double_t maxval) const { return _hist->GetMaximum(maxval) ; }
1272
1273
1274/// \see TH1::SetAxisColor()
1275void RooPlot::SetAxisColor(Color_t color, Option_t* axis) { _hist->SetAxisColor(color,axis) ; }
1276/// \see TH1::SetAxisRange()
1278/// \see TH1::SetBarOffset()
1280/// \see TH1::SetBarWidth()
1282/// \see TH1::SetContour()
1283void RooPlot::SetContour(Int_t nlevels, const Double_t* levels) { _hist->SetContour(nlevels,levels) ; }
1284/// \see TH1::SetContourLevel()
1285void RooPlot::SetContourLevel(Int_t level, Double_t value) { _hist->SetContourLevel(level,value) ; }
1286/// \see TH1::SetDrawOption()
1288/// \see TH1::SetFillAttributes()
1290/// \see TH1::SetFillColor()
1292/// \see TH1::SetFillStyle()
1294/// \see TH1::SetLabelColor()
1295void RooPlot::SetLabelColor(Color_t color, Option_t* axis) { _hist->SetLabelColor(color,axis) ; }
1296/// \see TH1::SetLabelFont()
1297void RooPlot::SetLabelFont(Style_t font, Option_t* axis) { _hist->SetLabelFont(font,axis) ; }
1298/// \see TH1::SetLabelOffset()
1299void RooPlot::SetLabelOffset(Float_t offset, Option_t* axis) { _hist->SetLabelOffset(offset,axis) ; }
1300/// \see TH1::SetLabelSize()
1301void RooPlot::SetLabelSize(Float_t size, Option_t* axis) { _hist->SetLabelSize(size,axis) ; }
1302/// \see TH1::SetLineAttributes()
1304/// \see TH1::SetLineColor()
1306/// \see TH1::SetLineStyle()
1308/// \see TH1::SetLineWidth()
1310/// \see TH1::SetMarkerAttributes()
1312/// \see TH1::SetMarkerColor()
1314/// \see TH1::SetMarkerSize()
1316/// \see TH1::SetMarkerStyle()
1318/// \see TH1::SetNdivisions()
1320/// \see TH1::SetOption()
1321void RooPlot::SetOption(Option_t* option) { _hist->SetOption(option) ; }
1322/// Like TH1::SetStats(), but statistics boxes are *off* by default in RooFit.
1323void RooPlot::SetStats(Bool_t stats) { _hist->SetStats(stats) ; }
1324/// \see TH1::SetTickLength()
1325void RooPlot::SetTickLength(Float_t length, Option_t* axis) { _hist->SetTickLength(length,axis) ; }
1326/// \see TH1::SetTitleFont()
1327void RooPlot::SetTitleFont(Style_t font, Option_t* axis) { _hist->SetTitleFont(font,axis) ; }
1328/// \see TH1::SetTitleOffset()
1329void RooPlot::SetTitleOffset(Float_t offset, Option_t* axis) { _hist->SetTitleOffset(offset,axis) ; }
1330/// \see TH1::SetTitleSize()
1331void RooPlot::SetTitleSize(Float_t size, Option_t* axis) { _hist->SetTitleSize(size,axis) ; }
1332/// \see TH1::SetXTitle()
1333void RooPlot::SetXTitle(const char *title) { _hist->SetXTitle(title) ; }
1334/// \see TH1::SetYTitle()
1335void RooPlot::SetYTitle(const char *title) { _hist->SetYTitle(title) ; }
1336/// \see TH1::SetZTitle()
1337void RooPlot::SetZTitle(const char *title) { _hist->SetZTitle(title) ; }
1338
1339
1340
1341
1342////////////////////////////////////////////////////////////////////////////////
1343/// Plot RooPlot when double-clicked in browser
1344
1346{
1347 Draw();
1348 gPad->Update();
1349}
1350
1351
1352
1353
1354////////////////////////////////////////////////////////////////////////////////
1355
1356void RooPlot::Streamer(TBuffer &R__b)
1357{
1358 // Custom streamer, needed for backward compatibility
1359
1360 if (R__b.IsReading()) {
1361 const bool oldAddDir = TH1::AddDirectoryStatus();
1362 TH1::AddDirectory(false);
1363
1364 // The default c'tor might have registered this with a TDirectory.
1365 // Streaming the TNamed will make this not retrievable anymore, so
1366 // unregister first.
1367 if (_dir)
1368 _dir->Remove(this);
1369
1370 UInt_t R__s, R__c;
1371 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1372 if (R__v > 1) {
1373 R__b.ReadClassBuffer(RooPlot::Class(),this,R__v,R__s,R__c);
1374 } else {
1375 // backward compatible streamer code here
1376 // Version 1 of RooPlot was deriving from TH1 and RooPrintable
1377 // Version 2 derives instead from TNamed and RooPrintable
1378 _hist = new TH1F();
1379 _hist->TH1::Streamer(R__b);
1380 SetName(_hist->GetName());
1382 RooPrintable::Streamer(R__b);
1383 _items.Streamer(R__b);
1384 R__b >> _padFactor;
1385 R__b >> _plotVarClone;
1386 R__b >> _plotVarSet;
1387 R__b >> _normVars;
1388 R__b >> _normNumEvts;
1389 R__b >> _normBinWidth;
1390 R__b >> _defYmin;
1391 R__b >> _defYmax;
1392 R__b.CheckByteCount(R__s, R__c, RooPlot::IsA());
1393 }
1394
1395 TH1::AddDirectory(oldAddDir);
1396 if (_dir)
1397 _dir->Append(this);
1398
1399 } else {
1400 R__b.WriteClassBuffer(RooPlot::Class(),this);
1401 }
1402}
1403
1404////////////////////////////////////////////////////////////////////////////////
1405/// Build a legend that contains all objects that have been drawn on the plot.
1406std::unique_ptr<TLegend> RooPlot::BuildLegend() const {
1407 std::unique_ptr<TLegend> leg(new TLegend(0.5, 0.7, 0.9, 0.9));
1408 leg->SetBorderSize(0);
1409 leg->SetFillStyle(0);
1410 for (int i=0; i < _items.GetSize(); ++i) {
1411 leg->AddEntry(getObject(i));
1412 }
1413
1414 return leg;
1415}
#define e(i)
Definition RSha256.hxx:103
#define coutI(a)
#define coutW(a)
#define coutE(a)
float Size_t
Definition RtypesCore.h:87
short Version_t
Definition RtypesCore.h:65
const Bool_t kFALSE
Definition RtypesCore.h:92
unsigned long ULong_t
Definition RtypesCore.h:55
short Width_t
Definition RtypesCore.h:82
bool Bool_t
Definition RtypesCore.h:63
double Stat_t
Definition RtypesCore.h:77
short Color_t
Definition RtypesCore.h:83
short Style_t
Definition RtypesCore.h:80
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
static void indent(ostringstream &buf, int indent_level)
#define gDirectory
Definition TDirectory.h:290
include TDocParser_001 C image html pict1_TDocParser_001 png width
char name[80]
Definition TGX11.cxx:110
float xmin
float ymin
float xmax
float ymax
char * Form(const char *fmt,...)
#define gPad
virtual Double_t binLow(Int_t bin) const =0
Int_t numBins() const
Return number of bins.
virtual Double_t binHigh(Int_t bin) const =0
virtual Double_t binCenter(Int_t bin) const =0
virtual Int_t binNumber(Double_t x) const =0
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
Bool_t hasMax(const char *name=0) const
Check if variable has an upper bound.
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
Retrive binning configuration with given name or default binning.
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
TString getTitle(Bool_t appendUnit=kFALSE) const
Return this variable's title string.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
Definition RooArgSet.h:118
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Definition RooCurve.h:32
Double_t chiSquare(const RooHist &hist, int nFitParam) const
Calculate the chi^2/NDOF of this curve with respect to the histogram 'hist' accounting nFitParam floa...
Definition RooCurve.cxx:557
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
Definition RooHist.h:27
RooHist * makeResidHist(const RooCurve &curve, bool normalize=false, bool useAverage=false) const
Create and return RooHist containing residuals w.r.t to given curve.
Definition RooHist.cxx:750
TObjOptLink * findLink(const char *name, const char *caller=0) const
Find the link corresponding to the named object in this list.
Definition RooList.cxx:45
Bool_t moveAfter(const char *after, const char *target, const char *caller=0)
Move the target object immediately after the specified object, preserving any Option_t associated wit...
Definition RooList.cxx:103
Bool_t moveBefore(const char *before, const char *target, const char *caller=0)
Move the target object immediately before the specified object, preserving any Option_t associated wi...
Definition RooList.cxx:68
char drawOptions[128]
Definition RooPlot.h:218
void initialize(const char *_rawOpt)
Initialize the DrawOpt helper class.
Definition RooPlot.cxx:1165
Bool_t invisible
Definition RooPlot.h:219
const char * rawOpt() const
Return the raw draw options.
Definition RooPlot.cxx:1184
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:44
RooPlot()
Default constructor coverity[UNINIT_CTOR].
Definition RooPlot.cxx:86
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1275
static Bool_t setAddDirectoryStatus(Bool_t flag)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:79
Bool_t drawAfter(const char *after, const char *target)
Change the order in which our contained objects are drawn so that the target object is drawn just aft...
Definition RooPlot.cxx:965
void SetMarkerSize(Size_t msize=1)
Definition RooPlot.cxx:1315
Double_t _defYmin
Definition RooPlot.h:242
const RooPlotable * _normObj
Definition RooPlot.h:238
RooAbsRealLValue * _plotVarClone
Definition RooPlot.h:234
RooHist * residHist(const char *histname=0, const char *pdfname=0, bool normalize=false, bool useAverage=true) const
Return a RooHist (derives from TGraphAsymErrors) containing the residuals of histogram 'histname' wit...
Definition RooPlot.cxx:1138
virtual void printTitle(std::ostream &os) const
Print frame title.
Definition RooPlot.cxx:733
RooArgSet * _normVars
Definition RooPlot.h:236
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default print options, for a given print style.
Definition RooPlot.cxx:1253
static Bool_t _addDirStatus
non-persistent
Definition RooPlot.h:247
Bool_t drawBefore(const char *before, const char *target)
Change the order in which our contained objects are drawn so that the target object is drawn just bef...
Definition RooPlot.cxx:954
void SetMarkerColor(Color_t tcolor=1)
Definition RooPlot.cxx:1313
Double_t chiSquare(int nFitParam=0) const
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=0)
Definition RooPlot.h:176
virtual void printClassName(std::ostream &os) const
Print frame class name.
Definition RooPlot.cxx:742
void SetContourLevel(Int_t level, Double_t value)
Definition RooPlot.cxx:1285
void SetXTitle(const char *title)
Definition RooPlot.cxx:1333
void SetFillColor(Color_t fcolor)
Definition RooPlot.cxx:1291
TAttMarker * getAttMarker(const char *name=0) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
Definition RooPlot.cxx:886
RooArgSet * _plotVarSet
Definition RooPlot.h:235
void SetStats(Bool_t stats=kTRUE)
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition RooPlot.cxx:1323
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Definition RooPlot.cxx:1319
TDirectory * _dir
Definition RooPlot.h:245
TString histName() const
Construct automatic name of internal TH1.
Definition RooPlot.cxx:330
RooList _items
Definition RooPlot.h:232
TH1 * _hist
Definition RooPlot.h:230
void updateYAxis(Double_t ymin, Double_t ymax, const char *label="")
Update our y-axis limits to accomodate an object whose spread in y is (ymin,ymax).
Definition RooPlot.cxx:659
void SetMarkerStyle(Style_t mstyle=1)
Definition RooPlot.cxx:1317
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
Definition RooPlot.cxx:422
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
Definition RooPlot.cxx:1007
virtual void printArgs(std::ostream &os) const
Interface for printing of object arguments.
Definition RooPlot.cxx:751
void SetDrawOption(Option_t *option="")
Definition RooPlot.cxx:1287
void SetZTitle(const char *title)
Definition RooPlot.cxx:1337
Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Definition RooPlot.cxx:1269
void SetContour(Int_t nlevels, const Double_t *levels=0)
Definition RooPlot.cxx:1283
Double_t getFitRangeNEvt() const
Return the number of events in the fit range.
Definition RooPlot.h:141
Double_t getPadFactor() const
Definition RooPlot.h:145
void SetDirectory(TDirectory *dir)
Set the directory that this plot is associated to.
Definition RooPlot.cxx:362
TAttFill * getAttFill(const char *name=0) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
Definition RooPlot.cxx:876
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1242
virtual void printName(std::ostream &os) const
Print frame name.
Definition RooPlot.cxx:724
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Definition RooPlot.cxx:1299
void SetLineWidth(Width_t lwidth)
Definition RooPlot.cxx:1309
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1325
virtual Stat_t GetBinContent(Int_t) const
A plot object is a frame without any bin contents of its own so this method always returns zero.
Definition RooPlot.cxx:390
void SetFillAttributes()
Definition RooPlot.cxx:1289
Double_t _normNumEvts
Pointer to normalization object ;.
Definition RooPlot.h:239
TAttText * getAttText(const char *name=0) const
Return a pointer to the text attributes of the named object in this plot, or zero if the named object...
Definition RooPlot.cxx:896
void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1301
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
Definition RooPlot.cxx:1091
void SetOption(Option_t *option=" ")
Definition RooPlot.cxx:1321
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:850
TAxis * GetYaxis() const
Definition RooPlot.cxx:1263
void SetNameTitle(const char *name, const char *title)
Set the name and title of the RooPlot to 'name' and 'title'.
Definition RooPlot.cxx:1231
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
Definition RooPlot.cxx:1220
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1297
void SetLineStyle(Style_t lstyle)
Definition RooPlot.cxx:1307
void setPadFactor(Double_t factor)
Definition RooPlot.h:146
TAttLine * getAttLine(const char *name=0) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
Definition RooPlot.cxx:866
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1327
TAxis * GetXaxis() const
Definition RooPlot.cxx:1261
void SetLineColor(Color_t lcolor)
Definition RooPlot.cxx:1305
void SetFillStyle(Style_t fstyle)
Definition RooPlot.cxx:1293
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:834
Bool_t getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
Definition RooPlot.cxx:1034
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
Definition RooPlot.cxx:380
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition RooPlot.cxx:296
void SetMarkerAttributes()
Definition RooPlot.cxx:1311
Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Definition RooPlot.cxx:1271
static RooPlot * frame(const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins)
Create a new frame for a given variable in x.
Definition RooPlot.cxx:249
virtual ~RooPlot()
Destructor.
Definition RooPlot.cxx:343
Bool_t setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Definition RooPlot.cxx:1019
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1295
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
Definition RooPlot.cxx:570
Int_t GetNbinsX() const
Definition RooPlot.cxx:1265
void setInvisible(const char *name, Bool_t flag=kTRUE)
If flag is true object with 'name' is set to be invisible i.e.
Definition RooPlot.cxx:1047
void SetLineAttributes()
Definition RooPlot.cxx:1303
void addTH1(TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:441
virtual void SetMaximum(Double_t maximum=-1111)
Set maximum value of Y axis.
Definition RooPlot.cxx:1081
void SetYTitle(const char *title)
Definition RooPlot.cxx:1335
TObject * findObject(const char *name, const TClass *clas=0) const
Find the named object in our list of items and return a pointer to it.
Definition RooPlot.cxx:982
Double_t _normBinWidth
Definition RooPlot.h:240
void Browse(TBrowser *b)
Plot RooPlot when double-clicked in browser.
Definition RooPlot.cxx:1345
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Frame detailed printing.
Definition RooPlot.cxx:794
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
Definition RooPlot.cxx:1406
void updateFitRangeNorm(const TH1 *hist)
Update our plot normalization over our plot variable's fit range, which will be determined by the fir...
Definition RooPlot.cxx:604
RooCurve * getCurve(const char *name=0) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
Definition RooPlot.cxx:907
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1331
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:691
Double_t _padFactor
Definition RooPlot.h:233
void SetBarOffset(Float_t offset=0.25)
Definition RooPlot.cxx:1279
void SetBarWidth(Float_t width=0.5)
Definition RooPlot.cxx:1281
Int_t GetNdivisions(Option_t *axis="X") const
Definition RooPlot.cxx:1267
void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
Definition RooPlot.cxx:1277
Double_t _defYmax
Definition RooPlot.h:243
TString caller(const char *method) const
Utility function.
Definition RooPlot.cxx:1066
void initialize()
Perform initialization that is common to all constructors.
Definition RooPlot.cxx:307
static RooPlot * frameWithLabels(const RooAbsRealLValue &var)
Create a new frame for a given variable in x, adding bin labels.
Definition RooPlot.cxx:261
void remove(const char *name=0, Bool_t deleteToo=kTRUE)
Remove object with given name, or last object added if no name is given.
Definition RooPlot.cxx:929
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Definition RooPlot.cxx:1329
RooHist * getHist(const char *name=0) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
Definition RooPlot.cxx:917
virtual void printValue(std::ostream &os) const
Print frame arguments.
Definition RooPlot.cxx:765
Class RooPotable is a base class for objects that can be inserted into RooPlots and take advantage of...
Definition RooPlotable.h:26
Double_t getYAxisMin() const
Definition RooPlotable.h:41
virtual Double_t getFitRangeNEvt() const =0
Double_t getYAxisMax() const
Definition RooPlotable.h:42
virtual Double_t getFitRangeBinW() const =0
TObject * crossCast()
Return cast of RooPlotable as TObject.
const char * getYAxisLabel() const
Definition RooPlotable.h:31
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
void Set(Int_t n)
Set size of this array to n doubles.
Definition TArrayD.cxx:106
Fill Area Attributes class.
Definition TAttFill.h:19
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetFillAttributes()
Invoke the DialogCanvas Fill attributes.
Definition TAttFill.cxx:251
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
Line Attributes class.
Definition TAttLine.h:18
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:42
virtual void SetLineAttributes()
Invoke the DialogCanvas Line attributes.
Definition TAttLine.cxx:290
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
Marker Attributes class.
Definition TAttMarker.h:19
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
virtual void SetMarkerAttributes()
Invoke the DialogCanvas Marker attributes.
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
Text Attributes class.
Definition TAttText.h:18
Class to manage histogram axis.
Definition TAxis.h:30
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Definition TAxis.cxx:823
Bool_t IsAlphanumeric() const
Definition TAxis.h:84
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Definition TAxis.cxx:478
Double_t GetXmax() const
Definition TAxis.h:134
const char * GetBinLabel(Int_t bin) const
Return label for bin.
Definition TAxis.cxx:440
Double_t GetXmin() const
Definition TAxis.h:133
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
Definition TAxis.cxx:946
const char * GetTitle() const
Returns title of object.
Definition TAxis.h:129
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Definition TAxis.cxx:540
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition TAxis.cxx:528
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Bool_t IsReading() const
Definition TBuffer.h:86
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Describe directory structure in memory.
Definition TDirectory.h:45
virtual TList * GetList() const
Definition TDirectory.h:176
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
TGraph with asymmetric error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
@ kIsSortedX
graph is sorted in X points
Definition TGraph.h:73
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
Definition TGraph.cxx:1491
1-D histogram with a double per channel (see TH1 documentation)}
Definition TH1.h:618
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 SetLabelFont(Style_t font=62, Option_t *axis="X")
Set font number used to draw axis labels.
Definition Haxis.cxx:249
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8777
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
Definition TH1.cxx:6678
virtual void SetBarOffset(Float_t offset=0.25)
Set the bar offset as fraction of the bin width for drawing mode "B".
Definition TH1.h:359
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
Definition Haxis.cxx:365
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
Definition Haxis.cxx:267
virtual void SetXTitle(const char *title)
Definition TH1.h:413
virtual Int_t GetDimension() const
Definition TH1.h:282
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Definition TH1.cxx:1282
virtual void SetContourLevel(Int_t level, Double_t value)
Set value for one contour level.
Definition TH1.cxx:8370
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition TH1.h:320
virtual void SetNdivisions(Int_t n=510, Option_t *axis="X")
Set the number of divisions to draw an axis.
Definition Haxis.cxx:170
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:8390
virtual Int_t GetNbinsX() const
Definition TH1.h:296
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:398
TAxis * GetYaxis()
Definition TH1.h:321
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
Definition TH1.cxx:8331
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
Definition Haxis.cxx:27
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:399
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:9062
virtual Double_t GetEntries() const
Return the current number of entries.
Definition TH1.cxx:4386
virtual void SetZTitle(const char *title)
Definition TH1.h:415
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition TH1.cxx:3073
virtual TArrayD * GetSumw2()
Definition TH1.h:312
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Specify a parameter offset to control the distance between the axis and the axis' title.
Definition Haxis.cxx:345
virtual void SetLabelColor(Color_t color=1, Option_t *axis="X")
Set axis labels color.
Definition Haxis.cxx:226
virtual void SetAxisColor(Color_t color=1, Option_t *axis="X")
Set color to draw the axis line and tick marks.
Definition Haxis.cxx:187
virtual void SetOption(Option_t *option=" ")
Definition TH1.h:406
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
Set the "axis" range.
Definition Haxis.cxx:201
virtual void SetYTitle(const char *title)
Definition TH1.h:414
virtual void SetTitleFont(Style_t font=62, Option_t *axis="X")
Set the axis' title font.
Definition Haxis.cxx:323
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
Definition TH1.cxx:8475
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Set size of axis' labels.
Definition Haxis.cxx:285
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:8860
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
Definition TH1.cxx:750
virtual void SetBarWidth(Float_t width=0.5)
Set the width of bars as fraction of the bin width for drawing mode "B".
Definition TH1.h:360
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8830
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Set the axis' tick marks length.
Definition Haxis.cxx:302
Iterator abstract base class.
Definition TIterator.h:30
virtual TObject * Next()=0
This class displays a legend box (TPaveText) containing several legend entries.
Definition TLegend.h:23
virtual void Add(TObject *obj)
Definition TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition TList.cxx:822
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:357
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Definition TList.cxx:764
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 void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
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
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition TNamed.cxx:154
Mother of all ROOT objects.
Definition TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:359
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:130
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:445
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition TObject.cxx:679
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:197
Basic string class.
Definition TString.h:136
void ToLower()
Change string to lower-case.
Definition TString.cxx:1145
const char * Data() const
Definition TString.h:369
void ToUpper()
Change string to upper case.
Definition TString.cxx:1158
TString & Append(const char *cs)
Definition TString.h:564
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2331
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:624
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
leg
Definition legend1.C:34
Definition first.py:1
Definition graph.py:1
th1 Draw()