#include #include #include #include #include "TF1.h" #include "TH1F.h" #include "TMath.h" #include "TRandom3.h" using namespace std; class StatUtils{ public: StatUtils(); StatUtils(int rnd_seed, int searchWidth, bool dodeficits = false); ~StatUtils(); // void findexcess(TH1F* const hdata, TH1F* const hsm, // TH1F* const hesm, double &maxprob, int &maxdata, // double &maxsm, double &maxsigma, std::vector &maxbin); void findexcess(TH1F* const hdata, TH1F* const hsm, TH1F* const hesm, double &maxprob, int &maxdata, double &maxsm, double &maxsigma, vector &maxbin, bool data_sm_comparison=false); void findexcess(TH1F* const hdata, TH1F* const hsm, TH1F* const hesm, vector restrict_bin, double &maxprob, int &maxdata, double &maxsm, double &maxsigma, vector &maxbin, bool data_sm_comparison=false); double pverr(int, double, double); double KStest(TH1F* h1, TH1F* h2); double Chi2test(TH1F* h1, TH1F* h2); /*inline*/ double pvalueTosigma(double pvalue); TH1F* GenerateToyHisto(TH1F* hsm, TH1F* hesm); /*inline*/ double GenerateRndEvent(double nsm, double errnsm); double CorrectPvalue(double pvalue, TH1F* hsm, TH1F* hesm); bool region_match(vector search_region, vector restrict_region); private: int irspread; TRandom3 rnd; TF1 *ErrfPG; TF1 *ErrfGG; TF1 *ErrfPGDown; TF1 *ErrfGGDown; bool doDeficits; //! define here all kind of functions used to determine the pvalues // double fGauss(Double_t *x,Double_t *par); // double fPoisGauss(Double_t *x,Double_t *par); // double fPoisGaussDown(Double_t *x,Double_t *par); // double fGaussGauss(Double_t *x,Double_t *par); // double fGaussGaussDown(Double_t *x,Double_t *par); };