Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMultiGraph Class Reference

A TMultiGraph is a collection of TGraph (or derived) objects.

Introduction

A TMultiGraph allows to manipulate a set of graphs as a single entity. In particular, when drawn, the X and Y axis ranges are automatically computed such as all the graphs will be visible.

TMultiGraph::Add should be used to add a new graph to the list.

The TMultiGraph owns the objects in the list.

The number of graphs in a multigraph can be retrieve with:

mg->GetListOfGraphs()->GetEntries();

MultiGraphs' Drawing

The drawing options are the same as for TGraph. Like for TGraph, the painting is performed thanks to the TGraphPainter class. All details about the various painting options are given in this class.

Example:

TGraph *gr1 = new TGraph(...
mg->Add(gr1,"lp");
mg->Add(gr2,"cp");
mg->Draw("a");
A TGraphErrors is a TGraph with error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
A TMultiGraph is a collection of TGraph (or derived) objects.
Definition TMultiGraph.h:34
TMultiGraph()
TMultiGraph default constructor.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.

Setting drawing options

The drawing option for each TGraph may be specified as an optional second argument of the Add function.

If a draw option is specified, it will be used to draw the graph, otherwise the graph will be drawn with the option specified in TMultiGraph::Draw

Titles setting

The global title and the axis titles can be modified the following way:

[...]
auto mg = new TMultiGraph;
mg->SetTitle("title;xaxis title; yaxis title");
mg->Add(g1);
mg->Add(g2);
mg->Draw("apl");

The option "3D"

A special option 3D allows to draw the graphs in a 3D space. See the following example:

{
auto c0 = new TCanvas("c1","multigraph L3",200,10,700,500);
auto mg = new TMultiGraph();
auto gr1 = new TGraph(); gr1->SetLineColor(kBlue);
auto gr2 = new TGraph(); gr2->SetLineColor(kRed);
auto gr3 = new TGraph(); gr3->SetLineColor(kGreen);
auto gr4 = new TGraph(); gr4->SetLineColor(kOrange);
Double_t dx = 6.28/1000;
Double_t x = -3.14;
for (int i=0; i<=1000; i++) {
x = x+dx;
gr1->SetPoint(i,x,2.*TMath::Sin(x));
gr2->SetPoint(i,x,TMath::Cos(x));
gr3->SetPoint(i,x,TMath::Cos(x*x));
gr4->SetPoint(i,x,TMath::Cos(x*x*x));
}
mg->Add(gr4); gr4->SetTitle("Cos(x*x*x)"); gr4->SetLineWidth(3);
mg->Add(gr3); gr3->SetTitle("Cos(x*x)") ; gr3->SetLineWidth(3);
mg->Add(gr2); gr2->SetTitle("Cos(x)") ; gr2->SetLineWidth(3);
mg->Add(gr1); gr1->SetTitle("2*Sin(x)") ; gr1->SetLineWidth(3);
mg->SetTitle("Multi-graph Title; X-axis Title; Y-axis Title");
mg->Draw("a fb l3d");
mg->GetHistogram()->GetXaxis()->SetRangeUser(0.,2.5);
gPad->Modified();
gPad->Update();
}
@ kRed
Definition Rtypes.h:67
@ kOrange
Definition Rtypes.h:68
@ kGreen
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gPad
The Canvas class.
Definition TCanvas.h:23
Double_t x[n]
Definition legend1.C:17
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599

Options "PADS" and "PADSn"

Like for THStack, options PADS and PADSn to split drawing into individual pads for each graph are also available.

Option Description
"PADS" The current pad/canvas is subdivided into a number of pads equal to the number of graphs in the multigraph and each graph is paint into a separate pad.
"PADSn" Like PADS but the current pad/canvas is subdivided into n columns, automatically calculating the number of rows.
{
auto c0 = new TCanvas("c1","multigraph L3",200,10,700,500);
auto mg = new TMultiGraph();
auto gr1 = new TGraph(); gr1->SetLineColor(kBlue);
auto gr2 = new TGraph(); gr2->SetLineColor(kRed);
auto gr3 = new TGraph(); gr3->SetLineColor(kGreen);
auto gr4 = new TGraph(); gr4->SetLineColor(kOrange);
Double_t dx = 6.28/1000;
Double_t x = -3.14;
for (int i=0; i<=1000; i++) {
x = x+dx;
gr1->SetPoint(i,x,2.*TMath::Sin(x));
gr2->SetPoint(i,x,TMath::Cos(x));
gr3->SetPoint(i,x,TMath::Cos(x*x));
gr4->SetPoint(i,x,TMath::Cos(x*x*x));
}
mg->Add(gr4); gr4->SetTitle("Cos(x*x*x)"); gr4->SetLineWidth(3);
mg->Add(gr3); gr3->SetTitle("Cos(x*x)") ; gr3->SetLineWidth(3);
mg->Add(gr2); gr2->SetTitle("Cos(x)") ; gr2->SetLineWidth(3);
mg->Add(gr1); gr1->SetTitle("2*Sin(x)") ; gr1->SetLineWidth(3);
mg->SetTitle("Multi-graph Title; X-axis Title; Y-axis Title");
mg->Draw("a fb l pads3");
mg->GetHistogram()->GetXaxis()->SetRangeUser(0.,2.5);
gPad->Modified();
gPad->Update();
}

Legend drawing

The method TPad::BuildLegend is able to extract the graphs inside a multigraph. The following example demonstrate this.

{
auto c3 = new TCanvas("c3","c3",600, 400);
auto mg = new TMultiGraph("mg","mg");
const Int_t size = 10;
double px[size];
double py1[size];
double py2[size];
double py3[size];
for ( int i = 0; i < size ; ++i ) {
px[i] = i;
py1[i] = size - i;
py2[i] = size - 0.5 * i;
py3[i] = size - 0.6 * i;
}
auto gr1 = new TGraph( size, px, py1 );
gr1->SetName("gr1");
gr1->SetTitle("graph 1");
gr1->SetMarkerStyle(21);
gr1->SetDrawOption("AP");
gr1->SetLineColor(2);
gr1->SetLineWidth(4);
gr1->SetFillStyle(0);
auto gr2 = new TGraph( size, px, py2 );
gr2->SetName("gr2");
gr2->SetTitle("graph 2");
gr2->SetMarkerStyle(22);
gr2->SetMarkerColor(2);
gr2->SetDrawOption("P");
gr2->SetLineColor(3);
gr2->SetLineWidth(4);
gr2->SetFillStyle(0);
auto gr3 = new TGraph( size, px, py3 );
gr3->SetName("gr3");
gr3->SetTitle("graph 3");
gr3->SetMarkerStyle(23);
gr3->SetLineColor(4);
gr3->SetLineWidth(4);
gr3->SetFillStyle(0);
mg->Add( gr1 );
mg->Add( gr2 );
gr3->Draw("ALP");
mg->Draw("LP");
c3->BuildLegend();
}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
return c3
Definition legend3.C:15

Automatic coloring

Automatic coloring according to the current palette is available as shown in the following example:

{
auto mg = new TMultiGraph();
auto gr1 = new TGraph(); gr1->SetMarkerStyle(20);
auto gr2 = new TGraph(); gr2->SetMarkerStyle(21);
auto gr3 = new TGraph(); gr3->SetMarkerStyle(23);
auto gr4 = new TGraph(); gr4->SetMarkerStyle(24);
Double_t dx = 6.28/100;
Double_t x = -3.14;
for (int i=0; i<=100; i++) {
x = x+dx;
gr1->SetPoint(i,x,2.*TMath::Sin(x));
gr2->SetPoint(i,x,TMath::Cos(x));
gr3->SetPoint(i,x,TMath::Cos(x*x));
gr4->SetPoint(i,x,TMath::Cos(x*x*x));
}
mg->Add(gr4,"PL");
mg->Add(gr3,"PL");
mg->Add(gr2,"*L");
mg->Add(gr1,"PL");
mg->Draw("A pmc plc");
}

Reverse axis

Since
ROOT version 6.19/02

When a TMultiGraph is drawn, the X-axis is drawn with increasing values from left to right and the Y-axis from bottom to top. The two options RX and RY allow to change this order. The option RX allows to draw the X-axis with increasing values from right to left and the RY option allows to draw the Y-axis with increasing values from top to bottom. The following example illustrate how to use these options.

{
auto *c = new TCanvas();
c->Divide(2,1);
auto *g1 = new TGraphErrors();
g1->SetPoint(0,-4,-3);
g1->SetPoint(1,1,1);
g1->SetPoint(2,2,1);
g1->SetPoint(3,3,4);
g1->SetPoint(4,5,5);
g1->SetPointError(0,1.,2.);
g1->SetPointError(1,2,1);
g1->SetPointError(2,2,3);
g1->SetPointError(3,3,2);
g1->SetPointError(4,4,5);
g1->SetMarkerStyle(21);
auto *g2 = new TGraph();
g2->SetPoint(0,4,8);
g2->SetPoint(1,5,9);
g2->SetPoint(2,6,10);
g2->SetPoint(3,10,11);
g2->SetPoint(4,15,12);
g2->SetLineColor(kRed);
g2->SetLineWidth(5);
auto mg = new TMultiGraph();
mg->Add(g1,"P");
mg->Add(g2,"L");
c->cd(1); gPad->SetGrid(1,1);
mg->Draw("A");
c->cd(2); gPad->SetGrid(1,1);
mg->Draw("A RX RY");
}
#define c(i)
Definition RSha256.hxx:101

MultiGraphs' fitting

The following example shows how to fit a TMultiGraph.

{
auto c1 = new TCanvas("c1","c1",600,400);
Double_t px1[2] = {2.,4.};
Double_t dx1[2] = {0.1,0.1};
Double_t py1[2] = {2.1,4.0};
Double_t dy1[2] = {0.3,0.2};
Double_t px2[2] = {3.,5.};
Double_t dx2[2] = {0.1,0.1};
Double_t py2[2] = {3.2,4.8};
Double_t dy2[2] = {0.3,0.2};
gStyle->SetOptFit(0001);
auto g1 = new TGraphErrors(2,px1,py1,dx1,dy1);
g1->SetMarkerStyle(21);
g1->SetMarkerColor(2);
auto g2 = new TGraphErrors(2,px2,py2,dx2,dy2);
g2->SetMarkerStyle(22);
g2->SetMarkerColor(3);
auto g = new TMultiGraph();
g->Add(g1);
g->Add(g2);
g->Draw("AP");
g->Fit("pol1","FQ");
}
#define g(i)
Definition RSha256.hxx:105
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
Definition TStyle.cxx:1594
return c1
Definition legend1.C:41

Fit box position

When the graphs in a TMultiGraph are fitted, the fit parameters boxes overlap. The following example shows how to make them all visible.

void gr007_multigraph() {
auto c1 = new TCanvas("c1","multigraph",700,500);
c1->SetGrid();
//Initialize a TMultiGraph to hold multiple graphs
//This ensures the entire dataset from all added graphs is visible without manual range adjustments.
auto mg = new TMultiGraph();
//Create first graph
const Int_t n1 = 10;
Double_t px1[] = {-0.1, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
Double_t py1[] = {-1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
Double_t ex1[] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};
Double_t ey1[] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
auto gr1 = new TGraphErrors(n1,px1,py1,ex1,ey1);
gr1->SetMarkerColor(kBlue);
gr1->SetMarkerStyle(21);
gr1->Fit("gaus","q");
auto func1 = (TF1 *) gr1->GetListOfFunctions()->FindObject("gaus");
func1->SetLineColor(kBlue);
//Add the first graph to the multigraph
mg->Add(gr1);
//Create second graph
const Int_t n2 = 10;
Float_t x2[] = {-0.28, 0.005, 0.19, 0.29, 0.45, 0.56,0.65,0.80,0.90,1.01};
Float_t y2[] = {2.1,3.86,7,9,10,10.55,9.64,7.26,5.42,2};
Float_t ex2[] = {.04,.12,.08,.06,.05,.04,.07,.06,.08,.04};
Float_t ey2[] = {.6,.8,.7,.4,.3,.3,.4,.5,.6,.7};
auto gr2 = new TGraphErrors(n2,x2,y2,ex2,ey2);
gr2->SetMarkerColor(kRed);
gr2->SetMarkerStyle(20);
gr2->Fit("pol5","q");
auto func2 = (TF1 *) gr2->GetListOfFunctions()->FindObject("pol5");
func2->SetLineColor(kRed);
func2->SetLineStyle(2);
//Add the second graph to the multigraph
mg->Add(gr2);
mg->Draw("ap");
//Force drawing of canvas to generate the fit TPaveStats
c1->Update();
auto stats1 = (TPaveStats*) gr1->GetListOfFunctions()->FindObject("stats");
auto stats2 = (TPaveStats*) gr2->GetListOfFunctions()->FindObject("stats");
if (stats1 && stats2) {
stats1->SetTextColor(kBlue);
stats2->SetTextColor(kRed);
stats1->SetX1NDC(0.12); stats1->SetX2NDC(0.32); stats1->SetY1NDC(0.82);
stats2->SetX1NDC(0.72); stats2->SetX2NDC(0.92); stats2->SetY1NDC(0.75);
c1->Modified();
}
}
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char y2
1-Dim function class
Definition TF1.h:182
The histogram statistics painter class.
Definition TPaveStats.h:18

Axis' limits setting

The axis limits can be changed the like for TGraph. The same methods apply on the multigraph. Note the two differents ways to change limits on X and Y axis.

{
auto c2 = new TCanvas("c2","c2",600,400);
TGraph *g[3];
Double_t x[10] = {0,1,2,3,4,5,6,7,8,9};
Double_t y[10] = {1,2,3,4,5,5,4,3,2,1};
auto mg = new TMultiGraph();
for (int i=0; i<3; i++) {
g[i] = new TGraph(10, x, y);
g[i]->SetMarkerStyle(20);
g[i]->SetMarkerColor(i+2);
for (int j=0; j<10; j++) y[j] = y[j]-1;
mg->Add(g[i]);
}
mg->Draw("APL");
mg->GetXaxis()->SetTitle("E_{#gamma} (GeV)");
mg->GetYaxis()->SetTitle("Coefficients");
// Change the axis limits
gPad->Modified();
mg->GetXaxis()->SetLimits(1.5,7.5);
mg->SetMinimum(0.);
mg->SetMaximum(10.);
}
Double_t y[n]
Definition legend1.C:17
return c2
Definition legend2.C:14

Definition at line 34 of file TMultiGraph.h.

Public Types

enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 TMultiGraph ()
 TMultiGraph default constructor.
 
 TMultiGraph (const char *name, const char *title)
 Constructor with name and title.
 
 ~TMultiGraph () override
 TMultiGraph destructor.
 
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
 
virtual void Add (TGraph *graph, Option_t *chopt="")
 Add a new graph to the list of graphs.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
TIter begin () const
 Get iterator over internal graphs list.
 
void Browse (TBrowser *b) override
 Browse multigraph.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
void Clear (Option_t *option="") override
 Set name and title to empty strings ("").
 
TObjectClone (const char *newname="") const override
 Make a clone of an object using the Streamer facility.
 
Int_t Compare (const TObject *obj) const override
 Compare two TNamed objects.
 
void Copy (TObject &named) const override
 Copy this to obj.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 Compute distance from point px,py to each graph.
 
void Draw (Option_t *chopt="") override
 Draw this multigraph with its current attributes.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
TIter end () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual TFitResultPtr Fit (const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
 Fit this graph with function with name fname.
 
virtual TFitResultPtr Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Axis_t rxmin=0, Axis_t rxmax=0)
 Fit this multigraph with function f1.
 
virtual void FitPanel ()
 Display a panel with all histogram fit options.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
TF1GetFunction (const char *name) const
 Return pointer to function with name.
 
virtual Option_tGetGraphDrawOption (const TGraph *gr) const
 Return the draw option for the TGraph gr in this TMultiGraph.
 
TH1FGetHistogram ()
 Returns a pointer to the histogram used to draw the axis.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
TListGetListOfFunctions ()
 Return pointer to list of functions.
 
const TListGetListOfFunctions () const
 
TListGetListOfGraphs () const
 
const char * GetName () const override
 Returns name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
const char * GetTitle () const override
 Returns title of object.
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
TAxisGetXaxis ()
 Get x axis of the graph.
 
TAxisGetYaxis ()
 Get y axis of the graph.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
ULong_t Hash () const override
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void InitExpo (Double_t xmin, Double_t xmax)
 Compute Initial values of parameters for an exponential.
 
virtual void InitGaus (Double_t xmin, Double_t xmax)
 Compute Initial values of parameters for a gaussian.
 
virtual void InitPolynom (Double_t xmin, Double_t xmax)
 Compute Initial values of parameters for a polynom.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
TClassIsA () const override
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
virtual Int_t IsInside (Double_t x, Double_t y) const
 Return 1 if the point (x,y) is inside one of the graphs 0 otherwise.
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
Bool_t IsSortable () const override
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void LeastSquareFit (Int_t m, Double_t *a, Double_t xmin, Double_t xmax)
 Least squares lpolynomial fitting without weights.
 
virtual void LeastSquareLinearFit (Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin, Double_t xmax)
 Least square linear fit without weights.
 
void ls (Option_t *option="") const override
 List TNamed name and title.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
void Paint (Option_t *chopt="") override
 Paint all the graphs of this multigraph.
 
void PaintPads (Option_t *chopt="", Int_t nColumn=0)
 Divides the active pad and draws all Graphs in the Multigraph separately.
 
void PaintPolyLine3D (Option_t *chopt="")
 Paint all the graphs of this multigraph as 3D lines.
 
void PaintReverse (Option_t *chopt="")
 Paint all the graphs of this multigraph reverting values along X and/or Y axis.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
void Print (Option_t *chopt="") const override
 Print the list of graphs.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
void RecursiveRemove (TObject *obj) override
 Recursively remove this object from a list.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 Save primitive as a C++ statement(s) on output stream out.
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
void SetHistogram (TH1F *hist)
 Set histogram which will be used for axes painting.
 
virtual void SetMaximum (Double_t maximum=-1111)
 Set multigraph maximum.
 
virtual void SetMinimum (Double_t minimum=-1111)
 Set multigraph minimum.
 
virtual void SetName (const char *name)
 Set the name of the TNamed.
 
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title).
 
virtual void SetTitle (const char *title="")
 Set the title of the TNamed.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject.
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Types

enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 

Protected Member Functions

 TMultiGraph (const TMultiGraph &)=delete
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 
TMultiGraphoperator= (const TMultiGraph &)=delete
 
void SavePrimitiveNameTitle (std::ostream &out, const char *variable_name)
 Save object name and title into the output stream "out".
 

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
 
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
 
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.
 

Protected Attributes

TListfFunctions {nullptr}
 Pointer to list of functions (fits and user)
 
TListfGraphs {nullptr}
 Pointer to list of TGraphs.
 
TH1FfHistogram {nullptr}
 Pointer to histogram used for drawing axis.
 
Double_t fMaximum {-1111}
 Maximum value for plotting along y.
 
Double_t fMinimum {-1111}
 Minimum value for plotting along y.
 
TString fName
 
TString fTitle
 

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.
 

Private Attributes

UInt_t fBits
 bit field status word
 
UInt_t fUniqueID
 object unique identifier
 

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
 
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable
 

#include <TMultiGraph.h>

Inheritance diagram for TMultiGraph:
TNamed TObject

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EStatusBits

Enumerator
kCanDelete 

if object in a list can be deleted

kMustCleanup 

if object destructor must call RecursiveRemove()

kIsReferenced 

if object is referenced by a TRef or TRefArray

kHasUUID 

if object has a TUUID (its fUniqueID=UUIDNumber)

kCannotPick 

if object in a pad cannot be picked

kNoContextMenu 

if object does not want context menu

kInvalidObject 

if object ctor succeeded but object should not be used

Definition at line 70 of file TObject.h.

Constructor & Destructor Documentation

◆ TMultiGraph() [1/3]

TMultiGraph::TMultiGraph ( const TMultiGraph & )
protecteddelete

◆ TMultiGraph() [2/3]

TMultiGraph::TMultiGraph ( )

TMultiGraph default constructor.

Definition at line 415 of file TMultiGraph.cxx.

◆ TMultiGraph() [3/3]

TMultiGraph::TMultiGraph ( const char * name,
const char * title )

Constructor with name and title.

Definition at line 421 of file TMultiGraph.cxx.

◆ ~TMultiGraph()

TMultiGraph::~TMultiGraph ( )
override

TMultiGraph destructor.

Definition at line 429 of file TMultiGraph.cxx.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ Add()

void TMultiGraph::Add ( TGraph * graph,
Option_t * chopt = "" )
virtual

Add a new graph to the list of graphs.

Note that the graph is now owned by the TMultigraph. Deleting the TMultiGraph object will automatically delete the graphs. You should not delete the graphs when the TMultigraph is still active.

Definition at line 465 of file TMultiGraph.cxx.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ begin()

TIter TMultiGraph::begin ( ) const

Get iterator over internal graphs list.

Definition at line 1698 of file TMultiGraph.cxx.

◆ Browse()

void TMultiGraph::Browse ( TBrowser * b)
overridevirtual

Browse multigraph.

Reimplemented from TObject.

Definition at line 476 of file TMultiGraph.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ Class()

static TClass * TMultiGraph::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TMultiGraph::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TMultiGraph::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 85 of file TMultiGraph.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

void TNamed::Clear ( Option_t * option = "")
overridevirtualinherited

Set name and title to empty strings ("").

Reimplemented from TObject.

Reimplemented in TStreamerInfo, TVirtualStreamerInfo, TProcessID, TTask, TPrincipal, and TVirtualFitter.

Definition at line 63 of file TNamed.cxx.

◆ Clone()

TObject * TNamed::Clone ( const char * newname = "") const
overridevirtualinherited

Make a clone of an object using the Streamer facility.

If newname is specified, this will be the name of the new object.

Reimplemented from TObject.

Reimplemented in TStreamerInfo, and TTreeIndex.

Definition at line 73 of file TNamed.cxx.

◆ Compare()

Int_t TNamed::Compare ( const TObject * obj) const
overridevirtualinherited

Compare two TNamed objects.

Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 84 of file TNamed.cxx.

◆ Copy()

void TNamed::Copy ( TObject & named) const
overridevirtualinherited

Copy this to obj.

Reimplemented from TObject.

Reimplemented in TSystemDirectory, TSystemFile, TProfile, TProfile2D, TProfile3D, TPieSlice, TStyle, TText, and TXTRU.

Definition at line 93 of file TNamed.cxx.

◆ DeclFileName()

static const char * TMultiGraph::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 85 of file TMultiGraph.h.

◆ Delete()

void TObject::Delete ( Option_t * option = "")
virtualinherited

◆ DistancetoPrimitive()

Int_t TMultiGraph::DistancetoPrimitive ( Int_t px,
Int_t py )
overridevirtual

Compute distance from point px,py to each graph.

Reimplemented from TObject.

Definition at line 491 of file TMultiGraph.cxx.

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TTreeViewer, and TThread.

Definition at line 1059 of file TObject.cxx.

◆ Draw()

void TMultiGraph::Draw ( Option_t * option = "")
overridevirtual

Draw this multigraph with its current attributes.

Options to draw a graph are described in TGraphPainter.

The drawing option for each TGraph may be specified as an optional second argument of the Add function. You can use GetGraphDrawOption to return this option.

If a draw option is specified, it will be used to draw the graph, otherwise the graph will be drawn with the option specified in TMultiGraph::Draw. Use GetDrawOption to return the option specified when drawing the TMultiGraph.

Reimplemented from TObject.

Definition at line 528 of file TMultiGraph.cxx.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TSystemDirectory, TSystemFile, and TGFrame.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TSystemDirectory, TSystemFile, TGFrame, TAxis, and TCanvas.

Definition at line 319 of file TObject.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fBits 50331648 bit field status word
fLineColor 1 line color
fLineStyle 1 line style
fLineWidth 1 line width
fFillColor 19 fill area color
fFillStyle 1001 fill area style
#define X(type, name)
Option_t Option_t TPoint TPoint angle
Option_t Option_t width
Option_t Option_t style
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line

Reimplemented in TSystemFile, TCollection, TClass, TGFrame, and TGPack.

Definition at line 367 of file TObject.cxx.

◆ end()

TIter TMultiGraph::end ( ) const
inline

Definition at line 69 of file TMultiGraph.h.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in TMethodCall, TCling, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in TCling, TMethodCall, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ FillBuffer()

void TNamed::FillBuffer ( char *& buffer)
virtualinherited

Encode TNamed into output buffer.

Reimplemented in TKeySQL, TSQLFile, TKeyXML, TXMLFile, TDirectoryFile, TFile, and TKey.

Definition at line 103 of file TNamed.cxx.

◆ FindObject() [1/2]

TObject * TObject::FindObject ( const char * name) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object by name inside this object.

Reimplemented in TListOfEnums, TMap, TDirectory, TFolder, TROOT, TListOfTypes, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 425 of file TObject.cxx.

◆ FindObject() [2/2]

TObject * TObject::FindObject ( const TObject * obj) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object inside this object.

Reimplemented in TMap, TDirectory, TFolder, TROOT, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 435 of file TObject.cxx.

◆ Fit() [1/2]

TFitResultPtr TMultiGraph::Fit ( const char * fname,
Option_t * option = "",
Option_t * goption = "",
Axis_t xmin = 0,
Axis_t xmax = 0 )
virtual

Fit this graph with function with name fname.

interface to TF1::Fit(TF1 *f1...

Definition at line 546 of file TMultiGraph.cxx.

◆ Fit() [2/2]

TFitResultPtr TMultiGraph::Fit ( TF1 * f1,
Option_t * option = "",
Option_t * goption = "",
Axis_t rxmin = 0,
Axis_t rxmax = 0 )
virtual

Fit this multigraph with function f1.

In this function all graphs of the multigraph are fitted simultaneously

f1 is an already predefined function created by TF1. Predefined functions such as gaus, expo and poln are automatically created by ROOT.

The list of fit options is given in parameter optionwhich may takes the following values:

  • "W" Ignore all the point errors
  • "U" Use a User specified fitting algorithm (via SetFCN)
  • "Q" Quiet mode (minimum printing)
  • "V" Verbose mode (default is between Q and V)
  • "B" Use this option when you want to fix one or more parameters and the fitting function is like "gaus","expo","poln","landau".
  • "R" Use the Range specified in the function range
  • "N" Do not store the graphics function, do not draw
  • "0" Do not plot the result of the fit. By default the fitted function is drawn unless the option"N" above is specified.
  • "+" Add this new fitted function to the list of fitted functions (by default, any previous function is deleted)
  • "C" In case of linear fitting, not calculate the chisquare (saves time)
  • "F" If fitting a polN, switch to minuit fitter
  • "ROB" In case of linear fitting, compute the LTS regression coefficients (robust(resistant) regression), using the default fraction of good points
  • "ROB=0.x" - compute the LTS regression coefficients, using 0.x as a fraction of good points

When the fit is drawn (by default), the parameter goption may be used to specify a list of graphics options. See TGraph::Paint for a complete list of these options.

In order to use the Range option, one must first create a function with the expression to be fitted. For example, if your graph has a defined range between -4 and 4 and you want to fit a gaussian only in the interval 1 to 3, you can do:

TF1 *f1 = new TF1("f1","gaus",1,3);
graph->Fit("f1","R");
TF1 * f1
Definition legend1.C:11

Who is calling this function ?

Note that this function is called when calling TGraphErrors::Fit or TGraphAsymmErrors::Fit ot TGraphBentErrors::Fit see the discussion below on the errors calculation.

Setting initial conditions

Parameters must be initialized before invoking the Fit function. The setting of the parameter initial values is automatic for the predefined functions : poln, expo, gaus, landau. One can however disable this automatic computation by specifying the option "B". You can specify boundary limits for some or all parameters via

virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set lower and upper limits for parameter ipar.
Definition TF1.cxx:3562

if parmin>=parmax, the parameter is fixed Note that you are not forced to fix the limits for all parameters. For example, if you fit a function with 6 parameters, you can do:

func->SetParameters(0,3.1,1.e-6,0.1,-8,100);
func->SetParLimits(4,-10,-4);
func->SetParLimits(5, 1,1);

With this setup, parameters 0->3 can vary freely Parameter 4 has boundaries [-10,-4] with initial value -8 Parameter 5 is fixed to 100.

Fit range

The fit range can be specified in two ways:

  • specify rxmax > rxmin (default is rxmin=rxmax=0)
  • specify the option "R". In this case, the function will be taken instead of the full graph range.

Changing the fitting function

By default a chi2 fitting function is used for fitting the TGraphs's. The function is implemented in FitUtil::EvaluateChi2. In case of TGraphErrors an effective chi2 is used (see TGraphErrors fit in TGraph::Fit) and is implemented in FitUtil::EvaluateChi2Effective To specify a User defined fitting function, specify option "U" and call the following function:

static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.

where MyFittingFunction is of type:

#define f(i)
Definition RSha256.hxx:104

Access to the fit result

The function returns a TFitResultPtr which can hold a pointer to a TFitResult object. By default the TFitResultPtr contains only the status of the fit and it converts automatically to an integer. If the option "S" is instead used, TFitResultPtr contains the TFitResult and behaves as a smart pointer to it. For example one can do:

TFitResultPtr r = graph->Fit("myFunc","S");
TMatrixDSym cov = r->GetCovarianceMatrix(); // to access the covariance matrix
Double_t par0 = r->Parameter(0); // retrieve the value for the parameter 0
Double_t err0 = r->ParError(0); // retrieve the error for the parameter 0
r->Print("V"); // print full information of fit including covariance matrix
r->Write(); // store the result in a file
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...

The fit parameters, error and chi2 (but not covariance matrix) can be retrieved also from the fitted function.

Associated functions

One or more objects (typically a TF1*) can be added to the list of functions (fFunctions) associated to each graph. When TGraph::Fit is invoked, the fitted function is added to this list. Given a graph gr, one can retrieve an associated function with:

TF1 *myfunc = gr->GetFunction("myfunc");
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
Definition TGraph.cxx:1447
TGraphErrors * gr
Definition legend1.C:25

If the graph is made persistent, the list of associated functions is also persistent. Given a pointer (see above) to an associated function myfunc, one can retrieve the function/fit parameters with calls such as:

Double_t chi2 = myfunc->GetChisquare();
Double_t par0 = myfunc->GetParameter(0); //value of 1st parameter
Double_t err0 = myfunc->GetParError(0); //error on first parameter

Fit Statistics

You can change the statistics box to display the fit parameters with the TStyle::SetOptFit(mode) method. This mode has four digits. mode = pcev (default = 0111)

  • v = 1; print name/values of parameters
  • e = 1; print errors (if e=1, v must be 1)
  • c = 1; print Chisquare/Number of degrees of freedom
  • p = 1; print Probability

For example: gStyle->SetOptFit(1011); prints the fit probability, parameter names/values, and errors. You can change the position of the statistics box with these lines (where g is a pointer to the TGraph):

Root > TPaveStats *st = (TPaveStats*)g->GetListOfFunctions()->FindObject("stats")
Root > st->SetX1NDC(newx1); //new x start position
Root > st->SetX2NDC(newx2); //new x end position

Definition at line 719 of file TMultiGraph.cxx.

◆ FitPanel()

void TMultiGraph::FitPanel ( )
virtual

Display a panel with all histogram fit options.

See class TFitPanel for example

Definition at line 736 of file TMultiGraph.cxx.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetFunction()

TF1 * TMultiGraph::GetFunction ( const char * name) const

Return pointer to function with name.

Functions such as TGraph::Fit store the fitted function in the list of functions of this graph.

Definition at line 1106 of file TMultiGraph.cxx.

◆ GetGraphDrawOption()

Option_t * TMultiGraph::GetGraphDrawOption ( const TGraph * gr) const
virtual

Return the draw option for the TGraph gr in this TMultiGraph.

The return option is the one specified when calling TMultiGraph::Add(gr,option).

Definition at line 760 of file TMultiGraph.cxx.

◆ GetHistogram()

TH1F * TMultiGraph::GetHistogram ( )

Returns a pointer to the histogram used to draw the axis.

Takes into account following cases.

  1. if fHistogram exists it is returned
  2. if fHistogram doesn't exists and gPad exists gPad is updated. That may trigger the creation of fHistogram. If fHistogram still does not exit but hframe does (if user called TPad::DrawFrame) the pointer to hframe histogram is returned
  3. after the two previous steps, if fHistogram still doesn't exist, then it is created.

Definition at line 1035 of file TMultiGraph.cxx.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in TSystemFile, TGeoVolume, TASImage, TGMainFrame, TKey, ROOT::Experimental::XRooFit::xRooNode, TBranch, TVirtualBranchBrowsable, TMethodBrowsable, and TBranchElement.

Definition at line 472 of file TObject.cxx.

◆ GetListOfFunctions() [1/2]

TList * TMultiGraph::GetListOfFunctions ( )

Return pointer to list of functions.

If pointer is null create the list

Definition at line 1116 of file TMultiGraph.cxx.

◆ GetListOfFunctions() [2/2]

const TList * TMultiGraph::GetListOfFunctions ( ) const
inline

Definition at line 71 of file TMultiGraph.h.

◆ GetListOfGraphs()

TList * TMultiGraph::GetListOfGraphs ( ) const
inline

Definition at line 67 of file TMultiGraph.h.

◆ GetName()

const char * TNamed::GetName ( ) const
inlineoverridevirtualinherited

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 49 of file TNamed.h.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TGeoNode, TGeoVolume, TGeoTrack, TASImage, TColorWheel, TAxis3D, TNode, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TF1, TF2, TGraph, TH1, THistPainter, TPaletteAxis, TFileDrawMap, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

virtual Option_t * TObject::GetOption ( ) const
inlinevirtualinherited

◆ GetTitle()

const char * TNamed::GetTitle ( ) const
inlineoverridevirtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 50 of file TNamed.h.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetXaxis()

TAxis * TMultiGraph::GetXaxis ( )

Get x axis of the graph.

This method returns a valid axis only after the TMultigraph has been drawn.

Definition at line 1127 of file TMultiGraph.cxx.

◆ GetYaxis()

TAxis * TMultiGraph::GetYaxis ( )

Get y axis of the graph.

This method returns a valid axis only after the TMultigraph has been drawn.

Definition at line 1139 of file TMultiGraph.cxx.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGWindow, TGuiBldDragManager, TGraphTime, TGLEventHandler, TGCommandPlugin, TGDNDManager, TGFileContainer, TGPopupMenu, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGHtml, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TNamed::Hash ( ) const
inlineoverridevirtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

ULong_t Hash() const override
Return hash value for this object.
Definition TNamed.h:51
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented from TObject.

Definition at line 51 of file TNamed.h.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ InitExpo()

void TMultiGraph::InitExpo ( Double_t xmin,
Double_t xmax )
virtual

Compute Initial values of parameters for an exponential.

Definition at line 820 of file TMultiGraph.cxx.

◆ InitGaus()

void TMultiGraph::InitGaus ( Double_t xmin,
Double_t xmax )
virtual

Compute Initial values of parameters for a gaussian.

Definition at line 775 of file TMultiGraph.cxx.

◆ InitPolynom()

void TMultiGraph::InitPolynom ( Double_t xmin,
Double_t xmax )
virtual

Compute Initial values of parameters for a polynom.

Definition at line 837 of file TMultiGraph.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in TSystemFile, TInspectorObject, TGFrame, and ROOT::Experimental::XRooFit::xRooNode.

Definition at line 570 of file TObject.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TMultiGraph::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 85 of file TMultiGraph.h.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TObjString, TQCommand, TPair, and TGObject.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

◆ IsInside()

Int_t TMultiGraph::IsInside ( Double_t x,
Double_t y ) const
virtual

Return 1 if the point (x,y) is inside one of the graphs 0 otherwise.

Definition at line 1009 of file TMultiGraph.cxx.

◆ IsOnHeap()

R__ALWAYS_INLINE Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsSortable()

Bool_t TNamed::IsSortable ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 52 of file TNamed.h.

◆ IsZombie()

R__ALWAYS_INLINE Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ LeastSquareFit()

void TMultiGraph::LeastSquareFit ( Int_t m,
Double_t * a,
Double_t xmin,
Double_t xmax )
virtual

Least squares lpolynomial fitting without weights.

  • m number of parameters
  • a array of parameters
  • first 1st point number to fit (default =0)
  • last last point number to fit (default=fNpoints-1)

based on CERNLIB routine LSQ: Translated to C++ by Rene Brun

Definition at line 861 of file TMultiGraph.cxx.

◆ LeastSquareLinearFit()

void TMultiGraph::LeastSquareLinearFit ( Int_t ndata,
Double_t & a0,
Double_t & a1,
Int_t & ifail,
Double_t xmin,
Double_t xmax )
virtual

Least square linear fit without weights.

Fit a straight line (a0 + a1*x) to the data in this graph.

  • ndata: number of points to fit
  • first: first point number to fit
  • last: last point to fit O(ndata should be last-first
  • ifail: return parameter indicating the status of the fit (ifail=0, fit is OK)

extracted from CERNLIB LLSQ: Translated to C++ by Rene Brun

Definition at line 956 of file TMultiGraph.cxx.

◆ ls()

void TNamed::ls ( Option_t * option = "") const
overridevirtualinherited

List TNamed name and title.

Reimplemented from TObject.

Reimplemented in ROOT::Experimental::XRooFit::xRooBrowser, TVirtualStreamerInfo, TROOT, TStreamerElement, TStreamerBase, TStreamerSTL, TText, TStreamerInfo, TTask, and TNode.

Definition at line 112 of file TNamed.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ Notify()

Bool_t TObject::Notify ( )
virtualinherited

This method must be overridden to handle object notification (the base implementation is no-op).

Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.

For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.

Reimplemented in TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TFileHandler, TSignalHandler, TStdExceptionHandler, TProcessEventTimer, TTimer, TIdleTimer, TSingleShotCleaner, TCollection, TRefTable, TBrowserTimer, TInterruptHandler, TTermInputHandler, TThreadTimer, TGLRedrawTimer, TViewTimer, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TViewUpdateTimer, TPopupDelayTimer, TRepeatTimer, TSBRepeatTimer, TGTextEditHist, TInsCharCom, TDelCharCom, TBreakLineCom, TInsTextCom, TDelTextCom, TBlinkTimer, TTipDelayTimer, TGuiBldDragManagerRepeatTimer, TARInterruptHandler, TASLogHandler, TASInterruptHandler, TASSigPipeHandler, TASInputHandler, TSocketHandler, TTimeOutTimer, TBranchElement, TBranchRef, TLeafObject, TSelector, TTree, TSelectorDraw, TSelectorEntries, TTreeFormula, TTreeFormulaManager, TTreeReader, h1analysis, h1analysisTreeReader, and TSysEvtHandler.

Definition at line 618 of file TObject.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ operator=()

TMultiGraph & TMultiGraph::operator= ( const TMultiGraph & )
protecteddelete

◆ Paint()

void TMultiGraph::Paint ( Option_t * chopt = "")
overridevirtual

Paint all the graphs of this multigraph.

Reimplemented from TObject.

Definition at line 1150 of file TMultiGraph.cxx.

◆ PaintPads()

void TMultiGraph::PaintPads ( Option_t * option = "",
Int_t nColumn = 0 )

Divides the active pad and draws all Graphs in the Multigraph separately.

nColumn parameter larger than 0 enforces number of columns for pad division

Definition at line 1406 of file TMultiGraph.cxx.

◆ PaintPolyLine3D()

void TMultiGraph::PaintPolyLine3D ( Option_t * chopt = "")

Paint all the graphs of this multigraph as 3D lines.

Definition at line 1455 of file TMultiGraph.cxx.

◆ PaintReverse()

void TMultiGraph::PaintReverse ( Option_t * option = "")

Paint all the graphs of this multigraph reverting values along X and/or Y axis.

New graphs are created.

Definition at line 1556 of file TMultiGraph.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TPad, TFrame, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print()

void TMultiGraph::Print ( Option_t * chopt = "") const
overridevirtual

Print the list of graphs.

Reimplemented from TObject.

Definition at line 1591 of file TMultiGraph.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TKeyXML, TBuffer, TKey, and TKeySQL.

Definition at line 673 of file TObject.cxx.

◆ RecursiveRemove()

void TMultiGraph::RecursiveRemove ( TObject * obj)
overridevirtual

Recursively remove this object from a list.

Typically implemented by classes that can contain multiple references to a same object.

Reimplemented from TObject.

Definition at line 1607 of file TMultiGraph.cxx.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in TSpline, TFolder, TGeoVolume, TClassTree, TPad, TPaveClass, TGObject, TSpline3, TSpline5, ROOT::Experimental::XRooFit::xRooNode, TTreePerfStats, TVirtualPad, TGraph, and TH1.

Definition at line 708 of file TObject.cxx.

◆ SavePrimitive()

void TMultiGraph::SavePrimitive ( std::ostream & out,
Option_t * option = "" )
overridevirtual

Save primitive as a C++ statement(s) on output stream out.

Reimplemented from TObject.

Definition at line 1631 of file TMultiGraph.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveNameTitle()

void TNamed::SavePrimitiveNameTitle ( std::ostream & out,
const char * variable_name )
protectedinherited

Save object name and title into the output stream "out".

Definition at line 135 of file TNamed.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in TSystemDirectory, TSystemFile, TPad, TGFrame, TAxis, TBrowser, TPaveStats, TGedFrame, TRootBrowserLite, and RooPlot.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetHistogram()

void TMultiGraph::SetHistogram ( TH1F * hist)

Set histogram which will be used for axes painting.

Definition at line 1688 of file TMultiGraph.cxx.

◆ SetMaximum()

void TMultiGraph::SetMaximum ( Double_t maximum = -1111)
virtual

Set multigraph maximum.

Definition at line 1668 of file TMultiGraph.cxx.

◆ SetMinimum()

void TMultiGraph::SetMinimum ( Double_t minimum = -1111)
virtual

Set multigraph minimum.

Definition at line 1678 of file TMultiGraph.cxx.

◆ SetName()

void TNamed::SetName ( const char * name)
virtualinherited

Set the name of the TNamed.

WARNING: if the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Reimplemented in TEveScene, TColor, TSystemDirectory, TSystemFile, TNode, TRotMatrix, TShape, TEfficiency, TFormula, TGraph2D, TH1, RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, ROOT::Experimental::XRooFit::xRooNode, TChain, TEventList, TTree, TGraph, and TDirectory.

Definition at line 149 of file TNamed.cxx.

◆ SetNameTitle()

void TNamed::SetNameTitle ( const char * name,
const char * title )
virtualinherited

Set all the TNamed parameters (name and title).

WARNING: if the name is changed and the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Reimplemented in TContextMenu, TNode, TGraph2D, TH1, RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, and TGraph.

Definition at line 163 of file TNamed.cxx.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetTitle()

void TNamed::SetTitle ( const char * title = "")
virtualinherited

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ Sizeof()

Int_t TNamed::Sizeof ( ) const
virtualinherited

Return size of the TNamed part of the TObject.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TDirectoryFile, TFile, and TKey.

Definition at line 182 of file TNamed.cxx.

◆ Streamer()

void TMultiGraph::Streamer ( TBuffer & R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

◆ StreamerNVirtual()

void TMultiGraph::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 85 of file TMultiGraph.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

R__ALWAYS_INLINE Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UseCurrentStyle()

void TObject::UseCurrentStyle ( )
virtualinherited

Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.

Reimplemented in TCanvas, TPad, TFrame, TPaveStats, TPaveText, TAxis3D, TGraph, TH1, and TTree.

Definition at line 909 of file TObject.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
virtualinherited

Write this object to the current directory.

For more see the const version of this method.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, ROOT::TBufferMergerFile, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 989 of file TObject.cxx.

◆ Write() [2/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
virtualinherited

Write this object to the current directory.

The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".

Writing an object to a file involves the following steps:

  • Creation of a support TKey object in the current directory. The TKey object creates a TBuffer object.
  • The TBuffer object is filled via the class::Streamer function.
  • If the file is compressed (default) a second buffer is created to hold the compressed buffer.
  • Reservation of the corresponding space in the file by looking in the TFree list of free blocks of the file.
  • The buffer is written to the file.

Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.

If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().

The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.

An object is read from the file into memory via TKey::Read() or via TObject::Read().

The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 964 of file TObject.cxx.

Member Data Documentation

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fFunctions

TList* TMultiGraph::fFunctions {nullptr}
protected

Pointer to list of functions (fits and user)

Definition at line 38 of file TMultiGraph.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fGraphs

TList* TMultiGraph::fGraphs {nullptr}
protected

Pointer to list of TGraphs.

Definition at line 37 of file TMultiGraph.h.

◆ fHistogram

TH1F* TMultiGraph::fHistogram {nullptr}
protected

Pointer to histogram used for drawing axis.

Definition at line 39 of file TMultiGraph.h.

◆ fMaximum

Double_t TMultiGraph::fMaximum {-1111}
protected

Maximum value for plotting along y.

Definition at line 40 of file TMultiGraph.h.

◆ fMinimum

Double_t TMultiGraph::fMinimum {-1111}
protected

Minimum value for plotting along y.

Definition at line 41 of file TMultiGraph.h.

◆ fName

TString TNamed::fName
protectedinherited

Definition at line 32 of file TNamed.h.

◆ fTitle

TString TNamed::fTitle
protectedinherited

Definition at line 33 of file TNamed.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.


The documentation for this class was generated from the following files: