// @(#)root/hist:$Id$
// Author: Rene Brun   12/10/2000

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TMultiGraph
#define ROOT_TMultiGraph


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TMultiGraph                                                          //
//                                                                      //
// A collection of TGraph objects                                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif

#include "TF1.h"

class TH1F;
class TAxis;
class TBrowser;
class TGraph;

#include "TFitResultPtr.h"

class TMultiGraph : public TNamed {

protected:
   TList      *fGraphs;     //Pointer to list of TGraphs
   TList      *fFunctions;  //Pointer to list of functions (fits and user)
   TH1F       *fHistogram;  //Pointer to histogram used for drawing axis
   Double_t    fMaximum;    //Maximum value for plotting along y
   Double_t    fMinimum;    //Minimum value for plotting along y

   TMultiGraph(const TMultiGraph&);
   TMultiGraph& operator=(const TMultiGraph&);

public:
   TMultiGraph();
   TMultiGraph(const char *name, const char *title);
   virtual ~TMultiGraph();

   virtual void      Add(TGraph *graph, Option_t *chopt="");
   virtual void      Add(TMultiGraph *multigraph, Option_t *chopt="");
   virtual void      Browse(TBrowser *b);
   virtual Int_t     DistancetoPrimitive(Int_t px, Int_t py);
   virtual void      Draw(Option_t *chopt="");
   virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0);
   virtual TFitResultPtr Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t rxmin=0, Axis_t rxmax=0);
   virtual void      FitPanel(); // *MENU*
   virtual Option_t *GetGraphDrawOption(const TGraph *gr) const;
   virtual void      LeastSquareLinearFit(Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin, Double_t xmax);
   virtual void      LeastSquareFit(Int_t m, Double_t *a, Double_t xmin, Double_t xmax);
   virtual void      InitPolynom(Double_t xmin, Double_t xmax);
   virtual void      InitExpo(Double_t xmin, Double_t xmax);
   virtual void      InitGaus(Double_t xmin, Double_t xmax);
   virtual Int_t     IsInside(Double_t x, Double_t y) const;
   TH1F             *GetHistogram() const;
   TF1              *GetFunction(const char *name) const;
   TList            *GetListOfGraphs() const { return fGraphs; }
   TList            *GetListOfFunctions();  // non const method (create list if empty)
   const TList      *GetListOfFunctions() const { return fFunctions; }
   TAxis            *GetXaxis() const;
   TAxis            *GetYaxis() const;
   virtual void      Paint(Option_t *chopt="");
   void              PaintPads(Option_t *chopt="");
   void              PaintPolyLine3D(Option_t *chopt="");
   virtual void      Print(Option_t *chopt="") const;
   virtual void      RecursiveRemove(TObject *obj);
   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void      SetMaximum(Double_t maximum=-1111);
   virtual void      SetMinimum(Double_t minimum=-1111);

   ClassDef(TMultiGraph,2)  //A collection of TGraph objects
};

#endif


 TMultiGraph.h:1
 TMultiGraph.h:2
 TMultiGraph.h:3
 TMultiGraph.h:4
 TMultiGraph.h:5
 TMultiGraph.h:6
 TMultiGraph.h:7
 TMultiGraph.h:8
 TMultiGraph.h:9
 TMultiGraph.h:10
 TMultiGraph.h:11
 TMultiGraph.h:12
 TMultiGraph.h:13
 TMultiGraph.h:14
 TMultiGraph.h:15
 TMultiGraph.h:16
 TMultiGraph.h:17
 TMultiGraph.h:18
 TMultiGraph.h:19
 TMultiGraph.h:20
 TMultiGraph.h:21
 TMultiGraph.h:22
 TMultiGraph.h:23
 TMultiGraph.h:24
 TMultiGraph.h:25
 TMultiGraph.h:26
 TMultiGraph.h:27
 TMultiGraph.h:28
 TMultiGraph.h:29
 TMultiGraph.h:30
 TMultiGraph.h:31
 TMultiGraph.h:32
 TMultiGraph.h:33
 TMultiGraph.h:34
 TMultiGraph.h:35
 TMultiGraph.h:36
 TMultiGraph.h:37
 TMultiGraph.h:38
 TMultiGraph.h:39
 TMultiGraph.h:40
 TMultiGraph.h:41
 TMultiGraph.h:42
 TMultiGraph.h:43
 TMultiGraph.h:44
 TMultiGraph.h:45
 TMultiGraph.h:46
 TMultiGraph.h:47
 TMultiGraph.h:48
 TMultiGraph.h:49
 TMultiGraph.h:50
 TMultiGraph.h:51
 TMultiGraph.h:52
 TMultiGraph.h:53
 TMultiGraph.h:54
 TMultiGraph.h:55
 TMultiGraph.h:56
 TMultiGraph.h:57
 TMultiGraph.h:58
 TMultiGraph.h:59
 TMultiGraph.h:60
 TMultiGraph.h:61
 TMultiGraph.h:62
 TMultiGraph.h:63
 TMultiGraph.h:64
 TMultiGraph.h:65
 TMultiGraph.h:66
 TMultiGraph.h:67
 TMultiGraph.h:68
 TMultiGraph.h:69
 TMultiGraph.h:70
 TMultiGraph.h:71
 TMultiGraph.h:72
 TMultiGraph.h:73
 TMultiGraph.h:74
 TMultiGraph.h:75
 TMultiGraph.h:76
 TMultiGraph.h:77
 TMultiGraph.h:78
 TMultiGraph.h:79
 TMultiGraph.h:80
 TMultiGraph.h:81
 TMultiGraph.h:82
 TMultiGraph.h:83
 TMultiGraph.h:84
 TMultiGraph.h:85
 TMultiGraph.h:86
 TMultiGraph.h:87
 TMultiGraph.h:88
 TMultiGraph.h:89
 TMultiGraph.h:90