105 if (!type)
return kTRUE ;
121 if (!type)
return kTRUE ;
138 if (TString(label).Contains(
";")) {
140 <<
"): semicolons not allowed in label name" << endl ;
156 if (TString(label).Contains(
";")) {
158 <<
"): semicolons not allowed in label name" << endl ;
208 rangeNameList->
Clear() ;
209 }
else if (!silent) {
210 coutE(
InputArguments) <<
"RooCategory::clearRange(" <<
GetName() <<
") ERROR: range '" << name <<
"' does not exist" << endl ;
230 if (!name || !stateNameList) {
231 coutE(
InputArguments) <<
"RooCategory::setRange(" <<
GetName() <<
") ERROR: must specificy valid name and state name list" << endl ;
239 if (!rangeNameList) {
241 <<
") new range named '" << name <<
"' created with state list " << stateNameList << endl ;
243 rangeNameList =
new TList ;
250 const size_t bufSize = strlen(stateNameList)+1;
251 char* buf =
new char[bufSize] ;
252 strlcpy(buf,stateNameList,bufSize) ;
253 char* token = strtok(buf,
",") ;
256 if (state && !rangeNameList->
FindObject(token)) {
260 << token <<
"' in state name list" << endl ;
262 token = strtok(0,
",") ;
302 void RooCategory::Streamer(
TBuffer &R__b)
308 RooAbsCategoryLValue::Streamer(R__b);
314 tmpSharedProp->Streamer(R__b) ;
318 delete tmpSharedProp ;
328 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
Delete a TObjLink object.
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