Warning, file /include/root/TGraphMultiErrors.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGraphMultiErrors
0013 #define ROOT_TGraphMultiErrors
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "TGraph.h"
0024 #include <vector>
0025
0026 class TArrayF;
0027 class TArrayD;
0028
0029 class TGraphMultiErrors : public TGraph {
0030
0031 protected:
0032 Int_t fNYErrors;
0033 Int_t fSumErrorsMode;
0034
0035 Double_t *fExL;
0036 Double_t *fExH;
0037 std::vector<TArrayD> fEyL;
0038 std::vector<TArrayD> fEyH;
0039 mutable Double_t *fEyLSum = nullptr;
0040 mutable Double_t *fEyHSum = nullptr;
0041 std::vector<TAttFill> fAttFill;
0042 std::vector<TAttLine> fAttLine;
0043
0044 Double_t **Allocate(Int_t size) override;
0045 Bool_t CtorAllocate();
0046
0047 void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin) override;
0048 Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend, Int_t obegin) override;
0049 void FillZero(Int_t begin, Int_t end, Bool_t from_ctor = kTRUE) override;
0050
0051 void CalcYErrorsSum() const;
0052 Bool_t DoMerge(const TGraph *tg) override;
0053 void SwapPoints(Int_t pos1, Int_t pos2) override;
0054 void UpdateArrays(const std::vector<Int_t> &sorting_indices, Int_t numSortedPoints, Int_t low) override;
0055
0056 public:
0057 enum ESummationModes {
0058 kOnlyFirst = 0,
0059 kSquareSum = 1,
0060 kAbsSum = 2
0061 };
0062
0063 TGraphMultiErrors();
0064 TGraphMultiErrors(const Char_t *name, const Char_t *title);
0065 TGraphMultiErrors(Int_t np, Int_t ne = 1);
0066 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, Int_t ne = 1);
0067
0068 TGraphMultiErrors(Int_t np, const Float_t *x, const Float_t *y, const Float_t *exL = nullptr,
0069 const Float_t *exH = nullptr, const Float_t *eyL = nullptr, const Float_t *eyH = nullptr,
0070 Int_t m = kOnlyFirst);
0071 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, const Float_t *x, const Float_t *y,
0072 const Float_t *exL = nullptr, const Float_t *exH = nullptr, const Float_t *eyL = nullptr,
0073 const Float_t *eyH = nullptr, Int_t m = kOnlyFirst);
0074 TGraphMultiErrors(Int_t np, const Double_t *x, const Double_t *y, const Double_t *exL = nullptr,
0075 const Double_t *exH = nullptr, const Double_t *eyL = nullptr, const Double_t *eyH = nullptr,
0076 Int_t m = kOnlyFirst);
0077 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, const Double_t *x, const Double_t *y,
0078 const Double_t *exL = nullptr, const Double_t *exH = nullptr, const Double_t *eyL = nullptr,
0079 const Double_t *eyH = nullptr, Int_t m = kOnlyFirst);
0080
0081 TGraphMultiErrors(Int_t np, Int_t ne, const Float_t *x, const Float_t *y, const Float_t *exL, const Float_t *exH,
0082 std::vector<std::vector<Float_t>> eyL, std::vector<std::vector<Float_t>> eyH,
0083 Int_t m = kOnlyFirst);
0084 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, Int_t ne, const Float_t *x, const Float_t *y,
0085 const Float_t *exL, const Float_t *exH, std::vector<std::vector<Float_t>> eyL,
0086 std::vector<std::vector<Float_t>> eyH, Int_t m = kOnlyFirst);
0087 TGraphMultiErrors(Int_t np, Int_t ne, const Double_t *x, const Double_t *y, const Double_t *exL, const Double_t *exH,
0088 std::vector<std::vector<Double_t>> eyL, std::vector<std::vector<Double_t>> eyH,
0089 Int_t m = kOnlyFirst);
0090 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, Int_t ne, const Double_t *x, const Double_t *y,
0091 const Double_t *exL, const Double_t *exH, std::vector<std::vector<Double_t>> eyL,
0092 std::vector<std::vector<Double_t>> eyH, Int_t m = kOnlyFirst);
0093
0094 TGraphMultiErrors(Int_t np, Int_t ne, const Float_t *x, const Float_t *y, const Float_t *exL, const Float_t *exH,
0095 std::vector<TArrayF> eyL, std::vector<TArrayF> eyH, Int_t m = kOnlyFirst);
0096 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, Int_t ne, const Float_t *x, const Float_t *y,
0097 const Float_t *exL, const Float_t *exH, std::vector<TArrayF> eyL, std::vector<TArrayF> eyH,
0098 Int_t m = kOnlyFirst);
0099 TGraphMultiErrors(Int_t np, Int_t ne, const Double_t *x, const Double_t *y, const Double_t *exL, const Double_t *exH,
0100 std::vector<TArrayD> eyL, std::vector<TArrayD> eyH, Int_t m = kOnlyFirst);
0101 TGraphMultiErrors(const Char_t *name, const Char_t *title, Int_t np, Int_t ne, const Double_t *x, const Double_t *y,
0102 const Double_t *exL, const Double_t *exH, std::vector<TArrayD> eyL, std::vector<TArrayD> eyH,
0103 Int_t m = kOnlyFirst);
0104
0105 TGraphMultiErrors(const TVectorF &tvX, const TVectorF &tvY, const TVectorF &tvExL, const TVectorF &tvExH,
0106 const TVectorF &tvEyL, const TVectorF &tvEyH, Int_t m = kOnlyFirst);
0107 TGraphMultiErrors(const TVectorD &tvX, const TVectorD &tvY, const TVectorD &tvExL, const TVectorD &tvExH,
0108 const TVectorD &tvEyL, const TVectorD &tvEyH, Int_t m = kOnlyFirst);
0109
0110 TGraphMultiErrors(Int_t ne, const TVectorF &tvX, const TVectorF &tvY, const TVectorF &tvExL, const TVectorF &tvExH,
0111 const TVectorF *tvEyL, const TVectorF *tvEyH, Int_t m = kOnlyFirst);
0112 TGraphMultiErrors(Int_t ne, const TVectorD &tvX, const TVectorD &tvY, const TVectorD &tvExL, const TVectorD &tvExH,
0113 const TVectorD *tvEyL, const TVectorD *tvEyH, Int_t m = kOnlyFirst);
0114
0115 TGraphMultiErrors(const TGraphMultiErrors &tgme);
0116 TGraphMultiErrors &operator=(const TGraphMultiErrors &tgme);
0117
0118 TGraphMultiErrors(const TH1 *th, Int_t ne = 1);
0119 TGraphMultiErrors(const TH1 *pass, const TH1 *total, Int_t ne = 1, Option_t *option = "");
0120
0121 ~TGraphMultiErrors() override;
0122
0123 virtual void AddYError(Int_t np, const Double_t *eyL = nullptr, const Double_t *eyH = nullptr);
0124 void Apply(TF1 *f) override;
0125 virtual void BayesDivide(const TH1 *pass, const TH1 *total, Option_t *opt = "");
0126 void Divide(const TH1 *pass, const TH1 *total, Option_t *opt = "cp");
0127 void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const override;
0128 virtual void DeleteYError(Int_t e);
0129
0130 Double_t GetErrorX(Int_t i) const override;
0131 Double_t GetErrorY(Int_t i) const override;
0132 virtual Double_t GetErrorY(Int_t i, Int_t e) const;
0133
0134 Double_t GetErrorXlow(Int_t i) const override;
0135 Double_t GetErrorXhigh(Int_t i) const override;
0136 Double_t GetErrorYlow(Int_t i) const override;
0137 Double_t GetErrorYhigh(Int_t i) const override;
0138 virtual Double_t GetErrorYlow(Int_t i, Int_t e) const;
0139 virtual Double_t GetErrorYhigh(Int_t i, Int_t e) const;
0140
0141 Double_t *GetEXlow() const override { return fExL; }
0142 Double_t *GetEXhigh() const override { return fExH; }
0143 Double_t *GetEYlow() const override;
0144 Double_t *GetEYhigh() const override;
0145 virtual Double_t *GetEYlow(Int_t e);
0146 virtual Double_t *GetEYhigh(Int_t e);
0147
0148 virtual TAttFill *GetAttFill(Int_t e);
0149 virtual TAttLine *GetAttLine(Int_t e);
0150
0151 using TAttFill::GetFillColor;
0152 using TAttFill::GetFillStyle;
0153
0154 virtual Color_t GetFillColor(Int_t e) const;
0155 virtual Style_t GetFillStyle(Int_t e) const;
0156
0157 using TAttLine::GetLineColor;
0158 using TAttLine::GetLineStyle;
0159 using TAttLine::GetLineWidth;
0160
0161 virtual Color_t GetLineColor(Int_t e) const;
0162 virtual Style_t GetLineStyle(Int_t e) const;
0163 virtual Width_t GetLineWidth(Int_t e) const;
0164
0165 Int_t GetSumErrorsMode() const { return fSumErrorsMode; }
0166 Int_t GetNYErrors() const { return fNYErrors; }
0167
0168 void Print(Option_t *chopt = "") const override;
0169 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0170 void Scale(Double_t c1=1., Option_t *option="y") override;
0171
0172 virtual void SetPointError(Double_t exL, Double_t exH, Double_t eyL1, Double_t eyH1, Double_t eyL2 = 0.,
0173 Double_t eyH2 = 0., Double_t eyL3 = 0., Double_t eyH3 = 0.);
0174 virtual void SetPointError(Int_t i, Int_t ne, Double_t exL, Double_t exH, const Double_t *eyL, const Double_t *eyH);
0175
0176 virtual void SetPointEX(Int_t i, Double_t exL, Double_t exH);
0177 virtual void SetPointEXlow(Int_t i, Double_t exL);
0178 virtual void SetPointEXhigh(Int_t i, Double_t exH);
0179 virtual void SetPointEY(Int_t i, Int_t ne, const Double_t *eyL, const Double_t *eyH);
0180 virtual void SetPointEYlow(Int_t i, Int_t ne, const Double_t *eyL);
0181 virtual void SetPointEYhigh(Int_t i, Int_t ne, const Double_t *eyH);
0182 virtual void SetPointEY(Int_t i, Int_t e, Double_t eyL, Double_t eyH);
0183 virtual void SetPointEYlow(Int_t i, Int_t e, Double_t eyL);
0184 virtual void SetPointEYhigh(Int_t i, Int_t e, Double_t eyH);
0185
0186 virtual void SetEY(Int_t e, Int_t np, const Double_t *eyL, const Double_t *eyH);
0187 virtual void SetEYlow(Int_t e, Int_t np, const Double_t *eyL);
0188 virtual void SetEYhigh(Int_t e, Int_t np, const Double_t *eyH);
0189
0190 virtual void SetSumErrorsMode(Int_t m);
0191
0192 virtual void SetAttFill(Int_t e, TAttFill *taf);
0193 virtual void SetAttLine(Int_t e, TAttLine *tal);
0194
0195 using TAttFill::SetFillColor;
0196 using TAttFill::SetFillColorAlpha;
0197 using TAttFill::SetFillStyle;
0198
0199 virtual void SetFillColor(Int_t e, Color_t fcolor);
0200 virtual void SetFillColorAlpha(Int_t e, Color_t fcolor, Float_t falpha);
0201 virtual void SetFillStyle(Int_t e, Style_t fstyle);
0202
0203 using TAttLine::SetLineColor;
0204 using TAttLine::SetLineColorAlpha;
0205 using TAttLine::SetLineStyle;
0206 using TAttLine::SetLineWidth;
0207
0208 virtual void SetLineColor(Int_t e, Color_t lcolor);
0209 virtual void SetLineColorAlpha(Int_t e, Color_t lcolor, Float_t lalpha);
0210 virtual void SetLineStyle(Int_t e, Style_t lstyle);
0211 virtual void SetLineWidth(Int_t e, Width_t lwidth);
0212
0213 ClassDefOverride(TGraphMultiErrors, 1)
0214 };
0215
0216 #endif