88 TGraph(
const char *filename,
const char *format=
"%lg %lg",
Option_t *option=
"");
178 virtual void SetTitle(
const char *title=
"");
#define ClassDef(name, id)
Fill Area Attributes class.
Class to manage histogram axis.
Using a TBrowser one can browse all ROOT objects.
Collection abstract base class.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
Int_t fNpoints
Number of points <= fMaxSize.
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 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 Chisquare(TF1 *f1, Option_t *option="") const
Return the chisquare of this graph with respect to f1.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual Int_t Merge(TCollection *list)
Adds all graphs from the collection to this graph.
Int_t fMaxSize
!Current dimension of arrays fX and fY
Double_t ** ShrinkAndCopy(Int_t size, Int_t iend)
if size*2 <= fMaxSize allocate new arrays of size points, copy points [0,oend).
virtual Double_t GetRMS(Int_t axis=1) const
Return RMS of X (axis=1) or Y (axis=2)
virtual Double_t * GetEXhighd() const
virtual Bool_t IsEditable() const
TH1F * fHistogram
Pointer to histogram used for drawing axis.
@ kNotEditable
bit set if graph is non editable
@ kIsHighlight
bit set if graph is highlight
@ kIsSortedX
graph is sorted in X points
@ kClipFrame
clip to the frame boundary
@ kResetHisto
fHistogram must be reset in GetHistogram
virtual Double_t GetErrorXlow(Int_t bin) const
This function is called by GraphFitChisquare.
virtual void SetName(const char *name="")
Set graph name.
virtual Double_t GetErrorYlow(Int_t bin) const
This function is called by GraphFitChisquare.
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 !...
Double_t GetMinimum() const
virtual void SetNameTitle(const char *name="", const char *title="")
Set graph name and title.
virtual Double_t * GetEYlow() const
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
virtual Double_t * GetEX() const
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.
virtual TObject * FindObject(const char *name) const
Search object named name in the list of functions.
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".
virtual Double_t GetErrorYhigh(Int_t bin) const
This function is called by GraphFitChisquare.
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.
Double_t GetMaximum() const
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
virtual Double_t * GetEXlowd() const
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.
virtual void SetTitle(const char *title="")
Change (i.e.
Double_t * fY
[fNpoints] array of Y points
Bool_t CtorAllocate()
In constructors set fNpoints than call this method.
virtual void DrawGraph(Int_t n, const Int_t *x, const Int_t *y, Option_t *option="")
Draw this graph with new attributes.
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 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.
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...
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.
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
TList * fFunctions
Pointer to list of functions (fits and user)
virtual Double_t GetCovariance() const
Return covariance of vectors x,y.
virtual Double_t * GetEYlowd() const
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
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 ** Allocate(Int_t newsize)
virtual void FitPanel()
Display a GUI panel with all graph fit options.
virtual void Print(Option_t *chopt="") const
Print graph values.
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
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.
TList * GetListOfFunctions() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void InitExpo(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for an exponential.
virtual Int_t RemovePoint()
Delete point close to the mouse position.
virtual void InitGaus(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a gaussian.
virtual Bool_t IsHighlight() const
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
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 SetHighlight(Bool_t set=kTRUE)
Set highlight (enable/disble) mode for the graph by default highlight mode is disable.
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
virtual Double_t * GetEYhighd() const
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of functions.
TAxis * GetXaxis() const
Get x axis of the graph.
Bool_t GetEditable() const
Return kTRUE if kNotEditable bit is not set, kFALSE otherwise.
virtual Double_t * GetEXhigh() const
virtual Double_t GetCorrelationFactor() const
Return graph correlation factor.
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 Double_t * GetEYhigh() const
virtual Double_t Eval(Double_t x, TSpline *spline=0, Option_t *option="") const
Interpolate points in this graph at x using a TSpline.
Double_t ** ExpandAndCopy(Int_t size, Int_t iend)
if size > fMaxSize allocate new arrays of 2*size points and copy iend first points.
virtual void Expand(Int_t newsize)
If array sizes <= newsize, expand storage to 2*newsize.
virtual void UseCurrentStyle()
Set current style settings in this graph This function is called when either TCanvas::UseCurrentStyle...
virtual Double_t GetMean(Int_t axis=1) const
Return mean value of X (axis=1) or Y (axis=2)
Double_t * fX
[fNpoints] array of X points
virtual void PaintStats(TF1 *fit)
Draw the stats.
TAxis * GetYaxis() const
Get y axis of the graph.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a graph.
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
virtual Double_t * GetEY() const
virtual void SetHistogram(TH1F *h)
Double_t fMinimum
Minimum value for plotting along y.
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
virtual Double_t * GetEXlow() const
virtual void Browse(TBrowser *b)
Browse.
virtual void DrawPanel()
Display a panel with all graph drawing options.
void PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a histogram.
virtual ~TGraph()
Graph default destructor.
virtual void Set(Int_t n)
Set number of points in the graph Existing coordinates are preserved New coordinates above fNpoints a...
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 SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
TGraph()
Graph default constructor.
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 !...
Double_t fMaximum
Maximum value for plotting along y.
virtual Double_t GetErrorXhigh(Int_t bin) const
This function is called by GraphFitChisquare.
TGraph & operator=(const TGraph &)
Equal operator for this graph.
virtual void InitPolynom(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a polynom.
virtual Double_t GetErrorX(Int_t bin) const
This function is called by GraphFitChisquare.
1-D histogram with a float per channel (see TH1 documentation)}
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Base class for spline implementation containing the Draw/Paint methods.