22x = ROOT.RooRealVar(
"x",
"x", -10, 10)
23y = ROOT.RooRealVar(
"y",
"y", -10, 10)
26mx = ROOT.RooRealVar(
"mx",
"mx", 1, -10, 10)
27my = ROOT.RooRealVar(
"my",
"my", 1, -10, 10)
29gx = ROOT.RooGaussian(
"gx",
"gx", x, mx, ROOT.RooFit.RooConst(1))
30gy = ROOT.RooGaussian(
"gy",
"gy", y, my, ROOT.RooFit.RooConst(1))
32sig = ROOT.RooProdPdf(
"sig",
"sig", gx, gy)
35px = ROOT.RooPolynomial(
"px",
"px", x)
36py = ROOT.RooPolynomial(
"py",
"py", y)
37bkg = ROOT.RooProdPdf(
"bkg",
"bkg", px, py)
40f = ROOT.RooRealVar(
"f",
"f", 0., 1.)
41model = ROOT.RooAddPdf(
"model",
"model", ROOT.RooArgList(sig, bkg), ROOT.RooArgList(f))
44modelData = model.generate(ROOT.RooArgSet(x, y), 10000)
65x.setRange(
"SB1", -10, +10)
66y.setRange(
"SB1", -10, 0)
68x.setRange(
"SB2", -10, 0)
69y.setRange(
"SB2", 0, +10)
71x.setRange(
"SIG", 0, +10)
72y.setRange(
"SIG", 0, +10)
74x.setRange(
"FULL", -10, +10)
75y.setRange(
"FULL", -10, +10)
82r_sb1 = model.fitTo(modelData, ROOT.RooFit.Range(
83 "SB1"), ROOT.RooFit.Save())
87r_sb2 = model.fitTo(modelData, ROOT.RooFit.Range(
88 "SB2"), ROOT.RooFit.Save())
95r_sb12 = model.fitTo(modelData, ROOT.RooFit.Range(
96 "SB1,SB2"), ROOT.RooFit.Save())