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) {
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,
",") ;
302void RooCategory::Streamer(
TBuffer &R__b)
308 RooAbsCategoryLValue::Streamer(R__b);
314 tmpSharedProp->Streamer(R__b) ;
318 delete tmpSharedProp ;
328 RooAbsCategoryLValue::Streamer(R__b);
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooCatType _value
Transient cache for byte values from tree branches.
const RooCatType * defineType(const char *label)
Define a new state with given 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.
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
RooCategorySharedProperties is the container for all properties that are shared between instance of R...
RooCategory represents a fundamental (non-derived) discrete value object.
RooCategorySharedProperties * _sharedProp
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
void setRange(const char *rangeName, const char *stateNameList)
virtual ~RooCategory()
Destructor.
static RooSharedPropertiesList _sharedPropList
void addToRange(const char *rangeName, const char *stateNameList)
Check that both input arguments are not null pointers.
virtual const char * getLabel() const
Return label string of current state.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
compact only at the moment
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...
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index.
void clearRange(const char *name, Bool_t silent)
Check that both input arguments are not null pointers.
virtual Int_t getIndex() const
Return index number of current state.
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set value by specifying the index code of the desired state.
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.
static RooCategorySharedProperties _nullProp
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
virtual void Add(TObject *arg)
Class RooSharedPropertiesList maintains the properties of RooRealVars and RooCategories that are clon...
void unregisterProperties(RooSharedProperties *)
Decrease reference count of property.
RooSharedProperties * registerProperties(RooSharedProperties *, Bool_t canDeleteIncoming=kTRUE)
Register property into list and take ownership.
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
Buffer base class used for serializing objects.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
void SetName(const char *name)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
virtual const char * GetName() const
Returns name of object.