[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 25487 - (download) (as text) (annotate)
Mon Sep 22 12:44:13 2008 UTC (6 years, 4 months ago) by moneta
File size: 3807 byte(s)
Import changes from math development branch, in particular a re-implementation of 
fitting methods for the histogram and graph objects. 

NOTE: Since some files are removed, a  make clean-hist is needed in order to be able 
to compile hist after an svn update. 

 
The implementation of TH1::Fit, TGraph::Fit, TGraph2D::Fit and TMultiGraph::Fit is 
done in a common function implemented in HFitImpl.cxx (HFit::Fit). 

In addition the file HFitInterface.h define ROOT::Fit::FitObject functions passing 
option directly via Foption class and not by a string. They are used by the FitPanel.

Remove previously existing files THistFitInterface.cxx (and *.h) and 
TGraphFitInterface.cxx (and *.h). The code is now in the  HFitInterface.cxx (and *.h) 
files. 

Use plugin manager directly to open the Fit Panel. Do not pass anymore via the THistPainter. 
Changes in TH1::FitPanel, TGraph::FitPanel. 
Add FitPanel() method for TGraph2D and TMultiGraph. 

Add new class TBackCompFitter, providing a backward compatible implementation of 
TVirtualFitter using the new fitting class. It is constructed from the fitter class 
and can be used to retrieve the fit information (result and configuration) via the 
TVirtualFitter API from FitConfig and FitResult. A static istance is created after 
calling the Fit method.   
  
Other changes are:  


TGraph: 
  - when creating a graph from an histogram, don't use the same name. 
  Otherwise it will conflict later with histogram created internally by the TGraph. 

TH2: 
     add protected method TH2::DoFitSlices and TH2::DoProfile as common implementations
     for (FitSlicesX,FitSclicesY) and (ProfileX, ProfileY).
     pass the global statistics in DoProjection when range is (1,NBIN)

TBinimialEfficiencyFit: 
     add possibility to set verbose option, and set different precision and 
     max iterations for minimizing.

// @(#)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;

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&);

   virtual Int_t     DoFit(TF1 *f1,Option_t *option,Option_t *goption, Axis_t xmin, Axis_t xmax);
  
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 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      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);
   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="");
   virtual void      Print(Option_t *chopt="") const;
   virtual void      RecursiveRemove(TObject *obj);
   virtual void      SavePrimitive(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



Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9