Set User Defined CDF in ROOT::Math::GoFTest

Hello Rooters,

I’m trying to perform the Anderson-Darling test to compare a data set to the fit results. ROOT::Math::GoFTest seems to provide the utilities that I need, but I can’t figure out how to set the user-defined CDF. I’m using the development version of root 5.27.04, tagged on 29 June 2010. I’ve attached an example my code (that doesn’t quite work; I get this error:

/home/grashorn/auger/FDAnalysis/./ADExample.C: In function ‘void ADExample()’:
/home/grashorn/auger/FDAnalysis/./ADExample.C:36: error: no matching function for call to ‘ROOT::Math::GoFTest::SetCDF(TF1&)’
/d2/bbaugh/64bit/root/5.27.04/include/Math/GoFTest.h:127: note: candidates are: void ROOT::Math::GoFTest::SetCDF(ROOT::Math::IBaseFunctionOneDim*)

Thanks a lot for any help you can provide,
Eric
ADExample.C (1.25 KB)

Hi,
you should be able to use the template constructor of ROOT::Math::GoFTest and do:

TF1 * cdf =  ... // your cdf function
ROOT::Math::GoFTest* goftest = new ROOT::Math::GoFTest(data,size, cdf);

But we have found a problem in the class when using your distribution and we will produce a fix in the next days. I will let you know when the fix is committed in the trunk

Thank you for your post

Lorenzo