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, ROOT.RooFit.RooConst(1))
27gy = ROOT.RooGaussian(
"gy",
"gy", y, my, ROOT.RooFit.RooConst(1))
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., 1.)
38model = ROOT.RooAddPdf(
39 "model",
"model", ROOT.RooArgList(
40 sig, bkg), ROOT.RooArgList(f))
43modelData = model.generate(ROOT.RooArgSet(x, y), 10000)
64x.setRange(
"SB1", -10, +10)
65y.setRange(
"SB1", -10, 0)
67x.setRange(
"SB2", -10, 0)
68y.setRange(
"SB2", 0, +10)
70x.setRange(
"SIG", 0, +10)
71y.setRange(
"SIG", 0, +10)
73x.setRange(
"FULL", -10, +10)
74y.setRange(
"FULL", -10, +10)
81r_sb1 = model.fitTo(modelData, ROOT.RooFit.Range(
82 "SB1"), ROOT.RooFit.Save())
86r_sb2 = model.fitTo(modelData, ROOT.RooFit.Range(
87 "SB2"), ROOT.RooFit.Save())
94r_sb12 = model.fitTo(modelData, ROOT.RooFit.Range(
95 "SB1,SB2"), ROOT.RooFit.Save())