TGraphBentErrors.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphBentErrors.h 24702 2008-07-08 12:01:46Z brun $
00002 // Author: Dave Morrison  30/06/2003
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGraphBentErrors
00013 #define ROOT_TGraphBentErrors
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TGraphBentErrors                                                     //
00018 //                                                                      //
00019 // a Graph with bent, asymmetric error bars                             //
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;        //[fNpoints] array of X low errors
00031    Double_t    *fEXhigh;       //[fNpoints] array of X high errors
00032    Double_t    *fEYlow;        //[fNpoints] array of Y low errors
00033    Double_t    *fEYhigh;       //[fNpoints] array of Y high errors
00034 
00035    Double_t    *fEXlowd;       //[fNpoints] array of X low displacements
00036    Double_t    *fEXhighd;      //[fNpoints] array of X high displacements
00037    Double_t    *fEYlowd;       //[fNpoints] array of Y low displacements
00038    Double_t    *fEYhighd;      //[fNpoints] array of Y high displacements
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); // *MENU*
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)  //A graph with bent, asymmetric error bars
00098 };
00099 
00100 inline Double_t **TGraphBentErrors::Allocate(Int_t size) {
00101    return AllocateArrays(10, size);
00102 }
00103 
00104 #endif

Generated on Tue Jul 5 14:22:50 2011 for ROOT_528-00b_version by  doxygen 1.5.1