fitTo in Range

Hello,

I would like to fit a spectrum in different ranges. I defined 3 ranges A, B and C which are (almost) exclusive and the union of the three is the full range. If I just fit the spectrum with pdf->fitTo(*data), the fit is OK.
If I do fitTo(*data,Range(“A,B,C”)), the fit fails (migrad status = 4). Attached to the post are the files needed to reproduce my problem (a root file containing a RooWorkspace, the macro and two files for a Pdf definition).
I am using Root v5.34.01 and just do root.exe nll4r.C

What is wrong in my example ?

Thanks,

Jean-Baptiste.
RooBernsteinM.cxx (5.93 KB)
RooBernsteinM.h (1.86 KB)
nll4r.C (646 Bytes)
ws.root (176 KB)