18w1 = ROOT.RooWorkspace(
"w")
19w1.factory(
"Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0,300]))")
20w1.factory(
"Poisson::py(y[100,0,500],prod::taub(tau[1.],b))")
21w1.factory(
"Uniform::prior_b(b)")
25w1.factory(
"PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)")
30frame = w1[
"x"].frame()
31w1[
"averagedModel"].plotOn(frame)
32w1[
"px"].plotOn(frame, LineColor=ROOT.kRed)
42cdf = w1[
"averagedModel"].createCdf(w1[
"x"])
45print(
"Hybrid p-value = ", cdf.getVal())
46print(
"Z_Gamma Significance = ", ROOT.RooStats.PValueToSignificance(1 - cdf.getVal()))
49Z_Bi = ROOT.RooStats.NumberCountingUtils.BinomialWithTauObsZ(150, 100, 1)
50print(
"Z_Bi significance estimation: ", Z_Bi)
52c.SaveAs(
"Zbi_Zgamma.png")