JG ROOT Tools libraries  version 5.0 - august 2014
RGraphFunctions.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RGraphFunctions.hh
3  *
4  * Include file for functions related to ROOT TGraph class.
5  */
6 //======================================================================
7 
8 #ifndef R_GRAPH_FUNCTIONS_HH
9 #define R_GRAPH_FUNCTIONS_HH
10 
11 #include "RBaseFunctions.hh"
12 #include "GOptionString.hh"
13 
14 #include <TGraph.h>
15 #include <TGraphErrors.h>
16 #include <TGraph2D.h>
17 #include <TGraph2DErrors.h>
18 #include <TH1.h>
19 #include <TH2.h>
20 
21 #include <TPolyLine.h>
22 #include <TPolyLine3D.h>
23 
24 #include <TTree.h>
25 #include <TBranch.h>
26 #include <TLeaf.h>
27 #include <TTreeFormula.h>
28 
29 //======================================================================
30 /** @name Graphs simple functions */
31 //@{
32 
33 //----------------------------------------------------------------------
34 // Graph creation
35 extern TGraph * RGraphDifference ( int n,
36  const Double_t * t1, const Double_t * t2 );
37 extern TGraph * RGraphDifference ( int n,
38  const Double_t xmin, const Double_t xmax,
39  const Double_t * t1, const Double_t * t2 );
40 
41 extern TGraphErrors * RCreateYmeanGraph ( TH2 * hptr, const string & options );
42 
43 //----------------------------------------------------------------------
44 // Graphs concatenation
45 extern TGraphErrors * RConcatGraph ( TGraphErrors * gtot, const TGraphErrors * gnew );
46 extern TGraphErrors * RConcatGraph ( TGraphErrors * gtot, const TGraph * gnew );
47 extern TGraph * RConcatGraph ( TGraph * gtot, const TGraph * gnew );
48 
49 //@}
50 
51 
52 //======================================================================
53 /** @name Graph from extraction of sub-sets of data */
54 //@{
55 
56 // creation of a serie of TGraphErrors with constant value p[i]
57 extern Int_t RGetGraphSeries ( const Int_t n,
58  const Double_t * p,
59  const Double_t * x,
60  const Double_t * y,
61  const Double_t * dx,
62  const Double_t * dy,
63  TGraphErrors * & tab_gr,
64  Double_t * & tab_p,
65  const Double_t eps = 1.e-6 );
66 
67 // creation of a serie of TPolyLine with constant value p[i]
68 extern Int_t RGetPolyLineSeries ( const Int_t n,
69  const Double_t * p,
70  const Double_t * x,
71  const Double_t * y,
72  TPolyLine * & tab_l,
73  Double_t * & tab_p,
74  const Double_t eps = 1.e-6 );
75 
76 // creation of a serie of TPolyLine3D with constant value p[i]
77 extern Int_t RGetPolyLine3DSeries ( const Int_t n,
78  const Double_t * p,
79  const Double_t * x,
80  const Double_t * y,
81  const Double_t * z,
82  TPolyLine3D * & tab_l,
83  Double_t * & tab_p,
84  const Double_t eps = 1.e-6 );
85 
86 //@}
87 
88 //======================================================================
89 /** @name Graph from a TTree */
90 //@{
91 
92 extern TGraph * RGraphFromTree ( TTree & tree,
93  const string & varx, const string & vary,
94  const string & selection = "" );
95 
96 extern TGraphErrors * RGraphFromTree ( TTree & tree,
97  const string & varx, const string & vary,
98  const string & errx, const string & erry,
99  const string & selection );
100 
101 extern TGraphErrors ** RGraphSerieFromTree ( TTree & tree,
102  const string & varc, u_int n, double ctab[],
103  const string & varx, const string & vary,
104  const string & errx = "", const string & erry = "",
105  const string & selection = "",
106  double prec = 0.001 );
107 
108 //@}
109 
110 
111 //----------------------------------------------------------------------
112 #endif
TGraph * RGraphFromTree(TTree &tree, const string &varx, const string &vary, const string &selection)
Definition: RGraphFunctions.cpp:622
TGraphErrors * RCreateYmeanGraph(TH2 *hptr, const string &options)
Definition: RGraphFunctions.cpp:80
TGraphErrors * RConcatGraph(TGraphErrors *gtot, const TGraphErrors *gnew)
Definition: RGraphFunctions.cpp:198
Int_t RGetGraphSeries(const Int_t n, const Double_t *p, const Double_t *x, const Double_t *y, const Double_t *dx, const Double_t *dy, TGraphErrors *&tab_gr, Double_t *&tab_p, const Double_t eps)
Definition: RGraphFunctions.cpp:313
Int_t RGetPolyLineSeries(const Int_t n, const Double_t *p, const Double_t *x, const Double_t *y, TPolyLine *&tab_l, Double_t *&tab_p, const Double_t eps)
Definition: RGraphFunctions.cpp:425
Int_t RGetPolyLine3DSeries(const Int_t n, const Double_t *p, const Double_t *x, const Double_t *y, const Double_t *z, TPolyLine3D *&tab_l, Double_t *&tab_p, const Double_t eps)
Definition: RGraphFunctions.cpp:523
TGraphErrors ** RGraphSerieFromTree(TTree &tree, const string &varc, u_int n, double ctab[], const string &varx, const string &vary, const string &errx, const string &erry, const string &selection, double prec)
Definition: RGraphFunctions.cpp:888
TGraph * RGraphDifference(int n, const Double_t *t1, const Double_t *t2)
Definition: RGraphFunctions.cpp:21