48 RooTable(name,title), _total(0), _nOverflow(0)
62 for (
int i=0 ; i<nbin ; i++)
_count[i] = 0 ;
103 if (weight==0) return ;
149 os << IsA()->GetName() ;
190 os << indent << endl ;
191 os << indent <<
" Table " <<
GetName() <<
" : " <<
GetTitle() << endl ;
194 Int_t labelWidth(0) ;
204 labelWidth = lwidth > labelWidth ? lwidth : labelWidth;
209 labelWidth=labelWidth>8?labelWidth:8 ;
215 os << indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << endl ;
221 if (
_count[i]>0 || verbose) {
222 os <<
" | " << setw(labelWidth) << entry->
GetName() <<
" | " << setw(countWidth) <<
_count[i] <<
" |" << endl ;
228 os << indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << endl ;
229 os << indent <<
" | " <<
"Overflow" <<
" | " << setw(countWidth) <<
_nOverflow <<
" |" << endl ;
233 os << indent <<
" +-" << setw(labelWidth) << setfill(
'-') <<
"-" <<
"-+-" << setw(countWidth) <<
"-" <<
"-+" << endl ;
235 os << indent << endl ;
269 if (cat->
getVal() == index) {
304 return get(label,silent) /
_total ;
306 if (!silent)
coutW(
Contents) <<
"Roo1DTable::getFrac: WARNING table empty, returning 0" << endl ;
321 return get(index, silent) /
_total ;
323 if (!silent)
coutW(
Contents) <<
"Roo1DTable::getFrac: WARNING table empty, returning 0" << endl ;
virtual const char * GetName() const
Returns name of object.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Double_t get(const char *label, Bool_t silent=kFALSE) const
Return the table entry named 'label'.
virtual Int_t getIndex() const
Return index number of current state.
TObject * At(Int_t idx) const
Iterator abstract base class.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print the formatted table contents on the given stream.
virtual void printValue(std::ostream &os) const
Print the table value, i.e. the contents, in 'inline' format.
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default contents to print.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
virtual void printClassName(std::ostream &os) const
Print the class name of the table.
std::vector< Double_t > _count
TIterator * typeIterator() const
Return iterator over all defined states.
virtual const Text_t * GetName() const
Returns name of object.
virtual ~Roo1DTable()
Destructor.
Double_t getOverflow() const
Return the number of overflow entries in the table.
virtual Bool_t isIdentical(const RooTable &other)
Return true if table is identical in contents to given reference table.
Int_t IndexOf(const TObject *obj) const
Mother of all ROOT objects.
virtual void printName(std::ostream &os) const
Print the name of the table.
virtual void printTitle(std::ostream &os) const
Print the title of the table.
virtual TObject * Next()=0
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
Int_t GetEntries() const
Return the number of objects in array (i.e.
RooTable is the abstract interface for table objects.
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'.
Roo1DTable implements a one-dimensional table.
virtual void fill(RooAbsCategory &cat, Double_t weight=1.0)
Increment the counter of the table slot with the name corresponding to that of the current category s...
virtual const char * GetTitle() const
Returns title of object.