[root] / trunk / hist / hist / inc / TMultiGraph.h Repository:
ViewVC logotype

View of /trunk/hist/hist/inc/TMultiGraph.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11226 - (download) (as text) (annotate)
Fri Mar 4 09:06:37 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/graf/inc/TMultiGraph.h
File size: 3364 byte(s)
From Anna Kreshuk:
- TLinearFitter class: Linear fitter is used to fit a set of data points with a linear
  combination of specified functions (with or without weights). The "linear" in the name
  stands for "linear in parameters", not variables. The main advantages,
  compared to a general non-linear fitter, is that the linear fitter is considerably
  faster and doesn't require setting the initial values of parameters.
  The linear fitter can be used directly or through TH1::Fit and TGraph::Fit functions
  When it's used directly, functions of more than 3 dimensions can be fitted.

- TFormula: a new data member fLinearParts and methods to process it are added. Now
  one can create a function of the type that can be fit by the linear fitter.
  Example: TFormula f("f", "x++sin(x)") is equivalent to
  TFormula f("f","[0]*x + [1]*sin(x)"), but if a TH1::Fit or a TGraph::Fit is performed
  with the 1st formula, it goes through the linear fitter, if it's performed with the
  2nd formula, it goes through Minuit.

- TMultiGraph class: the Fit method is implemented, allowing to fit all the graphs
  of a multigraph simultaneously

- TGraph, TGraphErrors, TGraphAsymmErrors, TGraphBentErrors - functions GetEXhigh(),
  GetEXlow(), GetEYhigh(), GetEYlow() implemented to simplify the GraphFitChisquare()
  function of the TFitter class

- TH1, TGraph, TGraph2D, TMultiGraph - changes in the Fit functions, allowing to use
  the linear fitter. Fitting with "polN" functions redirected to use the linear fitter,
  in cases where no options, except "range", are specified.

// @(#)root/graf:$Name:  $:$Id: TMultiGraph.h,v 1.4 2002/11/06 21:16:43 brun Exp $
// 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;

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
  
 public:
  
  TMultiGraph();
  TMultiGraph(const char *name, const char *title);
  virtual ~TMultiGraph();
  virtual void     Add(TGraph *graph, 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 Int_t    Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0); 
  virtual Int_t    Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t rxmin=0, Axis_t rxmax=0); 
  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);
  TH1F            *GetHistogram() const;
  TF1             *GetFunction(const char *name) const;
  TList           *GetListOfGraphs() const { return fGraphs; }
  TList           *GetListOfFunctions() const { return fFunctions; } 
  TAxis           *GetXaxis() const;
  TAxis           *GetYaxis() const;
  virtual void     Paint(Option_t *chopt="");
  virtual void     Print(Option_t *chopt="") const;
  virtual void     RecursiveRemove(TObject *obj);
  virtual void     SavePrimitive(ofstream &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



Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9