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(
24 "sigma",
"per-event error scale factor", 1, 0.1, 10)
25gm = ROOT.RooGaussModel(
26 "gm1",
"gauss model scaled bt per-event error", dt, bias, sigma, dterr)
29tau = ROOT.RooRealVar(
"tau",
"tau", 1.548)
30decay_gm = ROOT.RooDecay(
"decay_gm",
"decay", dt,
31 tau, gm, ROOT.RooDecay.DoubleSided)
37pdfDtErr = ROOT.RooLandau(
"pdfDtErr",
"pdfDtErr", dterr, ROOT.RooFit.RooConst(
38 1), ROOT.RooFit.RooConst(0.25))
39expDataDterr = pdfDtErr.generate(ROOT.RooArgSet(dterr), 10000)
42expHistDterr = expDataDterr.binnedClone()
43pdfErr = ROOT.RooHistPdf(
44 "pdfErr",
"pdfErr", ROOT.RooArgSet(dterr), expHistDterr)
51model = ROOT.RooProdPdf(
54 ROOT.RooArgSet(pdfErr),
55 ROOT.RooFit.Conditional(
56 ROOT.RooArgSet(decay_gm),
68data = model.generate(ROOT.RooArgSet(dt, dterr), 10000)
80hh_model = model.createHistogram(
"hh_model", dt, ROOT.RooFit.Binning(
81 50), ROOT.RooFit.YVar(dterr, ROOT.RooFit.Binning(50)))
82hh_model.SetLineColor(ROOT.kBlue)
85frame = dt.frame(ROOT.RooFit.Title(
"Projection of model(dt|dterr) on dt"))
90c = ROOT.TCanvas(
"rf307_fullpereventerrors",
91 "rf307_fullpereventerrors", 800, 400)
94ROOT.gPad.SetLeftMargin(0.20)
95hh_model.GetZaxis().SetTitleOffset(2.5)
98ROOT.gPad.SetLeftMargin(0.15)
99frame.GetYaxis().SetTitleOffset(1.6)
102c.SaveAs(
"rf307_fullpereventerrors.png")