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.0, 1.0)
26poly = ROOT.RooPolynomial(
"p",
"p", x, [p0])
29f = ROOT.RooRealVar(
"f",
"f", 0.5, 0.0, 1.0)
30model = ROOT.RooAddPdf(
"model",
"model", [gauss, poly], [f])
36c = ROOT.RooCategory(
"c",
"c")
40d = ROOT.RooCategory(
"d",
"d")
48w = ROOT.RooWorkspace(
"w",
"w")
49w.Import({model, c, d})
52sct = ROOT.RooSimWSTool(w)
65model_sim = sct.build(
"model_sim",
"model", SplitParam=(
"m",
"c"))
71w.var(
"m_run1").setVal(-3)
72w.var(
"m_run2").setVal(+3)
81model_sim2 = sct.build(
"model_sim2",
"model", SplitParam=(
"p0",
"c,d"))