87 TGraph(
const char *filename,
const char *format=
"%lg %lg",
Option_t *option=
"");
173 virtual void SetTitle(
const char *title=
"");
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 Bool_t IsEditable() const
void PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a histogram.
Int_t fNpoints
Number of points <= fMaxSize.
virtual Double_t GetErrorYhigh(Int_t bin) const
This function is called by GraphFitChisquare.
Double_t * fX
[fNpoints] array of X points
virtual Double_t * GetEX() const
virtual void FitPanel()
Display a GUI panel with all graph fit options.
virtual Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
static Bool_t CompareRadius(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s distance to origin is bigger than that of point number "right"...
TGraph()
Graph default constructor.
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
virtual Double_t ** Allocate(Int_t newsize)
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
virtual void InitPolynom(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a polynom.
virtual Double_t * GetEYlow() const
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fX[left] > fX[right]. Can be used by Sort.
Base class for spline implementation containing the Draw/Paint methods.
virtual Double_t * GetEXhighd() const
TList * GetListOfFunctions() const
TAxis * GetYaxis() const
Get y axis of the graph.
virtual Double_t * GetEY() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * FindObject(const char *name) const
Search object named name in the list of functions.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void DrawPanel()
Display a panel with all graph drawing options.
virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin=0, Double_t xmax=0)
Least squares polynomial fitting without weights.
virtual Double_t GetCovariance() const
Return covariance of vectors x,y.
TList * fFunctions
Pointer to list of functions (fits and user)
virtual void SetTitle(const char *title="")
Set graph title.
TH1F * fHistogram
Pointer to histogram used for drawing axis.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of functions.
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
virtual Double_t GetErrorYlow(Int_t bin) const
This function is called by GraphFitChisquare.
virtual void Apply(TF1 *f)
Apply function f to all the data points f may be a 1-D function TF1 or 2-d function TF2 The Y values ...
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
virtual Int_t Merge(TCollection *list)
Adds all graphs from the collection to this graph.
virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin != ie...
Double_t ** ShrinkAndCopy(Int_t size, Int_t iend)
if size*2 <= fMaxSize allocate new arrays of size points, copy points [0,oend).
Fill Area Attributes class.
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
#define ClassDef(name, id)
virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const
Return the chisquare of this graph with respect to f1.
TGraph & operator=(const TGraph &)
Equal operator for this graph.
The TNamed class is the base class for all named ROOT classes.
virtual void Sort(Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
Sorts the points of this TGraph using in-place quicksort (see e.g.
virtual void Print(Option_t *chopt="") const
Print graph values.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
Find zero of a continuous function.
virtual Double_t GetErrorX(Int_t bin) const
This function is called by GraphFitChisquare.
Double_t fMinimum
Minimum value for plotting along y.
virtual Double_t Eval(Double_t x, TSpline *spline=0, Option_t *option="") const
Interpolate points in this graph at x using a TSpline.
virtual Int_t RemovePoint()
Delete point close to the mouse position.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void Expand(Int_t newsize)
If array sizes <= newsize, expand storage to 2*newsize.
Bool_t CtorAllocate()
In constructors set fNpoints than call this method.
virtual Double_t * GetEYhighd() const
Using a TBrowser one can browse all ROOT objects.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual Double_t GetErrorXlow(Int_t bin) const
This function is called by GraphFitChisquare.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
Class to manage histogram axis.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
Collection abstract base class.
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
fHistogram must be reset in GetHistogram
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
Bool_t GetEditable() const
Return kTRUE if kNotEditable bit is not set, kFALSE otherwise.
virtual Double_t GetRMS(Int_t axis=1) const
Return RMS of X (axis=1) or Y (axis=2)
Double_t GetMaximum() const
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Double_t * GetEXlowd() const
virtual void InsertPointBefore(Int_t ipoint, Double_t x, Double_t y)
Insert a new point with coordinates (x,y) before the point number ipoint.
virtual void InitGaus(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a gaussian.
virtual Double_t * GetEYlowd() const
virtual Double_t GetMean(Int_t axis=1) const
Return mean value of X (axis=1) or Y (axis=2)
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases...
virtual void PaintStats(TF1 *fit)
Draw the stats.
virtual Double_t * GetEXlow() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a graph.
graph is sorted in X points
virtual ~TGraph()
Graph default destructor.
Double_t fMaximum
Maximum value for plotting along y.
Double_t ** ExpandAndCopy(Int_t size, Int_t iend)
if size > fMaxSize allocate new arrays of 2*size points and copy iend first points.
Mother of all ROOT objects.
virtual void UseCurrentStyle()
Set current style settings in this graph This function is called when either TCanvas::UseCurrentStyle...
virtual void Browse(TBrowser *b)
Browse.
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end) Should be redefined in descendant classes...
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Double_t * fY
[fNpoints] array of Y points
virtual void InitExpo(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for an exponential.
virtual void LeastSquareLinearFit(Int_t n, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin=0, Double_t xmax=0)
Least square linear fit without weights.
static Bool_t CompareArg(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s argument (angle with respect to positive x-axis) is bigger than...
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin != ie...
virtual void SetHistogram(TH1F *h)
virtual void DrawGraph(Int_t n, const Int_t *x, const Int_t *y, Option_t *option="")
Draw this graph with new attributes.
virtual Double_t GetCorrelationFactor() const
Return graph correlation factor.
Int_t fMaxSize
!Current dimension of arrays fX and fY
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise...
virtual Double_t * GetEYhigh() const
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
virtual void Set(Int_t n)
Set number of points in the graph Existing coordinates are preserved New coordinates above fNpoints a...
Double_t GetMinimum() const
virtual void SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable ...
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
virtual Double_t GetErrorXhigh(Int_t bin) const
This function is called by GraphFitChisquare.
clip to the frame boundary
virtual Double_t * GetEXhigh() const
bit set if graph is non editable
static Bool_t CompareY(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fY[left] > fY[right]. Can be used by Sort.
static constexpr double g