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