19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
20y = ROOT.RooRealVar(
"y",
"y", -10, 10)
23mx = ROOT.RooRealVar(
"mx",
"mx", 1, -10, 10)
24my = ROOT.RooRealVar(
"my",
"my", 1, -10, 10)
26gx = ROOT.RooGaussian(
"gx",
"gx", x, mx, 1.0)
27gy = ROOT.RooGaussian(
"gy",
"gy", y, my, 1.0)
29sig = ROOT.RooProdPdf(
"sig",
"sig", gx, gy)
32px = ROOT.RooPolynomial(
"px",
"px", x)
33py = ROOT.RooPolynomial(
"py",
"py", y)
34bkg = ROOT.RooProdPdf(
"bkg",
"bkg", px, py)
37f = ROOT.RooRealVar(
"f",
"f", 0.0, 1.0)
38model = ROOT.RooAddPdf(
"model",
"model", [sig, bkg], [f])
41modelData = model.generate({x, y}, 10000)
62x.setRange(
"SB1", -10, +10)
63y.setRange(
"SB1", -10, 0)
65x.setRange(
"SB2", -10, 0)
66y.setRange(
"SB2", 0, +10)
68x.setRange(
"SIG", 0, +10)
69y.setRange(
"SIG", 0, +10)
71x.setRange(
"FULL", -10, +10)
72y.setRange(
"FULL", -10, +10)
79r_sb1 = model.fitTo(modelData, Range=
"SB1", Save=
True, PrintLevel=-1)
83r_sb2 = model.fitTo(modelData, Range=
"SB2", Save=
True, PrintLevel=-1)
90r_sb12 = model.fitTo(modelData, Range=
"SB1,SB2", Save=
True, PrintLevel=-1)