19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
20m = ROOT.RooRealVar(
"m",
"m", 0, -10, 10)
21s = ROOT.RooRealVar(
"s",
"s", 1, -10, 10)
22gauss = ROOT.RooGaussian(
"g",
"g", x, m, s)
25p0 = ROOT.RooRealVar(
"p0",
"p0", 0.01, 0., 1.)
26poly = ROOT.RooPolynomial(
"p",
"p", x, ROOT.RooArgList(p0))
29f = ROOT.RooRealVar(
"f",
"f", 0.5, 0., 1.)
30model = ROOT.RooAddPdf(
"model",
"model", ROOT.RooArgList(
31 gauss, poly), ROOT.RooArgList(f))
37c = ROOT.RooCategory(
"c",
"c")
41d = ROOT.RooCategory(
"d",
"d")
49w = ROOT.RooWorkspace(
"w",
"w")
50getattr(w,
'import')(ROOT.RooArgSet(model, c, d))
53sct = ROOT.RooSimWSTool(w)
66model_sim = sct.build(
"model_sim",
"model",
67 ROOT.RooFit.SplitParam(
"m",
"c"))
73w.var(
"m_run1").setVal(-3)
74w.var(
"m_run2").setVal(+3)
83model_sim2 = sct.build(
"model_sim2",
"model",
84 ROOT.RooFit.SplitParam(
"p0",
"c,d"))