18t = ROOT.RooRealVar(
"t",
"t", 0, 5)
21tau = ROOT.RooRealVar(
"tau",
"tau", -1.54, -4, -0.1)
22model = ROOT.RooExponential(
"model",
"model", t, tau)
28eff = ROOT.RooFormulaVar(
30 "0.5*(TMath::Erf((t-1)/0.5)+1)",
37modelEff = ROOT.RooEffProd(
"modelEff",
"model with efficiency", model, eff)
42frame1 = t.frame(ROOT.RooFit.Title(
"Efficiency"))
43eff.plotOn(frame1, ROOT.RooFit.LineColor(ROOT.kRed))
45frame2 = t.frame(ROOT.RooFit.Title(
"Pdf with and without efficiency"))
47model.plotOn(frame2, ROOT.RooFit.LineStyle(ROOT.kDashed))
48modelEff.plotOn(frame2)
55data = modelEff.generate(ROOT.RooArgSet(t), 10000)
61frame3 = t.frame(ROOT.RooFit.Title(
"Fitted pdf with efficiency"))
63modelEff.plotOn(frame3)
65c = ROOT.TCanvas(
"rf703_effpdfprod",
"rf703_effpdfprod", 1200, 400)
68ROOT.gPad.SetLeftMargin(0.15)
69frame1.GetYaxis().SetTitleOffset(1.4)
72ROOT.gPad.SetLeftMargin(0.15)
73frame2.GetYaxis().SetTitleOffset(1.6)
76ROOT.gPad.SetLeftMargin(0.15)
77frame3.GetYaxis().SetTitleOffset(1.6)
80c.SaveAs(
"rf703_effpdfprod.png")