RooAddPdf with negative coefficients?


I’m trying to use RooAddPdf to do a template fit, where some “processes” I’d like to fit are quantum interferences (i.e. can yield negative “event numbers”)… Note that the total event number will always be positive.

For simplicity’s sake, let’s consider the case where I only have one background (“TT”, with the constant coefficient “TT_var” set to 1) and one interference contribution (“OC8ut”, with the coefficient “OC8ut_var” which can be negative). I defined the RooRealVar corresponding to “OC8ut_var” with a range from -5 to 5. With PDFs defined from histograms corresponding to each “process”, the model is then: OC8ut_var * OC8ut_histPdf + TT_var * TT_histPdf.

These are the errors I get:

[#0] WARNING:Minization -- RooFitGlue: Minimized function has error status. Returning maximum FCN so far (178074) to force MIGRAD to back out of this region. Error log follows Parameter values: OC8ut_var=-0.293208 RooNLLVar::nll_Template_model_data_hist[ paramSet=(OC8ut_var,TT_var) ] function value is NAN @ paramSet=(OC8ut_var = -0.293208,TT_var = 1) RooAddPdf::Template_model[ OC8ut_var * OC8ut_histPdf + TT_var * TT_histPdf ] p.d.f value is less than zero (-0.000068), forcing value to zero @ !refCoefNorm=(), !pdfs=(OC8ut_histPdf = 0.0704018/78.2799,TT_histPdf = 6.82026/31612.8), !coefficients=(OC8ut_var = -0.293208,TT_var = 1) getLogVal() top-level p.d.f evaluates to zero @ !refCoefNorm=(), !pdfs=(OC8ut_histPdf = 0.0704018/78.2799,TT_histPdf = 6.82026/31612.8), !coefficients=(OC8ut_var = -0.293208,TT_var = 1)

Is there a way to use RooAddPdf with negative coefficients? If not, what do you think would be the best way to do this fit?

I can provide additional information if needed.


I found the problem, hence the “solved” status (it’s not possible to delete the post).

Some information, in case that helps anyone:

RooAddPdf has no problem with negative coefficients, of course as long as the resulting PDF is everywhere positive.

The point is (maybe it’s self-evident, maybe it’s not), when providing a PDF of the form c_0 * hist_0 + c_1 * hist_1 + …, RooAddPdf doesn’t care about the normalization of the histograms, and takes the coefficients c_i to be the corresponding number of events, and NOT a scaling factor assuming the histograms are normalized to the expected number of events of the corresponding process.