19x = ROOT.RooRealVar(
"x",
"x", 0, 10)
20a = ROOT.RooArgusBG(
"a",
"argus(x)", x, ROOT.RooFit.RooConst(
21 10), ROOT.RooFit.RooConst(-1))
24data = a.generate(ROOT.RooArgSet(x), 10000)
33xRegion = ROOT.RooThresholdCategory(
34 "xRegion",
"region of x", x,
"Background")
43xRegion.addThreshold(4.23,
"Background")
44xRegion.addThreshold(5.23,
"SideBand")
45xRegion.addThreshold(8.23,
"Signal")
46xRegion.addThreshold(9.23,
"SideBand")
53data.addColumn(xRegion)
56xframe = x.frame(ROOT.RooFit.Title(
57 "Demo of threshold and binning mapping functions"))
63 ROOT.RooFit.Cut(
"xRegion==xRegion::SideBand"),
64 ROOT.RooFit.MarkerColor(
66 ROOT.RooFit.LineColor(
77x.setBins(10,
"coarse")
78xBins = ROOT.RooBinningCategory(
"xBins",
"coarse bins in x", x,
"coarse")
85xbtable = data.table(xBins)
90xb = data.addColumn(xBins)
95 "x_coarse_bin1,x_coarse_bin3,x_coarse_bin5,x_coarse_bin7,x_coarse_bin9")
99dataSel = data.reduce(ROOT.RooFit.CutRange(
100 "alt"), ROOT.RooFit.EventRange(0, 5000))
101dataSel.plotOn(xframe, ROOT.RooFit.MarkerColor(ROOT.kGreen),
102 ROOT.RooFit.LineColor(ROOT.kGreen))
104c = ROOT.TCanvas(
"rf405_realtocatfuncs",
"rf405_realtocatfuncs", 600, 600)
105xframe.SetMinimum(0.01)
106ROOT.gPad.SetLeftMargin(0.15)
107xframe.GetYaxis().SetTitleOffset(1.4)
110c.SaveAs(
"rf405_realtocatfuncs.png")