20x = ROOT.RooRealVar(
"x",
"x", -5, 5)
21y = ROOT.RooRealVar(
"y",
"y", -5, 5)
22z = ROOT.RooRealVar(
"z",
"z", -5, 5)
25gx = ROOT.RooGaussian(
"gx",
"gx", x, 0.0, 1.0)
26gy = ROOT.RooGaussian(
"gy",
"gy", y, 0.0, 1.0)
27gz = ROOT.RooGaussian(
"gz",
"gz", z, 0.0, 1.0)
28sig = ROOT.RooProdPdf(
"sig",
"sig", [gx, gy, gz])
31px = ROOT.RooPolynomial(
"px",
"px", x, [-0.1, 0.004])
32py = ROOT.RooPolynomial(
"py",
"py", y, [0.1, -0.004])
33pz = ROOT.RooPolynomial(
"pz",
"pz", z)
34bkg = ROOT.RooProdPdf(
"bkg",
"bkg", [px, py, pz])
37fsig = ROOT.RooRealVar(
"fsig",
"signal fraction", 0.1, 0.0, 1.0)
38model = ROOT.RooAddPdf(
"model",
"model", [sig, bkg], [fsig])
41data = model.generate({x, y, z}, 200000)
51model.fitTo(data, NumCPU=4, Timer=
True, PrintLevel=-1)
58sigyz = sig.createProjection({x})
59totyz = model.createProjection({x})
60llratio_func = ROOT.RooFormulaVar(
"llratio",
"log10(@0)-log10(@1)", [sigyz, totyz])
64data.addColumn(llratio_func)
65dataSel = data.reduce(Cut=
"llratio>0.7")
68frame = x.frame(Title=
"Projection on X with LLratio(y,z)>0.7", Bins=40)
78model.plotOn(frame, ProjWData=dataSel, NumCPU=4)
80c = ROOT.TCanvas(
"rf603_multicpu",
"rf603_multicpu", 600, 600)
81ROOT.gPad.SetLeftMargin(0.15)
82frame.GetYaxis().SetTitleOffset(1.6)
85c.SaveAs(
"rf603_multicpu.png")