11from __future__
import print_function
19tagCat = ROOT.RooCategory(
"tagCat",
"Tagging category")
20tagCat.defineType(
"Lepton")
21tagCat.defineType(
"Kaon")
22tagCat.defineType(
"NetTagger-1")
23tagCat.defineType(
"NetTagger-2")
30b0flav = ROOT.RooCategory(
"b0flav",
"B0 flavour eigenstate")
31b0flav.defineType(
"B0", -1)
32b0flav.defineType(
"B0bar", 1)
39x = ROOT.RooRealVar(
"x",
"x", 0, 10)
40data = ROOT.RooPolynomial(
"p",
"p", x).generate(
41 ROOT.RooArgSet(x, b0flav, tagCat), 10000)
47btable = data.table(b0flav)
52ttable = data.table(tagCat,
"x>8.23")
57bttable = data.table(ROOT.RooArgSet(tagCat, b0flav))
63print(
"Number of events with B0 flavor is ", nb0)
66fracLep = ttable.getFrac(
"Lepton")
67print(
"Fraction of events tagged with Lepton tag is ", fracLep)
73tagCat.setRange(
"good",
"Lepton,Kaon")
76tagCat.addToRange(
"soso",
"NetTagger-1")
77tagCat.addToRange(
"soso",
"NetTagger-2")
80goodData = data.reduce(ROOT.RooFit.CutRange(
"good"))
81goodData.table(tagCat).Print(
"v")