#include #include #include #include #include #include #include #include "Math/GoFTest.h" #include "Math/DistFunc.h" #include "TF1.h" double func (double *x, double *par) { double xx = x[0]; double sqr2 = 1./sqrt(2.); double erfval = 1. + TMath::Erf(sqr2*(xx-par[1])/par[2] - sqr2*par[2]/par[0]); double expval = exp(-((xx-par[1])/par[0]-0.5*pow(par[2]/par[0],2))); double fitval = 0.5/par[0]*expval*erfval; return fitval; } void ADExample(){ const int size = 40; double data[size] = {587.319,599.435,600.477,600.477,603.433,604.132,607.448,608.991,610.133,611.229,611.615,617.349,617.75,618.557,620.059,622.04,622.061,622.061,622.061,622.464,622.714,622.755,625.856,625.856,626.577,627.213,627.585,629.453,629.702,630.415,632.706,632.985,634.377,635.268,635.268,635.534,636.366,636.434,637.77,638.02}; double par[3] = {55.5362,659.388,32.1223}; TF1 hypothesis("hypothesis", func,400,2000); hypothesis.SetParameters(par[0],par[1],par[2]); ROOT::Math::GoFTest *cdf; cdf->SetCDF(hypothesis); ROOT::Math::GoFTest* goftest = new ROOT::Math::GoFTest(data,size,ROOT::Math::GoFTest::kUserDefined); cout<<"Goodness of fit "<AndersonDarlingTest("")<