17dt = ROOT.RooRealVar(
"dt",
"dt", -10, 10)
18dterr = ROOT.RooRealVar(
"dterr",
"per-event error on dt", 0.01, 10)
22bias = ROOT.RooRealVar(
"bias",
"bias", 0, -10, 10)
23sigma = ROOT.RooRealVar(
"sigma",
"per-event error scale factor", 1, 0.1, 10)
24gm = ROOT.RooGaussModel(
"gm1",
"gauss model scaled bt per-event error", dt, bias, sigma, dterr)
27tau = ROOT.RooRealVar(
"tau",
"tau", 1.548)
28decay_gm = ROOT.RooDecay(
"decay_gm",
"decay", dt, tau, gm, type=
"DoubleSided")
34pdfDtErr = ROOT.RooLandau(
"pdfDtErr",
"pdfDtErr", dterr, 1.0, 0.25)
35expDataDterr = pdfDtErr.generate({dterr}, 10000)
38expHistDterr = expDataDterr.binnedClone()
39pdfErr = ROOT.RooHistPdf(
"pdfErr",
"pdfErr", {dterr}, expHistDterr)
46model = ROOT.RooProdPdf(
"model",
"model", {pdfErr}, Conditional=({decay_gm}, {dt}))
57data = model.generate({dt, dterr}, 10000)
63model.fitTo(data, PrintLevel=-1)
69hh_model = model.createHistogram(
"hh_model", dt, Binning=50, YVar=dict(var=dterr, Binning=50))
70hh_model.SetLineColor(ROOT.kBlue)
73frame = dt.frame(Title=
"Projection of model(dt|dterr) on dt")
78c = ROOT.TCanvas(
"rf307_fullpereventerrors",
"rf307_fullpereventerrors", 800, 400)
81ROOT.gPad.SetLeftMargin(0.20)
82hh_model.GetZaxis().SetTitleOffset(2.5)
85ROOT.gPad.SetLeftMargin(0.15)
86frame.GetYaxis().SetTitleOffset(1.6)
89c.SaveAs(
"rf307_fullpereventerrors.png")