20x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21m = ROOT.RooRealVar(
"m",
"m", 0, -10, 10)
22s = ROOT.RooRealVar(
"s",
"s", 1, -10, 10)
23gauss = ROOT.RooGaussian(
"g",
"g", x, m, s)
26p0 = ROOT.RooRealVar(
"p0",
"p0", 0.01, 0.0, 1.0)
27poly = ROOT.RooPolynomial(
"p",
"p", x, [p0])
30f = ROOT.RooRealVar(
"f",
"f", 0.5, 0.0, 1.0)
31model = ROOT.RooAddPdf(
"model",
"model", [gauss, poly], [f])
37c = ROOT.RooCategory(
"c",
"c")
41d = ROOT.RooCategory(
"d",
"d")
49w = ROOT.RooWorkspace(
"w",
"w")
50w.Import({model, c, d})
53sct = ROOT.RooSimWSTool(w)
66model_sim = sct.build(
"model_sim",
"model", SplitParam=(
"m",
"c"))
72w.var(
"m_run1").setVal(-3)
73w.var(
"m_run2").setVal(+3)
82model_sim2 = sct.build(
"model_sim2",
"model", SplitParam=(
"p0",
"c,d"))