TGraphAsymmErrors.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphAsymmErrors.h 35227 2010-09-10 14:29:14Z moneta $
00002 // Author: Rene Brun   03/03/99
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TGraphAsymmErrors
00013 #define ROOT_TGraphAsymmErrors
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGraphAsymmErrors                                                    //
00019 //                                                                      //
00020 // a Graph with asymmetric error bars                                   //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGraph
00025 #include "TGraph.h"
00026 #endif
00027 
00028 class TGraphAsymmErrors : public TGraph {
00029 
00030 protected:
00031    Double_t    *fEXlow;        //[fNpoints] array of X low errors
00032    Double_t    *fEXhigh;       //[fNpoints] array of X high errors
00033    Double_t    *fEYlow;        //[fNpoints] array of Y low errors
00034    Double_t    *fEYhigh;       //[fNpoints] array of Y high errors
00035 
00036    virtual void    SwapPoints(Int_t pos1, Int_t pos2);
00037 
00038    virtual Double_t** Allocate(Int_t size);
00039    virtual void       CopyAndRelease(Double_t **newarrays,
00040                                      Int_t ibegin, Int_t iend, Int_t obegin);
00041    virtual Bool_t     CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
00042                                  Int_t obegin);
00043    Bool_t             CtorAllocate();
00044    virtual void       FillZero(Int_t begin, Int_t end,
00045                                Bool_t from_ctor = kTRUE);
00046 
00047 public:
00048    TGraphAsymmErrors();
00049    TGraphAsymmErrors(Int_t n);
00050    TGraphAsymmErrors(Int_t n, const Float_t *x, const Float_t *y, const Float_t *exl=0, const Float_t *exh=0, const Float_t *eyl=0, const Float_t *eyh=0);
00051    TGraphAsymmErrors(Int_t n, const Double_t *x, const Double_t *y, const Double_t *exl=0, const Double_t *exh=0, const Double_t *eyl=0, const Double_t *eyh=0);
00052    TGraphAsymmErrors(const TVectorF &vx, const TVectorF &vy, const TVectorF &vexl, const TVectorF &vexh, const TVectorF &veyl, const TVectorF &veyh);
00053    TGraphAsymmErrors(const TVectorD &vx, const TVectorD &vy, const TVectorD &vexl, const TVectorD &vexh, const TVectorD &veyl, const TVectorD &veyh);
00054    TGraphAsymmErrors(const TGraphAsymmErrors &gr);
00055    TGraphAsymmErrors& operator=(const TGraphAsymmErrors &gr);
00056    TGraphAsymmErrors(const TH1 *h);
00057    TGraphAsymmErrors(const TH1* pass, const TH1* total, Option_t *option="");
00058    virtual ~TGraphAsymmErrors();
00059 
00060    virtual void    Apply(TF1 *f);
00061    virtual void    BayesDivide(const TH1* pass, const TH1* total, Option_t *opt="");
00062    virtual void    Divide(const TH1* pass, const TH1* total, Option_t *opt="cp");
00063    virtual void    ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
00064    Double_t        GetErrorX(Int_t bin)   const;
00065    Double_t        GetErrorY(Int_t bin)   const;
00066    Double_t        GetErrorXlow(Int_t i)  const;
00067    Double_t        GetErrorXhigh(Int_t i) const;
00068    Double_t        GetErrorYlow(Int_t i)  const;
00069    Double_t        GetErrorYhigh(Int_t i) const;
00070    Double_t       *GetEXlow()  const {return fEXlow;}
00071    Double_t       *GetEXhigh() const {return fEXhigh;}
00072    Double_t       *GetEYlow()  const {return fEYlow;}
00073    Double_t       *GetEYhigh() const {return fEYhigh;}
00074 
00075    virtual void    Print(Option_t *chopt="") const;
00076    virtual void    SavePrimitive(ostream &out, Option_t *option = "");
00077    virtual void    SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh); // *MENU*
00078    virtual void    SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh);
00079    virtual void    SetPointEXlow(Int_t i, Double_t exl);
00080    virtual void    SetPointEXhigh(Int_t i, Double_t exh);
00081    virtual void    SetPointEYlow(Int_t i, Double_t eyl);
00082    virtual void    SetPointEYhigh(Int_t i, Double_t eyh);
00083 
00084    ClassDef(TGraphAsymmErrors,3)  //A graph with asymmetric error bars
00085 };
00086 
00087 inline Double_t** TGraphAsymmErrors::Allocate(Int_t size) {
00088    return AllocateArrays(6, size);
00089 }
00090 
00091 #endif

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