BCGraphFitter.h

Go to the documentation of this file.
00001 #ifndef __BCMODELGRAPHFITTER__H
00002 #define __BCMODELGRAPHFITTER__H
00003 
00016 /*
00017  * Copyright (C) 2008, Daniel Kollar and Kevin Kroeninger.
00018  * All rights reserved.
00019  *
00020  * For the licensing terms see doc/COPYING.
00021  */
00022 
00023 // ---------------------------------------------------------
00024 
00025 #include <vector>
00026 
00027 #include "BAT/BCModel.h"
00028 
00029 class TGraphErrors;
00030 class TF1;
00031 
00032 // ---------------------------------------------------------
00033 
00034 class BCGraphFitter : public BCModel
00035 {
00036    public:
00037 
00039       /* @{ */
00040 
00043       BCGraphFitter();
00044 
00049       BCGraphFitter(TGraphErrors * graph, TF1 * func);
00050 
00053       ~BCGraphFitter();
00054 
00055       /* @} */
00056 
00058       /* @{ */
00059 
00062       TGraphErrors * GetGraph()
00063          { return fGraph; };
00064 
00067       TF1 * GetFitFunction()
00068          { return fFitFunction; };
00069 
00072       TGraph * GetErrorBand()
00073          { return fErrorBand; };
00074 
00077       TGraph * GetGraphFitFunction()
00078          { return fGraphFitFunction; };
00079 
00080       /* @} */
00081 
00083       /* @{ */
00084 
00087       int SetGraph(TGraphErrors * graph);
00088 
00091       int SetFitFunction(TF1 * func);
00092 
00093       /* @} */
00095       /* @{ */
00096 
00100       double LogAPrioriProbability(std::vector <double> parameters);
00101 
00105       double LogLikelihood(std::vector <double> parameters);
00106 
00112       double FitFunction(std::vector <double> x, std::vector <double> parameters);
00113 
00117       int Fit()
00118          { return this -> Fit(fGraph, fFitFunction); };
00119 
00125       int Fit(TGraphErrors * graph, TF1 * func);
00126 
00129       void DrawFit(const char * options = "", bool flaglegend = false);
00130 
00131       virtual double CDF(std::vector<double> parameters, int index, bool lower=false);
00132 
00133       /* @} */
00134 
00135    private:
00136 
00139       TGraphErrors * fGraph;
00140 
00143       TF1 * fFitFunction;
00144 
00147       TGraph * fErrorBand;
00148 
00151       TGraph * fGraphFitFunction;
00152 
00153 };
00154 
00155 // ---------------------------------------------------------
00156 
00157 #endif

Generated on Thu Feb 11 11:29:30 2010 for BayesianAnalysisToolkit by  doxygen 1.5.1