19t = ROOT.RooRealVar(
"t",
"t", 0, 5)
22tau = ROOT.RooRealVar(
"tau",
"tau", -1.54, -4, -0.1)
23model = ROOT.RooExponential(
"model",
"model", t, tau)
29eff = ROOT.RooFormulaVar(
31 "0.5*(TMath::Erf((t-1)/0.5)+1)",
38modelEff = ROOT.RooEffProd(
"modelEff",
"model with efficiency", model, eff)
43frame1 = t.frame(ROOT.RooFit.Title(
"Efficiency"))
44eff.plotOn(frame1, ROOT.RooFit.LineColor(ROOT.kRed))
46frame2 = t.frame(ROOT.RooFit.Title(
"Pdf with and without efficiency"))
48model.plotOn(frame2, ROOT.RooFit.LineStyle(ROOT.kDashed))
49modelEff.plotOn(frame2)
56data = modelEff.generate(ROOT.RooArgSet(t), 10000)
62frame3 = t.frame(ROOT.RooFit.Title(
"Fitted pdf with efficiency"))
64modelEff.plotOn(frame3)
66c = ROOT.TCanvas(
"rf703_effpdfprod",
"rf703_effpdfprod", 1200, 400)
69ROOT.gPad.SetLeftMargin(0.15)
70frame1.GetYaxis().SetTitleOffset(1.4)
73ROOT.gPad.SetLeftMargin(0.15)
74frame2.GetYaxis().SetTitleOffset(1.6)
77ROOT.gPad.SetLeftMargin(0.15)
78frame3.GetYaxis().SetTitleOffset(1.6)
81c.SaveAs(
"rf703_effpdfprod.png")