%%cpp -d #include "RooRealVar.h" #include "RooDataSet.h" #include "RooPolynomial.h" #include "RooCategory.h" #include "RooMappedCategory.h" #include "RooMultiCategory.h" #include "RooSuperCategory.h" #include "Roo1DTable.h" #include "TCanvas.h" #include "TAxis.h" #include "RooPlot.h" using namespace RooFit; RooCategory tagCat("tagCat", "Tagging category"); tagCat.defineType("Lepton"); tagCat.defineType("Kaon"); tagCat.defineType("NetTagger-1"); tagCat.defineType("NetTagger-2"); tagCat.Print(); RooCategory b0flav("b0flav", "B0 flavour eigenstate"); b0flav.defineType("B0", -1); b0flav.defineType("B0bar", 1); b0flav.Print(); RooRealVar x("x", "x", 0, 10); RooPolynomial p("p", "p", x); std::unique_ptr data{p.generate({x, b0flav, tagCat}, 10000)}; RooMappedCategory tcatType("tcatType", "tagCat type", tagCat, "Cut based"); tcatType.map("Lepton", "Cut based"); tcatType.map("Kaon", "Cut based"); tcatType.map("NetTagger*", "Neural Network"); Roo1DTable *mtable = data->table(tcatType); mtable->Print("v"); RooSuperCategory b0Xtcat("b0Xtcat", "b0flav X tagCat", RooArgSet(b0flav, tagCat)); Roo1DTable *stable = data->table(b0Xtcat); stable->Print("v"); b0Xtcat.setLabel("{B0bar;Lepton}"); RooMultiCategory b0Xttype("b0Xttype", "b0flav X tagType", RooArgSet(b0flav, tcatType)); Roo1DTable *xtable = data->table(b0Xttype); xtable->Print("v");