Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TMultiGraph.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Rene Brun 12/10/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TMultiGraph
13 #define ROOT_TMultiGraph
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TMultiGraph //
19 // //
20 // A collection of TGraph objects //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 
26 #include "TF1.h"
27 
28 class TH1F;
29 class TAxis;
30 class TBrowser;
31 class TGraph;
32 
33 #include "TFitResultPtr.h"
34 
35 class TMultiGraph : public TNamed {
36 
37 protected:
38  TList *fGraphs; //Pointer to list of TGraphs
39  TList *fFunctions; //Pointer to list of functions (fits and user)
40  TH1F *fHistogram; //Pointer to histogram used for drawing axis
41  Double_t fMaximum; //Maximum value for plotting along y
42  Double_t fMinimum; //Minimum value for plotting along y
43 
44  TMultiGraph(const TMultiGraph&);
45  TMultiGraph& operator=(const TMultiGraph&);
46 
47 public:
48  TMultiGraph();
49  TMultiGraph(const char *name, const char *title);
50  virtual ~TMultiGraph();
51 
52  virtual void Add(TGraph *graph, Option_t *chopt="");
53  virtual void Add(TMultiGraph *multigraph, Option_t *chopt="");
54  virtual void Browse(TBrowser *b);
55  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
56  virtual void Draw(Option_t *chopt="");
57  virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0);
58  virtual TFitResultPtr Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t rxmin=0, Axis_t rxmax=0);
59  virtual void FitPanel(); // *MENU*
60  virtual Option_t *GetGraphDrawOption(const TGraph *gr) const;
61  virtual void LeastSquareLinearFit(Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin, Double_t xmax);
62  virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin, Double_t xmax);
63  virtual void InitPolynom(Double_t xmin, Double_t xmax);
64  virtual void InitExpo(Double_t xmin, Double_t xmax);
65  virtual void InitGaus(Double_t xmin, Double_t xmax);
66  virtual Int_t IsInside(Double_t x, Double_t y) const;
67  TH1F *GetHistogram();
68  TF1 *GetFunction(const char *name) const;
69  TList *GetListOfGraphs() const { return fGraphs; }
70  TIter begin() const;
71  TIter end() const { return TIter::End(); }
72  TList *GetListOfFunctions(); // non const method (create list if empty)
73  const TList *GetListOfFunctions() const { return fFunctions; }
74  TAxis *GetXaxis();
75  TAxis *GetYaxis();
76  virtual void Paint(Option_t *chopt="");
77  void PaintPads(Option_t *chopt="");
78  void PaintPolyLine3D(Option_t *chopt="");
79  void PaintReverse(Option_t *chopt="");
80  virtual void Print(Option_t *chopt="") const;
81  virtual void RecursiveRemove(TObject *obj);
82  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
83  virtual void SetMaximum(Double_t maximum=-1111);
84  virtual void SetMinimum(Double_t minimum=-1111);
85 
86  ClassDef(TMultiGraph,2) //A collection of TGraph objects
87 };
88 
89 #endif
90 
91