Logo ROOT   6.21/01
Reference Guide
RooMapCatEntry.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooMapCatEntry.h,v 1.13 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_MAP_CAT_ENTRY
17 #define ROO_MAP_CAT_ENTRY
18 
19 #include "TNamed.h"
20 #include "TRegexp.h"
21 #include "RooCatType.h"
22 
23 class RooMapCatEntry : public TNamed {
24 public:
25  inline RooMapCatEntry() : TNamed(), _regexp(""), _cat() {}
26  virtual ~RooMapCatEntry() {} ;
27  RooMapCatEntry(const char* exp, const RooCatType* cat) ;
28  RooMapCatEntry(const RooMapCatEntry& other) ;
29  virtual TObject* Clone(const char* newName=0) const {
30  RooMapCatEntry* ca = new RooMapCatEntry(*this);
31  if (newName) { ca->SetName(newName) ; }
32  return ca ;
33  }
34 
35  inline Bool_t ok() { return (_regexp.Status()==TRegexp::kOK) ; }
36  Bool_t match(const char* testPattern) const ;
37  inline const RooCatType& outCat() const { return _cat ; }
38 
39 protected:
40 
41  TString mangle(const char* exp) const ;
42 
45 
46  ClassDef(RooMapCatEntry,1) // Utility class, holding a map expression from a index label regexp to a RooCatType
47 } ;
48 
49 
50 #endif
RooCatType _cat
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
Regular expression class.
Definition: TRegexp.h:31
Basic string class.
Definition: TString.h:131
bool Bool_t
Definition: RtypesCore.h:59
virtual ~RooMapCatEntry()
const RooCatType & outCat() const
Bool_t match(const char *testPattern) const
#define ClassDef(name, id)
Definition: Rtypes.h:326
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:22
virtual TObject * Clone(const char *newName=0) const
Make a clone of an object using the Streamer facility.
TString mangle(const char *exp) const
Mother of all ROOT objects.
Definition: TObject.h:37
EStatVal Status()
Check status of regexp.
Definition: TRegexp.cxx:231
double exp(double)