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)
47data = decay_gm.generate(ROOT.RooArgSet(
48 dt), ROOT.RooFit.ProtoData(expDataDterr))
54decay_gm.fitTo(data, ROOT.RooFit.ConditionalObservables(
55 ROOT.RooArgSet(dterr)))
61hh_decay = decay_gm.createHistogram(
"hh_decay", dt, ROOT.RooFit.Binning(
62 50), ROOT.RooFit.YVar(dterr, ROOT.RooFit.Binning(50)))
63hh_decay.SetLineColor(ROOT.kBlue)
66frame = dt.frame(ROOT.RooFit.Title(
67 "Slices of decay(dt|dterr) at various dterr"))
68for ibin
in range(0, 100, 20):
70 decay_gm.plotOn(frame, ROOT.RooFit.Normalization(5.))
73frame2 = dt.frame(ROOT.RooFit.Title(
"Projection of decay(dt|dterr) on dt"))
81decay_gm.plotOn(frame2, ROOT.RooFit.ProjWData(expDataDterr, ROOT.kTRUE))
84c = ROOT.TCanvas(
"rf306_condpereventerrors",
85 "rf306_condperventerrors", 1200, 400)
88ROOT.gPad.SetLeftMargin(0.20)
89hh_decay.GetZaxis().SetTitleOffset(2.5)
92ROOT.gPad.SetLeftMargin(0.15)
93frame.GetYaxis().SetTitleOffset(1.6)
96ROOT.gPad.SetLeftMargin(0.15)
97frame2.GetYaxis().SetTitleOffset(1.6)
100c.SaveAs(
"rf306_condpereventerrors.png")