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, ROOT.RooFit.RooConst(1), ROOT.RooFit.RooConst(0.25))
35expDataDterr = pdfDtErr.generate({dterr}, 10000)
42data = decay_gm.generate({dt}, ProtoData=expDataDterr)
48decay_gm.fitTo(data, ConditionalObservables={dterr})
54hh_decay = decay_gm.createHistogram(
"hh_decay", dt, Binning=50, YVar=dict(var=dterr, Binning=50))
55hh_decay.SetLineColor(ROOT.kBlue)
58frame = dt.frame(Title=
"Slices of decay(dt|dterr) at various dterr")
59for ibin
in range(0, 100, 20):
61 decay_gm.plotOn(frame, Normalization=5.0)
64frame2 = dt.frame(Title=
"Projection of decay(dt|dterr) on dt")
72decay_gm.plotOn(frame2, ProjWData=(expDataDterr,
True))
75c = ROOT.TCanvas(
"rf306_condpereventerrors",
"rf306_condperventerrors", 1200, 400)
78ROOT.gPad.SetLeftMargin(0.20)
79hh_decay.GetZaxis().SetTitleOffset(2.5)
82ROOT.gPad.SetLeftMargin(0.15)
83frame.GetYaxis().SetTitleOffset(1.6)
86ROOT.gPad.SetLeftMargin(0.15)
87frame2.GetYaxis().SetTitleOffset(1.6)
90c.SaveAs(
"rf306_condpereventerrors.png")