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 "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
00054 BCEfficiencyFitter(TH1D * hist1, TH1D * hist2, TF1 * func);
00055
00058 ~BCEfficiencyFitter();
00059
00060
00062
00063
00066 TH1D * GetHistogram1()
00067 { return fHistogram1; };
00068
00071 TH1D * GetHistogram2()
00072 { return fHistogram2; };
00073
00076 TGraphAsymmErrors * GetHistogramRatio()
00077 { return fHistogramRatio; };
00078
00081 TF1 * GetFitFunction()
00082 { return fFitFunction; };
00083
00086 TGraph * GetErrorBand()
00087 { return fErrorBand; };
00088
00091 TGraph * GetGraphFitFunction()
00092 { return fGraphFitFunction; };
00093
00103 int GetUncertainties(int n, int k, double p, double &xexp, double &xmin, double &xmax);
00104
00105
00107
00108
00113 int SetHistograms(TH1D * hist1, TH1D * hist2);
00114
00118 int SetFitFunction(TF1 * func);
00119
00124 void SetFlagIntegration(bool flag)
00125 { fFlagIntegration = flag; };
00126
00131 void SetDataPointType(int type);
00132
00133
00135
00136
00140
00141
00145 virtual double LogLikelihood(std::vector <double> parameters);
00146
00152 double FitFunction(std::vector <double> x, std::vector <double> parameters);
00153
00157 int Fit();
00158
00165 int Fit(TH1D * hist1, TH1D * hist2, TF1 * func);
00166
00169 void DrawFit(const char * options = "", bool flaglegend = false);
00170
00176 int CalculatePValueFast(std::vector<double> par, double &pvalue);
00177
00178
00179
00180 private:
00181
00184 TH1D * fHistogram1;
00185
00188 TH1D * fHistogram2;
00189
00192 TGraphAsymmErrors * fHistogramRatio;
00193
00196 TF1 * fFitFunction;
00197
00201 bool fFlagIntegration;
00202
00205 TGraph * fErrorBand;
00206
00209 TGraph * fGraphFitFunction;
00210
00213 TH1D * fHistogramBinomial;
00214
00219 unsigned int fDataPointType;
00220
00221 };
00222
00223
00224
00225 #endif