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(
"eff",
"0.5*(TMath::Erf((t-1)/0.5)+1)", [t])
34modelEff = ROOT.RooEffProd(
"modelEff",
"model with efficiency", model, eff)
39frame1 = t.frame(Title=
"Efficiency")
40eff.plotOn(frame1, LineColor=
"r")
42frame2 = t.frame(Title=
"Pdf with and without efficiency")
44model.plotOn(frame2, LineStyle=
"--")
45modelEff.plotOn(frame2)
52data = modelEff.generate({t}, 10000)
58frame3 = t.frame(Title=
"Fitted pdf with efficiency")
60modelEff.plotOn(frame3)
62c = ROOT.TCanvas(
"rf703_effpdfprod",
"rf703_effpdfprod", 1200, 400)
65ROOT.gPad.SetLeftMargin(0.15)
66frame1.GetYaxis().SetTitleOffset(1.4)
69ROOT.gPad.SetLeftMargin(0.15)
70frame2.GetYaxis().SetTitleOffset(1.6)
73ROOT.gPad.SetLeftMargin(0.15)
74frame3.GetYaxis().SetTitleOffset(1.6)
77c.SaveAs(
"rf703_effpdfprod.png")