Segmentation violation trying to plot negative log-likelihood in root 6.24/06

Hi, I was currently working with root 6.24/06 but I wasn’t able to solve the problem “segmentation violation” trying to plot the negative log-likelihood.

The part of the code is the following:

nll = pdf.createNLL(data)
canvas_nevv = ROOT.TCanvas(“canvas_nevv”, “canvas_nevv”, 800, 720)
nevv_frame = myWS.var(“n_sig”).frame(" ")
nll.plotOn(nevv_frame,ROOT.RooFit.ShiftToZero())
nevv_frame.Draw()
canvas_nevv.SaveAs(output_file+“nll.png”)

The log output of this part is in this text file
output_nll_root624_06.txt (1.0 KB)

However, going back to root 6.22/00, the plot finished ok, I just have some problems with the PDF evaluation, but there is not a “segmentation violation”, the log output for this case is this
output_nll_root622_00.txt (268.4 KB).

I hope someone can help me to clarify the problem, I would like to continue using root 6.24/06, or maybe it is that I need to move everything to the new release?
Thanks.

Hi Marcgh04,

you have an error in your code, as you can anticipate from the ERROR both your output files.

This is wrong:

nevv_frame = myWS.var(“n_sig”).frame(" ")

A single string is not an argument of RooAbsRealLValue::frame(). If you want to pass the title of the frame, you need to call frame(ROOT.RooFit.Title(" ")).

However, I don’t think that this is what causes the crash. Unfortunately I can’t reproduce the crash with a simple RooFit model, can you please share the full code to reproduce the crash so I can help?

Cheers,
Jonas

Thanks for the quick answer @jonas and sorry for the late response, I attached the code, other comments are very welcome. Thanks again :slight_smile:
Constrain_Fit_histPDF_2d.py (5.4 KB)

template_sig.root (5.7 KB)

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