Data and categories: demonstration of discrete-discrete (invertable) functions
import ROOT
tagCat = ROOT.RooCategory("tagCat", "Tagging category")
tagCat.defineType("Lepton")
tagCat.defineType("Kaon")
tagCat.defineType("NetTagger-1")
tagCat.defineType("NetTagger-2")
tagCat.Print()
b0flav = ROOT.RooCategory("b0flav", "B0 flavour eigenstate", {"B0": -1, "B0bar": 1})
b0flav.Print()
x = ROOT.RooRealVar("x", "x", 0, 10)
p = ROOT.RooPolynomial("p", "p", x)
data = p.generate({x, b0flav, tagCat}, 10000)
tcatType = ROOT.RooMappedCategory("tcatType", "tagCat type", tagCat, "Cut based")
tcatType.map("Lepton", "Cut based")
tcatType.map("Kaon", "Cut based")
tcatType.map("NetTagger*", "Neural Network")
mtable = data.table(tcatType)
mtable.Print("v")
b0Xtcat = ROOT.RooSuperCategory("b0Xtcat", "b0flav X tagCat", {b0flav, tagCat})
stable = data.table(b0Xtcat)
stable.Print("v")
b0Xtcat.setLabel("{B0bar;Lepton}")
b0Xttype = ROOT.RooMultiCategory("b0Xttype", "b0flav X tagType", {b0flav, tcatType})
xtable = data.table(b0Xttype)
xtable.Print("v")
RooCategory::tagCat = Lepton(idx = 0)
RooCategory::b0flav = B0(idx = -1)
Table tcatType : pData
+----------------+------+
| Cut based | 5058 |
| Neural Network | 4942 |
+----------------+------+
Table b0Xtcat : pData
+---------------------+------+
| {Lepton;B0} | 1281 |
| {Kaon;B0} | 1253 |
| {NetTagger-1;B0} | 1234 |
| {NetTagger-2;B0} | 1272 |
| {Lepton;B0bar} | 1269 |
| {Kaon;B0bar} | 1255 |
| {NetTagger-1;B0bar} | 1219 |
| {NetTagger-2;B0bar} | 1217 |
+---------------------+------+
[#0] ERROR:InputArguments -- RooSuperCategory can only have positive index states. Got -2147483648
Table b0Xttype : pData
+------------------------+------+
| {Cut based;B0} | 2534 |
| {Neural Network;B0} | 2506 |
| {Cut based;B0bar} | 2524 |
| {Neural Network;B0bar} | 2436 |
+------------------------+------+
- Date
- February 2018
- Authors
- Clemens Lange, Wouter Verkerke (C++ version)
Definition in file rf406_cattocatfuncs.py.