34 tagCat.defineType(
"Lepton");
35 tagCat.defineType(
"Kaon");
36 tagCat.defineType(
"NetTagger-1");
37 tagCat.defineType(
"NetTagger-2");
44 RooCategory b0flav(
"b0flav",
"B0 flavour eigenstate");
53 RooCategory largeCat(
"largeCat",
"A category with many states");
54 largeCat.defineTypes({
55 {
"A", 0}, {
"b", 2}, {
"c", 8}, {
"dee", 4},
56 {
"F", 133}, {
"g", 15}, {
"H", -20}
64 std::cout <<
"\nThis is the for loop over states of 'largeCat':";
65 for (
const auto& idxAndName : largeCat)
66 std::cout <<
"\n\t" << idxAndName.first <<
"\t" << idxAndName.second;
67 std::cout <<
'\n' << std::endl;
70 std::cout <<
"Has label 'A': " << largeCat.hasLabel(
"A");
71 std::cout <<
"\nHas index '-20': " << largeCat.hasIndex(-20);
74 std::cout <<
"\nLabel corresponding to '2' is " << largeCat.lookupName(2);
75 std::cout <<
"\nIndex corresponding to 'A' is " << largeCat.lookupIndex(
"A");
78 std::cout <<
"\nCurrent index is " << largeCat.getCurrentIndex();
79 std::cout <<
"\nCurrent label is " << largeCat.getCurrentLabel();
80 std::cout << std::endl;
84 largeCat.setLabel(
"c");
116 std::cout <<
"Number of events with B0 flavor is " << nb0 << std::endl;
120 std::cout <<
"Fraction of events tagged with Lepton tag is " << fracLep << std::endl;
126 tagCat.setRange(
"good",
"Lepton,Kaon");
129 tagCat.addToRange(
"soso",
"NetTagger-1");
130 tagCat.addToRange(
"soso",
"NetTagger-2");
Roo1DTable implements a one-dimensional table.
Double_t get(const char *label, Bool_t silent=kFALSE) const
Return the table entry named 'label'.
Double_t getFrac(const char *label, Bool_t silent=kFALSE) const
Return the fraction of entries in the table contained in the slot named 'label'.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.
RooAbsData * reduce(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg())
Create a reduced copy of this dataset.
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCategory is an 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...