106 if (!type)
return kTRUE ;
122 if (!type)
return kTRUE ;
139 if (TString(label).Contains(
";")) {
141 <<
"): semicolons not allowed in label name" << endl ;
157 if (TString(label).Contains(
";")) {
159 <<
"): semicolons not allowed in label name" << endl ;
209 rangeNameList->
Clear() ;
210 }
else if (!silent) {
211 coutE(
InputArguments) <<
"RooCategory::clearRange(" <<
GetName() <<
") ERROR: range '" << name <<
"' does not exist" << endl ;
231 if (!name || !stateNameList) {
232 coutE(
InputArguments) <<
"RooCategory::setRange(" <<
GetName() <<
") ERROR: must specificy valid name and state name list" << endl ;
240 if (!rangeNameList) {
242 <<
") new range named '" << name <<
"' created with state list " << stateNameList << endl ;
244 rangeNameList =
new TList ;
251 const size_t bufSize = strlen(stateNameList)+1;
252 char* buf =
new char[bufSize] ;
253 strlcpy(buf,stateNameList,bufSize) ;
254 char* token = strtok(buf,
",") ;
257 if (state && !rangeNameList->
FindObject(token)) {
261 << token <<
"' in state name list" << endl ;
263 token = strtok(0,
",") ;
303 void RooCategory::Streamer(
TBuffer &R__b)
309 RooAbsCategoryLValue::Streamer(R__b);
315 tmpSharedProp->Streamer(R__b) ;
319 delete tmpSharedProp ;
329 RooAbsCategoryLValue::Streamer(R__b);
virtual const char * GetName() const
Returns name of object.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set value by specifying the index code of the desired state.
RooCatType _value
Transient cache for byte values from tree branches.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void clearRange(const char *name, Bool_t silent)
Check that both input arguments are not null pointers.
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
RooCategorySharedProperties is the container for all properties that are shared between instance of R...
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
void setValueDirty() const
static RooSharedPropertiesList _sharedPropList
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooSharedProperties * registerProperties(RooSharedProperties *, Bool_t canDeleteIncoming=kTRUE)
Register property into list and take ownership.
Bool_t isStateInRange(const char *rangeName, const char *stateName) const
If no range is specified [ i.e. the default range ] all category states are in range.
void addToRange(const char *rangeName, const char *stateNameList)
Check that both input arguments are not null pointers.
RooCategorySharedProperties * _sharedProp
const RooCatType * defineType(const char *label)
Define a new state with given name.
virtual void Add(TObject *arg)
void unregisterProperties(RooSharedProperties *)
Decrease reference count of property.
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
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.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
void SetName(const char *name)
RooCategory represents a fundamental (non-derived) discrete value object.
virtual Int_t getIndex() const
Return index number of current state.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
compact only at the moment
static RooCategorySharedProperties _nullProp
virtual const char * getLabel() const
Return label string of current state.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Class RooSharedPropertiesList maintains the properties of RooRealVars and RooCategories that are clon...
virtual void Add(TObject *obj)
void setShapeDirty() const
virtual ~RooCategory()
Destructor.
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index...
void setRange(const char *rangeName, const char *stateNameList)
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0