Go to the documentation of this file.00001 #ifndef __BCEFFICIENCYFITTER__H
00002 #define __BCEFFICIENCYFITTER__H
00003
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <vector>
00028
00029 #include "../../BAT/BCModel.h"
00030
00031
00032 class TH1D;
00033 class TF1;
00034 class TGraphAsymmErrors;
00035
00036
00037
00038 class BCEfficiencyFitter : public BCModel
00039 {
00040 public:
00041
00043
00044
00047 BCEfficiencyFitter();
00048
00052 BCEfficiencyFitter(const char * name);
00053
00059 BCEfficiencyFitter(TH1D * hist1, TH1D * hist2, TF1 * func);
00060
00067 BCEfficiencyFitter(const char * name, TH1D * hist1, TH1D * hist2, TF1 * func);
00068
00071 ~BCEfficiencyFitter();
00072
00073
00075
00076
00079 TH1D * GetHistogram1()
00080 { return fHistogram1; };
00081
00084 TH1D * GetHistogram2()
00085 { return fHistogram2; };
00086
00089 TGraphAsymmErrors * GetHistogramRatio()
00090 { return fHistogramRatio; };
00091
00094 TF1 * GetFitFunction()
00095 { return fFitFunction; };
00096
00099 TGraph * GetErrorBand()
00100 { return fErrorBand; };
00101
00104 TGraph * GetGraphFitFunction()
00105 { return fGraphFitFunction; };
00106
00116 int GetUncertainties(int n, int k, double p, double &xexp, double &xmin, double &xmax);
00117
00118
00120
00121
00126 int SetHistograms(TH1D * hist1, TH1D * hist2);
00127
00131 int SetFitFunction(TF1 * func);
00132
00137 void SetFlagIntegration(bool flag)
00138 { fFlagIntegration = flag; };
00139
00144 void SetDataPointType(int type);
00145
00146
00148
00149
00153
00154
00158 virtual double LogLikelihood(const std::vector<double> & parameters);
00159
00165 double FitFunction(const std::vector<double> & x, const std::vector<double> & parameters);
00166
00170 int Fit();
00171
00178 int Fit(TH1D * hist1, TH1D * hist2, TF1 * func);
00179
00182 void DrawFit(const char * options = "", bool flaglegend = false);
00183
00189 int CalculatePValueFast(const std::vector<double> & par, double &pvalue);
00190
00191
00192
00193 private:
00194
00197 TH1D * fHistogram1;
00198
00201 TH1D * fHistogram2;
00202
00205 TGraphAsymmErrors * fHistogramRatio;
00206
00209 TF1 * fFitFunction;
00210
00214 bool fFlagIntegration;
00215
00218 TGraph * fErrorBand;
00219
00222 TGraph * fGraphFitFunction;
00223
00226 TH1D * fHistogramBinomial;
00227
00232 unsigned int fDataPointType;
00233
00234 };
00235
00236
00237
00238 #endif