18x = ROOT.RooRealVar(
"x",
"x", -10, 10)
19y = ROOT.RooRealVar(
"y",
"y", -10, 10)
22mx = ROOT.RooRealVar(
"mx",
"mx", 1, -10, 10)
23my = ROOT.RooRealVar(
"my",
"my", 1, -10, 10)
25gx = ROOT.RooGaussian(
"gx",
"gx", x, mx, ROOT.RooFit.RooConst(1))
26gy = ROOT.RooGaussian(
"gy",
"gy", y, my, ROOT.RooFit.RooConst(1))
28sig = ROOT.RooProdPdf(
"sig",
"sig", gx, gy)
31px = ROOT.RooPolynomial(
"px",
"px", x)
32py = ROOT.RooPolynomial(
"py",
"py", y)
33bkg = ROOT.RooProdPdf(
"bkg",
"bkg", px, py)
36f = ROOT.RooRealVar(
"f",
"f", 0.0, 1.0)
37model = ROOT.RooAddPdf(
"model",
"model", [sig, bkg], [f])
40modelData = model.generate({x, y}, 10000)
61x.setRange(
"SB1", -10, +10)
62y.setRange(
"SB1", -10, 0)
64x.setRange(
"SB2", -10, 0)
65y.setRange(
"SB2", 0, +10)
67x.setRange(
"SIG", 0, +10)
68y.setRange(
"SIG", 0, +10)
70x.setRange(
"FULL", -10, +10)
71y.setRange(
"FULL", -10, +10)
78r_sb1 = model.fitTo(modelData, Range=
"SB1", Save=
True)
82r_sb2 = model.fitTo(modelData, Range=
"SB2", Save=
True)
89r_sb12 = model.fitTo(modelData, Range=
"SB1,SB2", Save=
True)