19dt = ROOT.RooRealVar(
"dt",
"dt", -10, 10)
20dterr = ROOT.RooRealVar(
"dterr",
"per-event error on dt", 0.01, 10)
24bias = ROOT.RooRealVar(
"bias",
"bias", 0, -10, 10)
25sigma = ROOT.RooRealVar(
"sigma",
"per-event error scale factor", 1, 0.1, 10)
26gm = ROOT.RooGaussModel(
"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, tau, gm, type=
"DoubleSided")
36pdfDtErr = ROOT.RooLandau(
"pdfDtErr",
"pdfDtErr", dterr, 1.0, 0.25)
37expDataDterr = pdfDtErr.generate({dterr}, 10000)
44data = decay_gm.generate({dt}, ProtoData=expDataDterr)
50decay_gm.fitTo(data, ConditionalObservables={dterr}, PrintLevel=-1)
56hh_decay = decay_gm.createHistogram(
"hh_decay", dt, Binning=50, YVar=dict(var=dterr, Binning=50))
57hh_decay.SetLineColor(ROOT.kBlue)
60frame = dt.frame(Title=
"Slices of decay(dt|dterr) at various dterr")
61for ibin
in range(0, 100, 20):
63 decay_gm.plotOn(frame, Normalization=5.0)
66frame2 = dt.frame(Title=
"Projection of decay(dt|dterr) on dt")
74decay_gm.plotOn(frame2, ProjWData=(expDataDterr,
True))
77c = ROOT.TCanvas(
"rf306_condpereventerrors",
"rf306_condperventerrors", 1200, 400)
80ROOT.gPad.SetLeftMargin(0.20)
81hh_decay.GetZaxis().SetTitleOffset(2.5)
84ROOT.gPad.SetLeftMargin(0.15)
85frame.GetYaxis().SetTitleOffset(1.6)
88ROOT.gPad.SetLeftMargin(0.15)
89frame2.GetYaxis().SetTitleOffset(1.6)
92c.SaveAs(
"rf306_condpereventerrors.png")