Indeed, it’s a bug in the RooFormula that behaves wrongly if one of the variable has just an integer as a name, like RooConst(0.0) whose name is simply “0”. That’s why it works when you give your zero constant a different name, like “dm1” which you tried later where you didn’t hit the bug. So as you noticed, the workaround is easy
I have created a PR to fix the bug:
It will be fixed in the next patch release.
Thanks again for reporting and have a nice evening!
Jonas