24 class RooCategory :
public RooAbsCategoryLValue {
28 RooCategory(
const char *name,
const char *title);
29 RooCategory(
const RooCategory& other,
const char* name=0) ;
30 virtual ~RooCategory();
31 virtual TObject* clone(
const char* newname)
const {
return new RooCategory(*
this,newname); }
34 virtual Int_t getIndex()
const {
35 return _value.getVal() ;
39 virtual const char* getLabel()
const {
40 const char* ret = _value.GetName() ;
42 _value.SetName(lookupType(_value.getVal())->GetName()) ;
44 return _value.GetName() ;
47 virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE) ;
48 virtual Bool_t setLabel(
const char* label, Bool_t printError=kTRUE) ;
51 virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
52 virtual void writeToStream(std::ostream& os, Bool_t compact)
const ;
55 inline virtual Bool_t isFundamental()
const {
60 virtual Bool_t isDerived()
const {
65 Bool_t defineType(
const char* label) ;
66 Bool_t defineType(
const char* label, Int_t index) ;
67 void clearTypes() { RooAbsCategory::clearTypes() ; }
69 void clearRange(
const char* name, Bool_t silent) ;
70 void setRange(
const char* rangeName,
const char* stateNameList) ;
71 void addToRange(
const char* rangeName,
const char* stateNameList) ;
72 Bool_t isStateInRange(
const char* rangeName,
const char* stateName)
const ;
73 virtual Bool_t inRange(
const char* rangeName)
const {
75 return isStateInRange(rangeName,getLabel()) ;
77 virtual Bool_t hasRange(
const char* rangeName)
const {
79 return _sharedProp->_altRanges.FindObject(rangeName) ? kTRUE : kFALSE ;
84 static RooSharedPropertiesList _sharedPropList;
85 static RooCategorySharedProperties _nullProp ;
86 RooCategorySharedProperties* _sharedProp ;
88 virtual RooCatType evaluate()
const {
93 ClassDef(RooCategory,2)