18dt = ROOT.RooRealVar(
"dt",
"dt", -10, 10)
19dterr = ROOT.RooRealVar(
"dterr",
"per-event error on dt", 0.01, 10)
23bias = ROOT.RooRealVar(
"bias",
"bias", 0, -10, 10)
24sigma = ROOT.RooRealVar(
25 "sigma",
"per-event error scale factor", 1, 0.1, 10)
26gm = ROOT.RooGaussModel(
27 "gm1",
"gauss model scaled bt per-event error", dt, bias, sigma, dterr)
30tau = ROOT.RooRealVar(
"tau",
"tau", 1.548)
31decay_gm = ROOT.RooDecay(
"decay_gm",
"decay", dt,
32 tau, gm, ROOT.RooDecay.DoubleSided)
38pdfDtErr = ROOT.RooLandau(
"pdfDtErr",
"pdfDtErr", dterr, ROOT.RooFit.RooConst(
39 1), ROOT.RooFit.RooConst(0.25))
40expDataDterr = pdfDtErr.generate(ROOT.RooArgSet(dterr), 10000)
43expHistDterr = expDataDterr.binnedClone()
44pdfErr = ROOT.RooHistPdf(
45 "pdfErr",
"pdfErr", ROOT.RooArgSet(dterr), expHistDterr)
52model = ROOT.RooProdPdf(
55 ROOT.RooArgSet(pdfErr),
56 ROOT.RooFit.Conditional(
57 ROOT.RooArgSet(decay_gm),
69data = model.generate(ROOT.RooArgSet(dt, dterr), 10000)
81hh_model = model.createHistogram(
"hh_model", dt, ROOT.RooFit.Binning(
82 50), ROOT.RooFit.YVar(dterr, ROOT.RooFit.Binning(50)))
83hh_model.SetLineColor(ROOT.kBlue)
86frame = dt.frame(ROOT.RooFit.Title(
"Projection of model(dt|dterr) on dt"))
91c = ROOT.TCanvas(
"rf307_fullpereventerrors",
92 "rf307_fullpereventerrors", 800, 400)
95ROOT.gPad.SetLeftMargin(0.20)
96hh_model.GetZaxis().SetTitleOffset(2.5)
99ROOT.gPad.SetLeftMargin(0.15)
100frame.GetYaxis().SetTitleOffset(1.6)
103c.SaveAs(
"rf307_fullpereventerrors.png")