24x = ROOT.RooRealVar(
"x",
"x", -20, 20)
27mean = ROOT.RooRealVar(
"mean",
"mean of g1 and g2", 0)
28sigma_g1 = ROOT.RooRealVar(
"sigma_g1",
"width of g1", 3)
29g1 = ROOT.RooGaussian(
"g1",
"g1", x, mean, sigma_g1)
31sigma_g2 = ROOT.RooRealVar(
"sigma_g2",
"width of g2", 4, 3.0, 6.0)
32g2 = ROOT.RooGaussian(
"g2",
"g2", x, mean, sigma_g2)
34frac = ROOT.RooRealVar(
"frac",
"frac", 0.5, 0.0, 1.0)
35model = ROOT.RooAddPdf(
"model",
"model", [g1, g2], [frac])
38data = model.generate({x}, 1000)
41nll = model.createNLL(data)
47m = ROOT.RooMinimizer(nll)
57model.getParameters({x}).Print(
"s")
87frame = m.contour(frac, sigma_g2, 1, 2, 3)
88frame.SetTitle(
"Contour plot")
106sigma_g2.setConstant(
True)
113c = ROOT.TCanvas(
"rf601_intminuit",
"rf601_intminuit", 600, 600)
114ROOT.gPad.SetLeftMargin(0.15)
115frame.GetYaxis().SetTitleOffset(1.4)
118c.SaveAs(
"rf601_intminuit.png")