38using std::ostream, std::setw, std::setfill;
56 _types.Add(new RooCatType(*type)) ;
63 for (
int i=0 ; i<nbin ; i++)
_count[i] = 0 ;
109 for (
int i=0 ; i<
_types.GetEntries() ; i++) {
191 os <<
indent << std::endl ;
195 Int_t labelWidth(0) ;
199 for (i=0 ; i<
_types.GetEntries() ; i++) {
205 labelWidth = lwidth > labelWidth ? lwidth : labelWidth;
210 labelWidth=labelWidth>8?labelWidth:8 ;
216 os <<
indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << std::endl ;
220 for (i=0 ; i<
_types.GetEntries() ; i++) {
222 if (
_count[i]>0 || verbose) {
223 os <<
" | " << setw(labelWidth) << entry->
GetName() <<
" | " << setw(countWidth) <<
_count[i] <<
" |" << std::endl ;
229 os <<
indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << std::endl ;
230 os <<
indent <<
" | " <<
"Overflow" <<
" | " << setw(countWidth) <<
_nOverflow <<
" |" << std::endl ;
234 os <<
indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << std::endl ;
236 os <<
indent << std::endl ;
251 coutE(InputArguments) <<
"Roo1DTable::get: ERROR: no such entry: " << label << std::endl ;
268 for (; i <
_types.GetEntries(); ++i) {
270 if (cat->
getVal() == index) {
278 coutE(InputArguments) <<
"Roo1DTable::get: ERROR: no such entry: " << index << std::endl ;
307 if (!silent)
coutW(Contents) <<
"Roo1DTable::getFrac: WARNING table empty, returning 0" << std::endl ;
324 if (!silent)
coutW(Contents) <<
"Roo1DTable::getFrac: WARNING table empty, returning 0" << std::endl ;
343 for (i=0 ; i<
_types.GetEntries() ; i++) {
int Int_t
Signed integer 4 bytes (int).
const char Option_t
Option string (const char).
static void indent(ostringstream &buf, int indent_level)
std::vector< double > _count
Array of counters for each state.
void printName(std::ostream &os) const override
Print the name of the table.
~Roo1DTable() override
Destructor.
void printValue(std::ostream &os) const override
Print the table value, i.e. the contents, in 'inline' format.
Int_t defaultPrintContents(Option_t *opt) const override
Define default contents to print.
double _total
Total number of entries.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Print the formatted table contents on the given stream.
double getOverflow() const
Return the number of overflow entries in the table.
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'.
bool isIdentical(const RooTable &other, bool verbose) override
Return true if table is identical in contents to given reference table.
TObjArray _types
Array of defined category states.
double _nOverflow
Number of overflow entries.
void fill(RooAbsCategory &cat, double weight=1.0) override
Increment the counter of the table slot with the name corresponding to that of the current category s...
void printTitle(std::ostream &os) const override
Print the title of the table.
void printClassName(std::ostream &os) const override
Print the class name of the table.
A space to attach TBranches.
virtual value_type getCurrentIndex() const
Return index number of current state.
TIterator * typeIterator() const
RooCatType is an auxiliary class for RooAbsCategory and defines a a single category state.
const Text_t * GetName() const override
Returns name of object.
Iterator abstract base class.
virtual TObject * Next()=0
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
virtual const char * ClassName() const
Returns name of class to which the object belongs.
TObject()
TObject constructor.