Using Crystal ball PDF with ROOT::Math::GoFTest

Dear experts,

I am trying to use ROOT::Math::GoFTest to do GoF test on my signal fits. I have some questions on how to implement Crystal Ball functions with ROOT::Math::Functor1D together with a constructor like this ROOT::Math::GoFTest* goftest_3a = new ROOT::Math::GoFTest(nEvents3, sample3, f, ROOT::Math::GoFTest::kPDF, minimum,maximum);

I am reading this example https://root.cern.ch/doc/v610/goftest_8C.html but I am so confused since Crystal Ball PDF would have 4 parameters need to be fed in but I can not pass those parameters into ROOT::Math::Functor1D. (These paramters are already obtained from a RooFit session). I am wondering if I did something wrong or there is a better way to plug crystall ball pdf into GoFTest… If somehow I can do it directly wtth RooFit would be better but unfortunately I did not find the corresponding methods.

Thanks a lot!

Best,
Sebastian

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hi @Xuli,

I only see this now, sorry for the long delay. I think the easiest way is to plot the data and use RooPlot’s chiSquare test:
https://root.cern.ch/doc/master/classRooPlot.html#a8deca043605c65bc5eadf6fb87b15e7f

Note that you have to tell it how many fit parameters were used (it should be 4 in your case).