RooFit crashes ROOT session

Hello,

I am having problems using RooFit with ROOT 5.22 (via CMSSW_3_8_6). When I attempt to fit data from file using a 5th/6th/7th order polynomial with a threshold cutoff via RooGenericPdf (combined with a yield parameter via RooAddPdf), more often than not I encounter massive problems. Typically ROOT crashes with an interpreter error before the fit converges:

Error: Symbol G__exception is not defined in current scope (tmpfile):1:
Error: type G__exception not defined FILE:(tmpfile) LINE:1
*** Interpreter error recovered ***

This usually occurs after a lot of messages saying “p.d.f. value is less than zero, forcing value to zero” during the fitting process. I’ve found that the problem does not occur if I limit the parameter ranges to only positive numbers, which in turn prevents the PDF from becoming negative at any point (however the resulting fit is pretty terrible, definitely going to need some of the parameters to be negative). So it seems that the messages are directly related to the crashing. Additionally, I tried fitting the same data using RooChebychev (still with the yield parameter added in with RooAddPdf), order 5. This results in a failure of the fit to converge but also freezes with a different message this time:

Error in TRegexp::Index: Bad Regular Expression
Error in TRegexp::Index: Bad Regular Expression
Error in TRegexp::Index: Bad Regular Expression
Error in TRegexp::Index: Bad Regular Expression
Error in TRegexp::Index: Bad Regular Expression
Error in TRegexp::Index: Bad Regular Expression
RooRealMPFE::initalize(nll_sum_dataset_b36a578_MPFE0) server process terminating
RooRealMPFE::initalize(nll_sum_dataset_b36a578_MPFE1) server process terminating
etc.

This is after a spamming of messages about “p.d.f. normalization integral is zero” during the fitting process. Maybe the two problems above are unrelated, but I somehow doubt it. At any rate this is pretty frustrating, have put a few days into this with no results, so I’d appreciate some help from the experts! :slight_smile:

All the best,
Michael

Hi Michael,

I would not use a RooGenericPdf, but real C++ code so you avoid having this interpreted problems and in addition the pdf evaluation will be order of magnitude faster. Make a pdf binding real C/C++ code, using for example a RooFunctorPdfBinding

Cheers, Lorenzo