00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGraphBentErrors
00013 #define ROOT_TGraphBentErrors
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ROOT_TGraph
00024 #include "TGraph.h"
00025 #endif
00026
00027 class TGraphBentErrors : public TGraph {
00028
00029 protected:
00030 Double_t *fEXlow;
00031 Double_t *fEXhigh;
00032 Double_t *fEYlow;
00033 Double_t *fEYhigh;
00034
00035 Double_t *fEXlowd;
00036 Double_t *fEXhighd;
00037 Double_t *fEYlowd;
00038 Double_t *fEYhighd;
00039
00040 virtual void SwapPoints(Int_t pos1, Int_t pos2);
00041
00042 virtual Double_t** Allocate(Int_t size);
00043 virtual void CopyAndRelease(Double_t **newarrays,
00044 Int_t ibegin, Int_t iend, Int_t obegin);
00045 virtual Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
00046 Int_t obegin);
00047 Bool_t CtorAllocate();
00048 virtual void FillZero(Int_t begin, Int_t end,
00049 Bool_t from_ctor = kTRUE);
00050
00051 public:
00052 TGraphBentErrors();
00053 TGraphBentErrors(Int_t n);
00054 TGraphBentErrors(Int_t n,
00055 const Float_t *x, const Float_t *y,
00056 const Float_t *exl=0, const Float_t *exh=0,
00057 const Float_t *eyl=0, const Float_t *eyh=0,
00058 const Float_t *exld=0, const Float_t *exhd=0,
00059 const Float_t *eyld=0, const Float_t *eyhd=0);
00060 TGraphBentErrors(Int_t n,
00061 const Double_t *x, const Double_t *y,
00062 const Double_t *exl=0, const Double_t *exh=0,
00063 const Double_t *eyl=0, const Double_t *eyh=0,
00064 const Double_t *exld=0, const Double_t *exhd=0,
00065 const Double_t *eyld=0, const Double_t *eyhd=0);
00066 TGraphBentErrors(const TGraphBentErrors &gr);
00067 virtual ~TGraphBentErrors();
00068 virtual void Apply(TF1 *f);
00069 virtual void ComputeRange(Double_t &xmin, Double_t &ymin,
00070 Double_t &xmax, Double_t &ymax) const;
00071 Double_t GetErrorX(Int_t bin) const;
00072 Double_t GetErrorY(Int_t bin) const;
00073 Double_t GetErrorXlow(Int_t bin) const;
00074 Double_t GetErrorXhigh(Int_t bin) const;
00075 Double_t GetErrorYlow(Int_t bin) const;
00076 Double_t GetErrorYhigh(Int_t bin) const;
00077 Double_t *GetEXlow() const {return fEXlow;}
00078 Double_t *GetEXhigh() const {return fEXhigh;}
00079 Double_t *GetEYlow() const {return fEYlow;}
00080 Double_t *GetEYhigh() const {return fEYhigh;}
00081 Double_t *GetEXlowd() const {return fEXlowd;}
00082 Double_t *GetEXhighd() const {return fEXhighd;}
00083 Double_t *GetEYlowd() const {return fEYlowd;}
00084 Double_t *GetEYhighd() const {return fEYhighd;}
00085 virtual void Print(Option_t *chopt="") const;
00086 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00087 virtual void SetPointError(Double_t exl, Double_t exh,
00088 Double_t eyl, Double_t eyh,
00089 Double_t exld=0, Double_t exhd=0,
00090 Double_t eyld=0, Double_t eyhd=0);
00091 virtual void SetPointError(Int_t i,
00092 Double_t exl, Double_t exh,
00093 Double_t eyl, Double_t eyh,
00094 Double_t exld=0, Double_t exhd=0,
00095 Double_t eyld=0, Double_t eyhd=0);
00096
00097 ClassDef(TGraphBentErrors,1)
00098 };
00099
00100 inline Double_t **TGraphBentErrors::Allocate(Int_t size) {
00101 return AllocateArrays(10, size);
00102 }
00103
00104 #endif