Logo ROOT   6.08/07
Reference Guide
TGraphBentErrors.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Dave Morrison 30/06/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGraphBentErrors
13 #define ROOT_TGraphBentErrors
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGraphBentErrors //
18 // //
19 // a Graph with bent, asymmetric error bars //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #ifndef ROOT_TGraph
24 #include "TGraph.h"
25 #endif
26 
27 class TGraphBentErrors : public TGraph {
28 
29 protected:
30  Double_t *fEXlow; //[fNpoints] array of X low errors
31  Double_t *fEXhigh; //[fNpoints] array of X high errors
32  Double_t *fEYlow; //[fNpoints] array of Y low errors
33  Double_t *fEYhigh; //[fNpoints] array of Y high errors
34 
35  Double_t *fEXlowd; //[fNpoints] array of X low displacements
36  Double_t *fEXhighd; //[fNpoints] array of X high displacements
37  Double_t *fEYlowd; //[fNpoints] array of Y low displacements
38  Double_t *fEYhighd; //[fNpoints] array of Y high displacements
39 
40  virtual void SwapPoints(Int_t pos1, Int_t pos2);
41 
42  virtual Double_t** Allocate(Int_t size);
43  virtual void CopyAndRelease(Double_t **newarrays,
44  Int_t ibegin, Int_t iend, Int_t obegin);
45  virtual Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
46  Int_t obegin);
48  virtual void FillZero(Int_t begin, Int_t end,
49  Bool_t from_ctor = kTRUE);
50  virtual Bool_t DoMerge(const TGraph * g);
51 
52 
53 public:
57  const Float_t *x, const Float_t *y,
58  const Float_t *exl=0, const Float_t *exh=0,
59  const Float_t *eyl=0, const Float_t *eyh=0,
60  const Float_t *exld=0, const Float_t *exhd=0,
61  const Float_t *eyld=0, const Float_t *eyhd=0);
63  const Double_t *x, const Double_t *y,
64  const Double_t *exl=0, const Double_t *exh=0,
65  const Double_t *eyl=0, const Double_t *eyh=0,
66  const Double_t *exld=0, const Double_t *exhd=0,
67  const Double_t *eyld=0, const Double_t *eyhd=0);
69  virtual ~TGraphBentErrors();
70  virtual void Apply(TF1 *f);
71  virtual void ComputeRange(Double_t &xmin, Double_t &ymin,
72  Double_t &xmax, Double_t &ymax) const;
73  Double_t GetErrorX(Int_t bin) const;
74  Double_t GetErrorY(Int_t bin) const;
75  Double_t GetErrorXlow(Int_t bin) const;
76  Double_t GetErrorXhigh(Int_t bin) const;
77  Double_t GetErrorYlow(Int_t bin) const;
78  Double_t GetErrorYhigh(Int_t bin) const;
79  Double_t *GetEXlow() const {return fEXlow;}
80  Double_t *GetEXhigh() const {return fEXhigh;}
81  Double_t *GetEYlow() const {return fEYlow;}
82  Double_t *GetEYhigh() const {return fEYhigh;}
83  Double_t *GetEXlowd() const {return fEXlowd;}
84  Double_t *GetEXhighd() const {return fEXhighd;}
85  Double_t *GetEYlowd() const {return fEYlowd;}
86  Double_t *GetEYhighd() const {return fEYhighd;}
87  virtual void Print(Option_t *chopt="") const;
88  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
89  virtual void SetPointError(Double_t exl, Double_t exh,
90  Double_t eyl, Double_t eyh,
91  Double_t exld=0, Double_t exhd=0,
92  Double_t eyld=0, Double_t eyhd=0); // *MENU*
93  virtual void SetPointError(Int_t i,
94  Double_t exl, Double_t exh,
95  Double_t eyl, Double_t eyh,
96  Double_t exld=0, Double_t exhd=0,
97  Double_t eyld=0, Double_t eyhd=0);
98 
99  ClassDef(TGraphBentErrors,1) //A graph with bent, asymmetric error bars
100 };
101 
103  return AllocateArrays(10, size);
104 }
105 
106 #endif
float xmin
Definition: THbookFile.cxx:93
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph with asymmetric errors ...
virtual void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh, Double_t exld=0, Double_t exhd=0, Double_t eyld=0, Double_t eyhd=0)
Set ex and ey values for point pointed by the mouse.
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
float ymin
Definition: THbookFile.cxx:93
Double_t GetErrorYhigh(Int_t bin) const
Get high error on Y[i].
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGraphBentErrors()
TGraphBentErrors default constructor.
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
Double_t * GetEXlowd() const
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
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)
Double_t * GetEYlow() const
Double_t * GetEXhigh() const
virtual ~TGraphBentErrors()
TGraphBentErrors default destructor.
Bool_t CtorAllocate()
Should be called from ctors after fNpoints has been set.
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute range.
float ymax
Definition: THbookFile.cxx:93
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy and release.
A TGraphBentErrors is a TGraph with bent, assymetric error bars.
Double_t * GetEXhighd() const
Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
Double_t GetErrorYlow(Int_t bin) const
Get low error on Y[i].
float xmax
Definition: THbookFile.cxx:93
TGraphErrors * gr
Definition: legend1.C:25
virtual void Print(Option_t *chopt="") const
Print graph and errors values.
virtual Double_t ** Allocate(Int_t size)
Double_t * GetEYhighd() const
double f(double x)
double Double_t
Definition: RtypesCore.h:55
Double_t GetErrorXhigh(Int_t bin) const
Get high error on X[i].
Double_t y[n]
Definition: legend1.C:17
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Double_t GetErrorXlow(Int_t bin) const
Get low error on X[i].
Double_t * GetEXlow() const
1-Dim function class
Definition: TF1.h:149
A Graph is a graphics object made of two arrays X and Y with npoints each.
Definition: TGraph.h:53
virtual Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy errors from fE*** to arrays[] or to f Copy points.
virtual void Apply(TF1 *f)
apply a function to all data points y = f(x,y)
const Bool_t kTRUE
Definition: Rtypes.h:91
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
Definition: TGraph.cxx:529
const Int_t n
Definition: legend1.C:16
Double_t * GetEYhigh() const
Double_t GetErrorX(Int_t bin) const
This function is called by GraphFitChisquare.
Double_t * GetEYlowd() const