Logo ROOT   6.08/07
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 "Riosfwd.h"
20 #include "TNamed.h"
21 #include "TRegexp.h"
22 #include "RooCatType.h"
23 
24 class RooMapCatEntry : public TNamed {
25 public:
26  inline RooMapCatEntry() : TNamed(), _regexp(""), _cat() {}
27  virtual ~RooMapCatEntry() {} ;
28  RooMapCatEntry(const char* exp, const RooCatType* cat) ;
29  RooMapCatEntry(const RooMapCatEntry& other) ;
30  virtual TObject* Clone(const char* newName=0) const {
31  RooMapCatEntry* ca = new RooMapCatEntry(*this);
32  if (newName) { ca->SetName(newName) ; }
33  return ca ;
34  }
35 
36  inline Bool_t ok() { return (_regexp.Status()==TRegexp::kOK) ; }
37  Bool_t match(const char* testPattern) const ;
38  inline const RooCatType& outCat() const { return _cat ; }
39 
40 protected:
41 
42  TString mangle(const char* exp) const ;
43 
46 
47  ClassDef(RooMapCatEntry,1) // Utility class, holding a map expression from a index label regexp to a RooCatType
48 } ;
49 
50 
51 #endif
RooCatType _cat
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:131
Regular expression class.
Definition: TRegexp.h:35
Basic string class.
Definition: TString.h:137
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:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:23
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)