Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGraphAsymmErrors.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/hist:$Id$
0002 // Author: Rene Brun   03/03/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGraphAsymmErrors
0013 #define ROOT_TGraphAsymmErrors
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TGraphAsymmErrors                                                    //
0019 //                                                                      //
0020 // a Graph with asymmetric error bars                                   //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TGraph.h"
0025 
0026 class TGraphAsymmErrors : public TGraph {
0027 
0028 protected:
0029    Double_t    *fEXlow{nullptr};        ///<[fNpoints] array of X low errors
0030    Double_t    *fEXhigh{nullptr};       ///<[fNpoints] array of X high errors
0031    Double_t    *fEYlow{nullptr};        ///<[fNpoints] array of Y low errors
0032    Double_t    *fEYhigh{nullptr};       ///<[fNpoints] array of Y high errors
0033 
0034    void       SwapPoints(Int_t pos1, Int_t pos2) override;
0035    void       UpdateArrays(const std::vector<Int_t> &sorting_indices, Int_t numSortedPoints, Int_t low) override;
0036 
0037    Double_t** Allocate(Int_t size) override;
0038    void       CopyAndRelease(Double_t **newarrays,
0039                              Int_t ibegin, Int_t iend, Int_t obegin) override;
0040    Bool_t     CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
0041                          Int_t obegin) override;
0042    Bool_t     CtorAllocate();
0043    void       FillZero(Int_t begin, Int_t end,
0044                        Bool_t from_ctor = kTRUE) override;
0045    Bool_t     DoMerge(const TGraph * g) override;
0046 
0047 public:
0048    TGraphAsymmErrors();
0049    TGraphAsymmErrors(Int_t n);
0050    TGraphAsymmErrors(Int_t n, const Float_t *x, const Float_t *y, const Float_t *exl = nullptr, const Float_t *exh = nullptr, const Float_t *eyl = nullptr, const Float_t *eyh = nullptr);
0051    TGraphAsymmErrors(Int_t n, const Double_t *x, const Double_t *y, const Double_t *exl = nullptr, const Double_t *exh = nullptr, const Double_t *eyl = nullptr, const Double_t *eyh = nullptr);
0052    TGraphAsymmErrors(const TVectorF &vx, const TVectorF &vy, const TVectorF &vexl, const TVectorF &vexh, const TVectorF &veyl, const TVectorF &veyh);
0053    TGraphAsymmErrors(const TVectorD &vx, const TVectorD &vy, const TVectorD &vexl, const TVectorD &vexh, const TVectorD &veyl, const TVectorD &veyh);
0054    TGraphAsymmErrors(const TGraphAsymmErrors &gr);
0055    TGraphAsymmErrors& operator=(const TGraphAsymmErrors &gr);
0056    TGraphAsymmErrors(const TH1 *h);
0057    TGraphAsymmErrors(const TH1* pass, const TH1* total, Option_t *option="");
0058    TGraphAsymmErrors(const char *filename, const char *format="%lg %lg %lg %lg %lg %lg", Option_t *option="");
0059 
0060    ~TGraphAsymmErrors() override;
0061 
0062    void    Apply(TF1 *f) override;
0063    virtual void    BayesDivide(const TH1* pass, const TH1* total, Option_t *opt="");
0064    virtual void    Divide(const TH1* pass, const TH1* total, Option_t *opt="cp");
0065    void    ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const override;
0066    Double_t        GetErrorX(Int_t bin)   const override;
0067    Double_t        GetErrorY(Int_t bin)   const override;
0068    Double_t        GetErrorXlow(Int_t i)  const override;
0069    Double_t        GetErrorXhigh(Int_t i) const override;
0070    Double_t        GetErrorYlow(Int_t i)  const override;
0071    Double_t        GetErrorYhigh(Int_t i) const override;
0072    Double_t       *GetEXlow()  const override {return fEXlow;}
0073    Double_t       *GetEXhigh() const override {return fEXhigh;}
0074    Double_t       *GetEYlow()  const override {return fEYlow;}
0075    Double_t       *GetEYhigh() const override {return fEYhigh;}
0076    Int_t   Merge(TCollection* list) override;
0077    void    Print(Option_t *chopt="") const override;
0078    void    SavePrimitive(std::ostream &out, Option_t *option = "") override;
0079    void    Scale(Double_t c1=1., Option_t *option="y") override; // *MENU*
0080    virtual void    SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh); // *MENU*
0081    virtual void    SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh);
0082    virtual void    SetPointEXlow(Int_t i, Double_t exl);
0083    virtual void    SetPointEXhigh(Int_t i, Double_t exh);
0084    virtual void    SetPointEYlow(Int_t i, Double_t eyl);
0085    virtual void    SetPointEYhigh(Int_t i, Double_t eyh);
0086 
0087    ClassDefOverride(TGraphAsymmErrors,3)  //A graph with asymmetric error bars
0088 };
0089 
0090 #endif