TChi2FitData.h

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: TChi2FitData.h 36076 2010-10-05 09:13:12Z moneta $
00002 // Author: L. Moneta    10/2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 ROOT Foundation,  CERN/PH-SFT                   *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #ifndef ROOT_TChi2FitData_H_
00011 #define ROOT_TChi2FitData_H_
00012 
00013 #include "RConfig.h"
00014 #include <vector>
00015 
00016 // class TObject; 
00017 class TVirtualFitter;
00018 class TH1;
00019 class TF1;
00020 class TGraph;
00021 class TGraph2D;
00022 class TMultiGraph;
00023 
00024 /**
00025    class holding the data of the fit . 
00026   For chi2 fits the data are: 
00027 
00028   coords() , value, sigmas
00029 */
00030 
00031 
00032 class TChi2FitData { 
00033 
00034 
00035 public: 
00036 
00037   typedef  std::vector<double> CoordData; 
00038 
00039 
00040   /** 
00041       construct the Fit data object
00042   */
00043   
00044    TChi2FitData() : fSize(0), fSkipEmptyBins(false), fIntegral(false) {}
00045 
00046   TChi2FitData(const TVirtualFitter & fitter,  bool skipEmptyBins = true); 
00047 
00048   virtual ~TChi2FitData() {}
00049 
00050   unsigned int Size() const { return fSize; } 
00051 
00052   const CoordData & Coords(unsigned int i) const { return fCoordinates[i]; }
00053 
00054   double Value(unsigned int i) const { return fValues[i]; }
00055 
00056   double InvError(unsigned int i) const { return fInvErrors[i]; }
00057 
00058   bool UseIntegral() const { return fIntegral; }
00059 
00060   bool SkipEmptyBins() const { return fSkipEmptyBins; }
00061 
00062 
00063 protected:
00064 
00065   virtual void GetFitData(const TH1 * hfit, const TF1 * func, const TVirtualFitter * hfitter); 
00066 
00067   void GetFitData(const TGraph * graph, const TF1 * func, const TVirtualFitter * hfitter); 
00068 
00069   void GetFitData(const TGraph2D * graph, const TF1 * func, const TVirtualFitter * hfitter); 
00070 
00071   void GetFitData(const TMultiGraph * graph, const TF1 * func, const TVirtualFitter * hfitter); 
00072 
00073   void SetDataPoint(  const CoordData & x, double y, double error );
00074   
00075 
00076 protected: 
00077 
00078   unsigned int fSize;
00079   bool fSkipEmptyBins;
00080   bool fIntegral;
00081   std::vector<double> fInvErrors;
00082   std::vector<double> fValues;
00083   std::vector<CoordData> fCoordinates;
00084 
00085   
00086 };
00087 
00088 #endif

Generated on Tue Jul 5 14:26:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1