48 RooTable(name,title), _total(0), _nOverflow(0)
62 for (
int i=0 ; i<nbin ; i++) _count[i] = 0 ;
71 RooTable(other), _count(other._count), _total(other._total), _nOverflow(other._nOverflow)
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 * GetTitle() const
Returns title of object.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual Int_t getIndex() const
Return index number of current state.
virtual void printName(std::ostream &os) const
Print the name of the table.
Iterator abstract base class.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
ClassImp(Roo1DTable) Roo1DTable
Create an empty table from abstract category.
virtual void printValue(std::ostream &os) const
Print the table value, i.e. the contents, in 'inline' format.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
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.
std::vector< Double_t > _count
Int_t IndexOf(const TObject *obj) const
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default contents to print.
virtual const char * GetName() const
Returns name of object.
static void indent(ostringstream &buf, int indent_level)
virtual ~Roo1DTable()
Destructor.
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 Bool_t isIdentical(const RooTable &other)
Return true if table is identical in contents to given reference table.
Int_t GetEntries() const
Return the number of objects in array (i.e.
Mother of all ROOT objects.
virtual void printClassName(std::ostream &os) const
Print the class name of the table.
Double_t getOverflow() const
Return the number of overflow entries in 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...
RooTable is the abstract interface for table objects.
TObject * At(Int_t idx) const
Roo1DTable implements a one-dimensional table.
virtual const Text_t * GetName() const
Returns name of object.
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...