# RooDecay getVal() normalization problem

Dear experts,

I found a problem about RooDecay getVal().
I have two observables tz and tzErr. The resolution model is the sum of two Gauss models and their widths are proportional to the tzErr.
I thought getVal(ROOT.RooArgSet(tz, tzErr)) and getVal(ROOT.RooArgSet(tz)) should return different values, but it doesn’t work.
Here is the code:

``````import ROOT
tz = ROOT.RooRealVar("tz", "tz", -5, 5)
tzErr = ROOT.RooRealVar("tzErr", "tzErr", 0.5, 1.0)
zero = ROOT.RooRealVar("zero", "zero", 0)
one = ROOT.RooRealVar("one", "one", 1)
sigma1 = ROOT.RooRealVar("sigma1", "sigma1", 0.5)
sigma2 = ROOT.RooRealVar("sigma2", "sigma2", 1.0)
beta = ROOT.RooRealVar("beta", "beta", 0.6)
res1 = ROOT.RooGaussModel("res1", "res1", tz, zero, sigma1, one, tzErr)
res2 = ROOT.RooGaussModel("res2", "res2", tz, zero, sigma2, one, tzErr)
res = ROOT.RooAddModel("res", "res", ROOT.RooArgList(res1, res2), ROOT.RooArgList(beta))
tz.setVal(0.0)
tzErr.setVal(0.8)
decay = ROOT.RooDecay("decay", "decay", tz, zero, res, ROOT.RooDecay.DoubleSided)
print("Norm[tz]", decay.getVal(ROOT.RooArgSet(tz)))
print("Norm[tz, tzErr]", decay.getVal(ROOT.RooArgSet(tz, tzErr)))
decay2 = ROOT.RooDecay("decay2", "decay2", tz, zero, res, ROOT.RooDecay.DoubleSided)
print("Norm[tz, tzErr]", decay2.getVal(ROOT.RooArgSet(tz, tzErr)))
print("Norm[tz]", decay2.getVal(ROOT.RooArgSet(tz)))``````

The printed results are:

(‘Norm[tz]’, 0.7978845609338628)
(‘Norm[tz, tzErr]’, 0.7978845609338628)

(‘Norm[tz, tzErr]’, 1.5957691471135516)
(‘Norm[tz]’, 1.5957691471135516)

The second call of getVal() function returns the same value as that in the first call.
Is this a bug or some feature that I did not understand?

The ROOT version is 6.24/00.

Best regards,
Li

Hi xu_li!

This is a bug, thanks for reporting. It will be fixed with this PR:

It will land in the upcoming ROOT version 6.28.

I’m afraid the fix is too fundamental to backport to ROOT 6.24 which you are using. Would it be fine if this fix goes also int 6.26.02, the next upcoming patch release, and then you migrate to that version?

Cheers,
Jonas

PS: you should always use the most recent patch release of a given ROOT release branch. For 6.26, this is 6.24/06. Better not to use 6.24/00 anymore.

Hi Jonas,

Thanks a lot for your reply and helpful suggestion. It is fine for me to migrate to another version.

Best regards,
Li

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