12from __future__ 
import print_function
 
   20tagCat = ROOT.RooCategory(
"tagCat", 
"Tagging category")
 
   21tagCat.defineType(
"Lepton")
 
   22tagCat.defineType(
"Kaon")
 
   23tagCat.defineType(
"NetTagger-1")
 
   24tagCat.defineType(
"NetTagger-2")
 
   31b0flav = ROOT.RooCategory(
"b0flav", 
"B0 flavour eigenstate", {
"B0": -1, 
"B0bar": 1})
 
   38x = ROOT.RooRealVar(
"x", 
"x", 0, 10)
 
   39data = ROOT.RooPolynomial(
"p", 
"p", x).generate({x, b0flav, tagCat}, 10000)
 
   45btable = data.table(b0flav)
 
   50ttable = data.table(tagCat, 
"x>8.23")
 
   55bttable = data.table({tagCat, b0flav})
 
   61print(
"Number of events with B0 flavor is ", nb0)
 
   64fracLep = ttable.getFrac(
"Lepton")
 
   65print(
"Fraction of events tagged with Lepton tag is ", fracLep)
 
   71tagCat.setRange(
"good", 
"Lepton,Kaon")
 
   74tagCat.addToRange(
"soso", 
"NetTagger-1")
 
   75tagCat.addToRange(
"soso", 
"NetTagger-2")
 
   78goodData = data.reduce(CutRange=
"good")
 
   79goodData.table(tagCat).Print(
"v")