18x = ROOT.RooRealVar(
"x",
"x", 0, 10)
19a = ROOT.RooArgusBG(
"a",
"argus(x)", x, ROOT.RooFit.RooConst(
20 10), ROOT.RooFit.RooConst(-1))
23data = a.generate(ROOT.RooArgSet(x), 10000)
32xRegion = ROOT.RooThresholdCategory(
33 "xRegion",
"region of x", x,
"Background")
42xRegion.addThreshold(4.23,
"Background")
43xRegion.addThreshold(5.23,
"SideBand")
44xRegion.addThreshold(8.23,
"Signal")
45xRegion.addThreshold(9.23,
"SideBand")
52data.addColumn(xRegion)
55xframe = x.frame(ROOT.RooFit.Title(
56 "Demo of threshold and binning mapping functions"))
62 ROOT.RooFit.Cut(
"xRegion==xRegion::SideBand"),
63 ROOT.RooFit.MarkerColor(
65 ROOT.RooFit.LineColor(
76x.setBins(10,
"coarse")
77xBins = ROOT.RooBinningCategory(
"xBins",
"coarse bins in x", x,
"coarse")
84xbtable = data.table(xBins)
89xb = data.addColumn(xBins)
94 "x_coarse_bin1,x_coarse_bin3,x_coarse_bin5,x_coarse_bin7,x_coarse_bin9")
98dataSel = data.reduce(ROOT.RooFit.CutRange(
99 "alt"), ROOT.RooFit.EventRange(0, 5000))
100dataSel.plotOn(xframe, ROOT.RooFit.MarkerColor(ROOT.kGreen),
101 ROOT.RooFit.LineColor(ROOT.kGreen))
103c = ROOT.TCanvas(
"rf405_realtocatfuncs",
"rf405_realtocatfuncs", 600, 600)
104xframe.SetMinimum(0.01)
105ROOT.gPad.SetLeftMargin(0.15)
106xframe.GetYaxis().SetTitleOffset(1.4)
109c.SaveAs(
"rf405_realtocatfuncs.png")