File indexing completed on 2026-09-26 09:13:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TMultiGraph
0013 #define ROOT_TMultiGraph
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TNamed.h"
0025 #include "TCollection.h"
0026 #include "TFitResultPtr.h"
0027
0028 class TH1F;
0029 class TAxis;
0030 class TBrowser;
0031 class TGraph;
0032 class TF1;
0033
0034 class TMultiGraph : public TNamed {
0035
0036 protected:
0037 TList *fGraphs{nullptr};
0038 TList *fFunctions{nullptr};
0039 TH1F *fHistogram{nullptr};
0040 Double_t fMaximum{-1111};
0041 Double_t fMinimum{-1111};
0042
0043 TMultiGraph(const TMultiGraph&) = delete;
0044 TMultiGraph& operator=(const TMultiGraph&) = delete;
0045
0046 public:
0047 TMultiGraph();
0048 TMultiGraph(const char *name, const char *title);
0049 ~TMultiGraph() override;
0050
0051 virtual void Add(TGraph *graph, Option_t *chopt = "");
0052 void Browse(TBrowser *b) override;
0053 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0054 void Draw(Option_t *chopt = "") override;
0055 virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0);
0056 virtual TFitResultPtr Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t rxmin=0, Axis_t rxmax=0);
0057 virtual void FitPanel();
0058 virtual Option_t *GetGraphDrawOption(const TGraph *gr) const;
0059 virtual void LeastSquareLinearFit(Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin, Double_t xmax);
0060 virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin, Double_t xmax);
0061 virtual void InitPolynom(Double_t xmin, Double_t xmax);
0062 virtual void InitExpo(Double_t xmin, Double_t xmax);
0063 virtual void InitGaus(Double_t xmin, Double_t xmax);
0064 virtual Int_t IsInside(Double_t x, Double_t y) const;
0065 TH1F *GetHistogram();
0066 TF1 *GetFunction(const char *name) const;
0067 TList *GetListOfGraphs() const { return fGraphs; }
0068 TIter begin() const;
0069 TIter end() const { return TIter::End(); }
0070 TList *GetListOfFunctions();
0071 const TList *GetListOfFunctions() const { return fFunctions; }
0072 TAxis *GetXaxis();
0073 TAxis *GetYaxis();
0074 void Paint(Option_t *chopt = "") override;
0075 void PaintPads(Option_t *chopt = "", Int_t nColumn = 0);
0076 void PaintPolyLine3D(Option_t *chopt = "");
0077 void PaintReverse(Option_t *chopt = "");
0078 void Print(Option_t *chopt="") const override;
0079 void RecursiveRemove(TObject *obj) override;
0080 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0081 void SetHistogram(TH1F *hist);
0082 virtual void SetMaximum(Double_t maximum=-1111);
0083 virtual void SetMinimum(Double_t minimum=-1111);
0084
0085 ClassDefOverride(TMultiGraph,2)
0086 };
0087
0088 #endif