Go to the documentation of this file.00001 #ifndef __BCMODELGRAPHFITTER__H
00002 #define __BCMODELGRAPHFITTER__H
00003
00016
00017
00018
00019
00020
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
00048 BCGraphFitter(const char * name);
00049
00054 BCGraphFitter(TGraphErrors * graph, TF1 * func);
00055
00061 BCGraphFitter(const char * name, TGraphErrors * graph, TF1 * func);
00062
00065 ~BCGraphFitter();
00066
00067
00068
00070
00071
00074 TGraphErrors * GetGraph()
00075 { return fGraph; };
00076
00079 TF1 * GetFitFunction()
00080 { return fFitFunction; };
00081
00084 TGraph * GetErrorBand()
00085 { return fErrorBand; };
00086
00089 TGraph * GetGraphFitFunction()
00090 { return fGraphFitFunction; };
00091
00092
00093
00095
00096
00099 int SetGraph(TGraphErrors * graph);
00100
00103 int SetFitFunction(TF1 * func);
00104
00105
00107
00108
00112
00113
00117 double LogLikelihood(const std::vector<double> & parameters);
00118
00124 double FitFunction(const std::vector<double> & x, const std::vector<double> & parameters);
00125
00129 int Fit();
00130
00136 int Fit(TGraphErrors * graph, TF1 * func);
00137
00140 void DrawFit(const char * options = "", bool flaglegend = false);
00141
00142 virtual double CDF(const std::vector<double>& parameters, int index, bool lower=false);
00143
00144
00145
00146 private:
00147
00150 TGraphErrors * fGraph;
00151
00154 TF1 * fFitFunction;
00155
00158 TGraph * fErrorBand;
00159
00162 TGraph * fGraphFitFunction;
00163
00164 };
00165
00166
00167
00168 #endif