32 tagCat.defineType(
"Lepton");
33 tagCat.defineType(
"Kaon");
34 tagCat.defineType(
"NetTagger-1");
35 tagCat.defineType(
"NetTagger-2");
42 RooCategory b0flav(
"b0flav",
"B0 flavour eigenstate");
51 RooCategory largeCat(
"largeCat",
"A category with many states");
52 largeCat.defineTypes({
53 {
"A", 0}, {
"b", 2}, {
"c", 8}, {
"dee", 4},
54 {
"F", 133}, {
"g", 15}, {
"H", -20}
62 std::cout <<
"\nThis is the for loop over states of 'largeCat':";
63 for (
const auto& idxAndName : largeCat)
64 std::cout <<
"\n\t" << idxAndName.
first <<
"\t" << idxAndName.second;
65 std::cout <<
'\n' << std::endl;
68 std::cout <<
"Has label 'A': " << largeCat.hasLabel(
"A");
69 std::cout <<
"\nHas index '-20': " << largeCat.hasIndex(-20);
72 std::cout <<
"\nLabel corresponding to '2' is " << largeCat.lookupName(2);
73 std::cout <<
"\nIndex corresponding to 'A' is " << largeCat.lookupIndex(
"A");
76 std::cout <<
"\nCurrent index is " << largeCat.getCurrentIndex();
77 std::cout <<
"\nCurrent label is " << largeCat.getCurrentLabel();
78 std::cout << std::endl;
82 largeCat.setLabel(
"c");
113 double nb0 = btable->
get(
"B0");
114 std::cout <<
"Number of events with B0 flavor is " << nb0 << std::endl;
117 double fracLep = ttable->
getFrac(
"Lepton");
118 std::cout <<
"Fraction of events tagged with Lepton tag is " << fracLep << std::endl;
124 tagCat.setRange(
"good",
"Lepton,Kaon");
127 tagCat.addToRange(
"soso",
"NetTagger-1");
128 tagCat.addToRange(
"soso",
"NetTagger-2");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
double get(const char *label, bool silent=false) const
Return the table entry named 'label'.
double getFrac(const char *label, bool silent=false) const
Return the fraction of entries in the table contained in the slot named 'label'.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.
RooFit::OwningPtr< RooDataSet > generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={})
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
RooDataSet is a container class to hold unbinned data.
RooPolynomial implements a polynomial p.d.f of the form.
RooRealVar represents a variable that can be changed from the outside.
RooCmdArg CutRange(const char *rangeName)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...