71 RooAbsArg(other,
name), _value(other._value), _treeVar(other._treeVar)
181 return !TString(label).CompareTo(
getLabel()) ;
201 if (!assumeSameType) {
272 << index <<
" already assigned" << endl ;
278 << label <<
" already assigned or not allowed" << endl ;
353 Int_t idx=strtol(label,&endptr,10) ;
354 if (endptr==label+strlen(label)) {
444 os << indent <<
"--- RooAbsCategory ---" << endl;
446 os << indent <<
" ** No values defined **" << endl;
449 os << indent <<
" Value is \"" <<
getLabel() <<
"\" (" <<
getIndex() <<
")" << endl;
450 os << indent <<
" Has the following possible values:" << endl;
484 TBranch* branch = t.GetBranch(cleanName) ;
488 if (!typeName.CompareTo(
"Int_t")) {
492 <<
" will be interpreted as category index" << endl ;
498 }
else if (!typeName.CompareTo(
"UChar_t")) {
500 <<
" will be interpreted as category index" << endl ;
514 TString idxName(cleanName) ;
515 TString lblName(cleanName) ;
516 idxName.Append(
"_idx") ;
517 lblName.Append(
"_lbl") ;
520 if ((branch = t.GetBranch(idxName))) {
524 cxcoutD(
Contents) <<
"RooAbsCategory::attachToTree(" <<
GetName() <<
") Fixing compression level of branch " << idxName << endl ;
529 TString format(idxName);
532 branch = t.Branch(idxName, ptr, (
const Text_t*)format, bufSize);
537 if ((branch = t.GetBranch(lblName))) {
541 cxcoutD(
DataHandling) <<
"RooAbsCategory::attachToTree(" <<
GetName() <<
") Fixing compression level of branch " << lblName << endl ;
546 TString format(lblName);
549 branch = t.Branch(lblName, ptr, (
const Text_t*)format, bufSize);
564 idxName.Append(
"_idx") ;
565 lblName.Append(
"_lbl") ;
568 TBranch* idxBranch = t.GetBranch(idxName) ;
569 TBranch* lblBranch = t.GetBranch(lblName) ;
570 if (!idxBranch||!lblBranch) {
588 t.SetBranchStatus(
Form(
"%s_idx",
GetName()),active?1:0) ;
589 t.SetBranchStatus(
Form(
"%s_lbl",
GetName()),active?1:0) ;
625 <<
") ERROR: index of source arg " << source->
GetName()
627 <<
"), value not updated" << endl ;
629 }
if (source->
getAttribute(
"UCHARIDXONLY_TREE_BRANCH")) {
637 <<
") ERROR: index of source arg " << source->
GetName()
638 <<
" is invalid (" << tmp
639 <<
"), value not updated" << endl ;
char * Form(const char *fmt,...)
Roo1DTable implements a one-dimensional table.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multi-line detailed printing.
Bool_t isShapeDirty() const
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Bool_t isValueDirty() const
void clearValueDirty() const
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
void setShapeDirty() const
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
void clearShapeDirty() const
void setValueDirty() const
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValueDirty=kTRUE)
Copy the cached value from given source and raise dirty flag.
const RooCatType * getOrdinal(UInt_t n, const char *rangeName=0) const
Return state definition of ordinal nth defined state, needed by the generator mechanism.
TIterator * typeIterator() const
Return iterator over all defined states.
virtual void fillTreeBranch(TTree &t)
Fill tree branches associated with current object with current value.
RooCatType _value
Transient cache for byte values from tree branches.
virtual void attachToVStore(RooVectorDataStore &vstore)
Attach the category index and label to as branches to the given vector store.
Roo1DTable * createTable(const char *label) const
Create a table matching the shape of this category.
virtual Bool_t isValid() const
Check if current value is a valid state.
virtual ~RooAbsCategory()
Destructor.
virtual Int_t getIndex() const
Return index number of current state.
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach the category index and label to as branches to the given TTree.
virtual const char * getLabel() const
Return label string of current state.
Bool_t isValidLabel(const char *label) const
Check if state with given name is defined.
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooCategory fundamental object with our properties.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to ostream.
virtual void setTreeBranchStatus(TTree &t, Bool_t active)
(De)activate associate tree branch
const RooCatType * defineTypeUnchecked(const char *label, Int_t index)
Internal version of defineType that does not check if type already exists.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
Int_t numTypes(const char *=0) const
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)
RooCatType traceEval() const
Recalculate current value and check validity of new result.
virtual RooCatType evaluate() const =0
virtual void syncCache(const RooArgSet *set=0)
Explicitly synchronize RooAbsCategory internal cache.
const RooCatType * defineType(const char *label)
Define a new state with given name.
Bool_t isSignType(Bool_t mustHaveZero=kFALSE) const
Determine if category has 2 or 3 states with index values -1,0,1.
virtual Bool_t traceEvalHook(RooCatType) const
virtual void printValue(std::ostream &os) const
Print value (label name)
const RooCatType * lookupType(Int_t index, Bool_t printError=kFALSE) const
Find our type corresponding to the specified index, or return 0 for no match.
Bool_t operator==(Int_t index) const
Equality operator with a integer (compares with state index number)
Bool_t isValidIndex(Int_t index) const
Check if state with given index is defined.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream (dummy for now)
void clearTypes()
Delete all currently defined states.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
virtual const Text_t * GetName() const
Returns name of object.
virtual void SetName(const Text_t *name)
Constructor with name argument.
RooCategory represents a fundamental (non-derived) discrete value object.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
void setBuffer(RooCatType *newBuf)
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
CatVector * addCategory(RooAbsCategory *cat)
A TTree is a list of TBranches.
Int_t GetCompressionLevel() const
TObjArray * GetListOfLeaves()
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Iterator abstract base class.
virtual TObject * Next()=0
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
@ kUseGlobal
Use the global compression setting for this process; may be affected by rootrc.