TGraphErrors.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphErrors.h 24702 2008-07-08 12:01:46Z brun $
00002 // Author: Rene Brun   15/09/96
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_TGraphErrors
00013 #define ROOT_TGraphErrors
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGraphErrors                                                         //
00019 //                                                                      //
00020 // a Graph with error bars                                              //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGraph
00025 #include "TGraph.h"
00026 #endif
00027 
00028 class TGraphErrors : public TGraph {
00029 
00030 protected:
00031    Double_t    *fEX;        //[fNpoints] array of X errors
00032    Double_t    *fEY;        //[fNpoints] array of Y errors
00033 
00034    virtual void       SwapPoints(Int_t pos1, Int_t pos2);
00035 
00036    virtual Double_t** Allocate(Int_t size);
00037    virtual void       CopyAndRelease(Double_t **newarrays,
00038                                      Int_t ibegin, Int_t iend, Int_t obegin);
00039    virtual Bool_t     CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
00040                                  Int_t obegin);
00041    Bool_t             CtorAllocate();
00042    virtual void       FillZero(Int_t begin, Int_t end,
00043                                Bool_t from_ctor = kTRUE);
00044 
00045 public:
00046    TGraphErrors();
00047    TGraphErrors(Int_t n);
00048    TGraphErrors(Int_t n, const Float_t *x, const Float_t *y, const Float_t *ex=0, const Float_t *ey=0);
00049    TGraphErrors(Int_t n, const Double_t *x, const Double_t *y, const Double_t *ex=0, const Double_t *ey=0);
00050    TGraphErrors(const TVectorF &vx, const TVectorF &vy, const TVectorF &vex, const TVectorF &vey);
00051    TGraphErrors(const TVectorD &vx, const TVectorD &vy, const TVectorD &vex, const TVectorD &vey);
00052    TGraphErrors(const TGraphErrors &gr);
00053    TGraphErrors& operator=(const TGraphErrors &gr);
00054    TGraphErrors(const TH1 *h);
00055    TGraphErrors(const char *filename, const char *format="%lg %lg %lg %lg", Option_t *option="");
00056    virtual ~TGraphErrors();
00057    virtual void    Apply(TF1 *f);
00058    static Int_t    CalculateScanfFields(const char *fmt);
00059    virtual void    ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
00060    Double_t        GetErrorX(Int_t bin)     const;
00061    Double_t        GetErrorY(Int_t bin)     const;
00062    Double_t        GetErrorXhigh(Int_t bin) const;
00063    Double_t        GetErrorXlow(Int_t bin)  const;
00064    Double_t        GetErrorYhigh(Int_t bin) const;
00065    Double_t        GetErrorYlow(Int_t bin)  const;
00066    Double_t       *GetEX() const {return fEX;}
00067    Double_t       *GetEY() const {return fEY;}
00068    virtual void    Print(Option_t *chopt="") const;
00069    virtual void    SavePrimitive(ostream &out, Option_t *option = "");
00070    virtual void    SetPointError(Double_t ex, Double_t ey);  // *MENU
00071    virtual void    SetPointError(Int_t i, Double_t ex, Double_t ey);
00072 
00073    ClassDef(TGraphErrors,3)  //A graph with error bars
00074 };
00075 
00076 inline Double_t **TGraphErrors::Allocate(Int_t size) {
00077    return AllocateArrays(4, size);
00078 }
00079 
00080 #endif

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