BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCGraphFitter.h
1 #ifndef __BCMODELGRAPHFITTER__H
2 #define __BCMODELGRAPHFITTER__H
3 
16 /*
17  * Copyright (C) 2007-2014, the BAT core developer team
18  * All rights reserved.
19  *
20  * For the licensing terms see doc/COPYING.
21  * For documentation see http://mpp.mpg.de/bat
22  */
23 
24 // ---------------------------------------------------------
25 
26 #include <vector>
27 
28 #include "BCFitter.h"
29 
30 class TGraphErrors;
31 class TF1;
32 
33 // ---------------------------------------------------------
34 
35 class BCGraphFitter : public BCFitter
36 {
37  public:
38 
40  /* @{ */
41 
44  BCGraphFitter();
45 
49  BCGraphFitter(const char * name);
50 
55  BCGraphFitter(TGraphErrors * graph, TF1 * func);
56 
62  BCGraphFitter(const char * name, TGraphErrors * graph, TF1 * func);
63 
67 
68  /* @} */
69 
71  /* @{ */
72 
75  TGraphErrors * GetGraph()
76  { return fGraph; };
77 
81  { return fFitFunction; };
82 
85  TGraph * GetErrorBand()
86  { return fErrorBand; };
87 
91  { return fGraphFitFunction; };
92 
93  /* @} */
94 
96  /* @{ */
97 
100  int SetGraph(TGraphErrors * graph);
101 
104  int SetFitFunction(TF1 * func);
105 
106  /* @} */
108  /* @{ */
109 
113 // double LogAPrioriProbability(const std::vector<double> & parameters);
114 
118  double LogLikelihood(const std::vector<double> & parameters);
119 
125  double FitFunction(const std::vector<double> & x, const std::vector<double> & parameters);
126 
130  int Fit();
131 
137  int Fit(TGraphErrors * graph, TF1 * func);
138 
141  void DrawFit(const char * options = "", bool flaglegend = false);
142 
143  virtual double CDF(const std::vector<double>& parameters, int index, bool lower=false);
144 
145  /* @} */
146 
147  private:
148 
151  TGraphErrors * fGraph;
152 
155  TF1 * fFitFunction;
156 
159  TGraph * fErrorBand;
160 
163  TGraph * fGraphFitFunction;
164 
165 };
166 
167 // ---------------------------------------------------------
168 
169 #endif
TGraph * GetErrorBand()
Definition: BCGraphFitter.h:85
TGraph * GetGraphFitFunction()
Definition: BCGraphFitter.h:90
int SetFitFunction(TF1 *func)
double FitFunction(const std::vector< double > &x, const std::vector< double > &parameters)
void DrawFit(const char *options="", bool flaglegend=false)
TF1 * GetFitFunction()
Definition: BCGraphFitter.h:80
A class for fitting graphs with functions.
Definition: BCGraphFitter.h:35
double LogLikelihood(const std::vector< double > &parameters)
TGraphErrors * GetGraph()
Definition: BCGraphFitter.h:75
virtual double CDF(const std::vector< double > &parameters, int index, bool lower=false)
A base class for all fitting classes.
Definition: BCFitter.h:27
int SetGraph(TGraphErrors *graph)