19x = ROOT.RooRealVar(
"x",
"x", -5, 5)
20y = ROOT.RooRealVar(
"y",
"y", -5, 5)
21z = ROOT.RooRealVar(
"z",
"z", -5, 5)
25 "gx",
"gx", x, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(1))
27 "gy",
"gy", y, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(1))
29 "gz",
"gz", z, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(1))
30sig = ROOT.RooProdPdf(
"sig",
"sig", ROOT.RooArgList(gx, gy, gz))
33px = ROOT.RooPolynomial(
"px",
"px", x, ROOT.RooArgList(
34 ROOT.RooFit.RooConst(-0.1), ROOT.RooFit.RooConst(0.004)))
35py = ROOT.RooPolynomial(
"py",
"py", y, ROOT.RooArgList(
36 ROOT.RooFit.RooConst(0.1), ROOT.RooFit.RooConst(-0.004)))
37pz = ROOT.RooPolynomial(
"pz",
"pz", z)
38bkg = ROOT.RooProdPdf(
"bkg",
"bkg", ROOT.RooArgList(px, py, pz))
41fsig = ROOT.RooRealVar(
"fsig",
"signal fraction", 0.1, 0., 1.)
42model = ROOT.RooAddPdf(
"model",
"model", ROOT.RooArgList(
43 sig, bkg), ROOT.RooArgList(fsig))
46data = model.generate(ROOT.RooArgSet(x, y, z), 200000)
56model.fitTo(data, ROOT.RooFit.NumCPU(4), ROOT.RooFit.Timer(ROOT.kTRUE))
63sigyz = sig.createProjection(ROOT.RooArgSet(x))
64totyz = model.createProjection(ROOT.RooArgSet(x))
65llratio_func = ROOT.RooFormulaVar(
66 "llratio",
"log10(@0)-log10(@1)", ROOT.RooArgList(sigyz, totyz))
70data.addColumn(llratio_func)
71dataSel = data.reduce(ROOT.RooFit.Cut(
"llratio>0.7"))
74frame = x.frame(ROOT.RooFit.Title(
75 "Projection on X with LLratio(y,z)>0.7"), ROOT.RooFit.Bins(40))
85model.plotOn(frame, ROOT.RooFit.ProjWData(dataSel), ROOT.RooFit.NumCPU(4))
87c = ROOT.TCanvas(
"rf603_multicpu",
"rf603_multicpu", 600, 600)
88ROOT.gPad.SetLeftMargin(0.15)
89frame.GetYaxis().SetTitleOffset(1.6)
92c.SaveAs(
"rf603_multicpu.png")