12 from __future__
import print_function
20 tagCat = ROOT.RooCategory(
"tagCat",
"Tagging category")
21 tagCat.defineType(
"Lepton")
22 tagCat.defineType(
"Kaon")
23 tagCat.defineType(
"NetTagger-1")
24 tagCat.defineType(
"NetTagger-2")
31 b0flav = ROOT.RooCategory(
"b0flav",
"B0 flavour eigenstate")
32 b0flav.defineType(
"B0", -1)
33 b0flav.defineType(
"B0bar", 1)
40 x = ROOT.RooRealVar(
"x",
"x", 0, 10)
41 data = ROOT.RooPolynomial(
"p",
"p", x).generate(
42 ROOT.RooArgSet(x, b0flav, tagCat), 10000)
48 btable = data.table(b0flav)
53 ttable = data.table(tagCat,
"x>8.23")
58 bttable = data.table(ROOT.RooArgSet(tagCat, b0flav))
63 nb0 = btable.get(
"B0")
64 print(
"Number of events with B0 flavor is ", nb0)
67 fracLep = ttable.getFrac(
"Lepton")
68 print(
"Fraction of events tagged with Lepton tag is ", fracLep)
74 tagCat.setRange(
"good",
"Lepton,Kaon")
77 tagCat.addToRange(
"soso",
"NetTagger-1")
78 tagCat.addToRange(
"soso",
"NetTagger-2")
81 goodData = data.reduce(ROOT.RooFit.CutRange(
"good"))
82 goodData.table(tagCat).Print(
"v")