RooFit, fitting ranges and kernel sensitivity (PyRoot)

Hi all (Wim),

I’ve posted this to the “Stat and Math Tools” forum already, as I eventually traced it back to the RooFit interaction with our kernel and not solely a PyRoot implementation.

However, I wanted to post here, in case anyone has any ideas as well as to how to handle this in PyRoot or comes across this in the future. I’m attaching the .py version of the .C macro I use to demonstrate the problem. The issue exists in both the PyRoot and CINT implementations.

I’d come across an odd issue in my RooFit scripts which I run using PyRoot. However, upon simplifying them and going back to the C implementation, I find that the behavior is independent.

I modified one of the tutorials and attached it here as rf203_ranges_modified_for_multiple_fits.py. My issue is that I am trying to run many toy MC studies by hand (I know there are ways to do this automatically, but I want to have some finer control over the fits). I modified the script to basically generate and run 100 different datasets/fits.

If I do not use a defined fit range, the fits run OK.

If I do use a defined fit range, I get a seg fault after the 27th iteration.

    # Define "signal" range in x as [-3,3]
    #####################################################################
    # Trying to explicitly give a different name to each fitting range!
    #####################################################################
    fitrange_name = "signal_%d" % (n)
    x.setRange(fitrange_name,-3,3)

    # Fit p.d.f only to data in "signal" range
    r_sig = model.fitTo(modelData,RooFit.Save(kTRUE),RooFit.Range(fitrange_name),RooFit.PrintLevel(-1)) # RooFitResult
    #r_sig = model.fitTo(modelData,RooFit.Save(kTRUE),RooFit.PrintLevel(-1)) # RooFitResult

Here’s the part which destroyed a nights sleep…this problem only happens if I run on our (SLAC’s) batch farm but not on my laptop.

Both have the latest version of ROOT (I built them by hand).

My laptop is 32 bit and the batch farm is 64. Other things are running fine on the farm.

However, the farm is using a 5.18 kernel and I’m using a 5.26 kernel on my laptop. This seems to be the only discernible difference.

I’ve tried explicitly naming RooFit objects and deleting them, thinking it was some sort of namespace/mangling issue? I know around kernel 5.2X-something there was a change that allowed for far more characters to be passed in on the command line, so I thought it was some other similar memory space issue? I don’t know…this is a bit over my head at this point.

I don’t think I can convince our computer center to build the latest kernel for the whole farm.

Is there any other fix you can suggest to get this swinging? Thanks in advance.

Matt
rf203_ranges_modified_for_multiple_fits.py (2.04 KB)

Typo in the above:

Laptop (where things work): kernel 2.6.32

Batch farm (where things break): kernel 2.6.18.

Oops. I was mentally confusing ROOT releases and kernels. Everything else is correct in the above post.

Matt