23x = ROOT.RooRealVar(
"x",
"x", -20, 20)
26mean = ROOT.RooRealVar(
"mean",
"mean of g1 and g2", 0)
27sigma_g1 = ROOT.RooRealVar(
"sigma_g1",
"width of g1", 3)
28g1 = ROOT.RooGaussian(
"g1",
"g1", x, mean, sigma_g1)
30sigma_g2 = ROOT.RooRealVar(
"sigma_g2",
"width of g2", 4, 3.0, 6.0)
31g2 = ROOT.RooGaussian(
"g2",
"g2", x, mean, sigma_g2)
33frac = ROOT.RooRealVar(
"frac",
"frac", 0.5, 0.0, 1.0)
34model = ROOT.RooAddPdf(
"model",
"model", [g1, g2], [frac])
37data = model.generate({x}, 1000)
40nll = model.createNLL(data)
46m = ROOT.RooMinimizer(nll)
56model.getParameters({x}).
Print(
"s")
86frame = m.contour(frac, sigma_g2, 1, 2, 3)
87frame.SetTitle(
"Contour plot")
105sigma_g2.setConstant(
True)
112c = ROOT.TCanvas(
"rf601_intminuit",
"rf601_intminuit", 600, 600)
113ROOT.gPad.SetLeftMargin(0.15)
114frame.GetYaxis().SetTitleOffset(1.4)
117c.SaveAs(
"rf601_intminuit.png")
void Print(GNN_Data &d, std::string txt="")