library: libRooFit #include "RooMappedCategory.h"

# RooMappedCategory

class description - source file - inheritance tree (.pdf)

## class RooMappedCategory : public RooAbsCategory

| Inheritance Chart:
`TObject`
| <- | `TNamed`
`RooPrintable`
| <- | `RooAbsArg`
| <- | `RooAbsCategory`
| <- | `RooMappedCategory` |

        protected:

          virtual RooCatType evaluate() const

        public:

                            RooMappedCategory()
                            RooMappedCategory(const char* name, const char* title, RooAbsCategory& inputCat, const char* defCatName = "NotMapped", Int_t defCatIdx = NoCatIdx)
                            RooMappedCategory(const RooMappedCategory& other, const char* name = "0")
                    virtual ~RooMappedCategory()
             static TClass* Class()
           virtual TObject* clone(const char* newname) const
            virtual TClass* IsA() const
                     Bool_t map(const char* inKeyRegExp, const char* outKeyName, Int_t outKeyNum = NoCatIdx)
               virtual void printToStream(ostream& os, RooPrintable::PrintOption opt = Standard, TString indent = ) const
             virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose = kFALSE)
               virtual void ShowMembers(TMemberInspector& insp, char* parent)
               virtual void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)
               virtual void writeToStream(ostream& os, Bool_t compact) const

### Data Members

        protected:

                 TObjArray _mapArray  Array of mapping rules
               RooCatType* _defCat    Default (unmapped) output type
          RooCategoryProxy _inputCat  Input category

        public:

          static const RooMappedCategory::CatIdx NoCatIdx

## Class Description

RooMappedCategory(const char *name, const char *title, RooAbsCategory& inputCat, const char* defOut, Int_t defOutIdx) : RooAbsCategory(name, title), _inputCat("inputCat","Input category",this,inputCat)

     Constructor with input category and name of default output state, which is assigned
     to all input category states that do not follow any mapping rule.

RooMappedCategory(const RooMappedCategory& other, const char *name) : RooAbsCategory(other,name), _inputCat("inputCat",this,other._inputCat)

~RooMappedCategory()

     Destructor

Bool_t map(const char* inKeyRegExp, const char* outKey, Int_t outIdx)

     Add mapping rule: any input category state label matching the 'inKeyRegExp'
     wildcard expression will be mapped to an output state with name 'outKey'

     Rules are evaluated in the order they were added. In case an input state
     matches more than one rule, the first rules output state will be assigned

evaluate() const

     Calculate the current value of the object

void printToStream(ostream& os, PrintOption opt, TString indent) const

     Print info about this mapped category to the specified stream. In addition to the info
     from RooAbsCategory::printToStream() we add:

      Standard : input category
         Shape : default value
       Verbose : list of mapping rules

Bool_t readFromStream(istream& is, Bool_t compact, Bool_t /*verbose*/)

     Read object contents from given stream

void writeToStream(ostream& os, Bool_t compact) const

     Write object contents to given stream

### Inline Functions

            RooMappedCategory RooMappedCategory(const RooMappedCategory& other, const char* name = "0")
                     TObject* clone(const char* newname) const
                      TClass* Class()
                      TClass* IsA() const
                         void ShowMembers(TMemberInspector& insp, char* parent)
                         void Streamer(TBuffer& b)
                         void StreamerNVirtual(TBuffer& b)

Last update: Tue Jun 28 18:13:42 2005
Copyright (c) 2000-2005, Regents of the University of California *