19x = ROOT.RooRealVar(
"x",
"x", 0, 10)
23mean = ROOT.RooRealVar(
"mean",
"mean of gaussians", 5)
24sigma = ROOT.RooRealVar(
"sigma",
"width of gaussians", 0.5)
25sig = ROOT.RooGaussian(
"sig",
"Signal component 1", x, mean, sigma)
28a0 = ROOT.RooRealVar(
"a0",
"a0", 0.5, 0.0, 1.0)
29a1 = ROOT.RooRealVar(
"a1",
"a1", 0.2, 0.0, 1.0)
30bkg1 = ROOT.RooChebychev(
"bkg1",
"Background 1", x, [a0, a1])
33alpha = ROOT.RooRealVar(
"alpha",
"alpha", -1)
34bkg2 = ROOT.RooExponential(
"bkg2",
"Background 2", x, alpha)
37bkg1frac = ROOT.RooRealVar(
"bkg1frac",
"fraction of component 1 in background", 0.2, 0.0, 1.0)
38bkg = ROOT.RooAddPdf(
"bkg",
"Signal", [bkg1, bkg2], [bkg1frac])
41bkgfrac = ROOT.RooRealVar(
"bkgfrac",
"fraction of background", 0.5, 0.0, 1.0)
42model = ROOT.RooAddPdf(
"model",
"g1+g2+a", [bkg, sig], [bkgfrac])
45y = ROOT.RooRealVar(
"y",
"y", -10, 10)
46data = ROOT.RooDataSet(
"data",
"data", {x, y})
61model_obs = model.getObservables(data)
68model_params = model.getParameters({x})
69model_params.Print(
"v")
73model_params2 = model.getParameters(data)
80model_comps = model.getComponents()
87sigma2 = ROOT.RooRealVar(
"sigma2",
"width of gaussians", 1)
88sig2 = ROOT.RooGaussian(
"sig2",
"Signal component 1", x, mean, sigma2)
91sig1frac = ROOT.RooRealVar(
"sig1frac",
"fraction of component 1 in signal", 0.8, 0.0, 1.0)
92sigsum = ROOT.RooAddPdf(
"sigsum",
"sig+sig2", [sig, sig2], [sig1frac])
95cust = ROOT.RooCustomizer(model,
"cust")
98cust.replaceArg(sig, sigsum)
108cust_clone = cust.build(ROOT.kTRUE)