33 tagCat.defineType(
"Lepton");
34 tagCat.defineType(
"Kaon");
35 tagCat.defineType(
"NetTagger-1");
36 tagCat.defineType(
"NetTagger-2");
43 RooCategory b0flav(
"b0flav",
"B0 flavour eigenstate");
52 RooCategory largeCat(
"largeCat",
"A category with many states");
53 largeCat.defineTypes({
54 {
"A", 0}, {
"b", 2}, {
"c", 8}, {
"dee", 4},
55 {
"F", 133}, {
"g", 15}, {
"H", -20}
63 std::cout <<
"\nThis is the for loop over states of 'largeCat':";
64 for (
const auto& idxAndName : largeCat)
65 std::cout <<
"\n\t" << idxAndName.
first <<
"\t" << idxAndName.second;
66 std::cout <<
'\n' << std::endl;
69 std::cout <<
"Has label 'A': " << largeCat.hasLabel(
"A");
70 std::cout <<
"\nHas index '-20': " << largeCat.hasIndex(-20);
73 std::cout <<
"\nLabel corresponding to '2' is " << largeCat.lookupName(2);
74 std::cout <<
"\nIndex corresponding to 'A' is " << largeCat.lookupIndex(
"A");
77 std::cout <<
"\nCurrent index is " << largeCat.getCurrentIndex();
78 std::cout <<
"\nCurrent label is " << largeCat.getCurrentLabel();
79 std::cout << std::endl;
83 largeCat.setLabel(
"c");
115 std::cout <<
"Number of events with B0 flavor is " << nb0 << std::endl;
119 std::cout <<
"Fraction of events tagged with Lepton tag is " << fracLep << std::endl;
125 tagCat.setRange(
"good",
"Lepton,Kaon");
128 tagCat.addToRange(
"soso",
"NetTagger-1");
129 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...