Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RooSuperCategory.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooSuperCategory.h,v 1.17 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_SUPER_CATEGORY
17 #define ROO_SUPER_CATEGORY
18 
19 class TObject ;
20 #include "RooAbsCategoryLValue.h"
21 #include "RooCatType.h"
22 #include "RooArgSet.h"
23 #include "RooSetProxy.h"
24 
25 
27 public:
28  // Constructors etc.
30  RooSuperCategory(const char *name, const char *title, const RooArgSet& inputCatList);
31  RooSuperCategory(const RooSuperCategory& other, const char *name=0) ;
32  virtual TObject* clone(const char* newname) const { return new RooSuperCategory(*this,newname); }
33  virtual ~RooSuperCategory();
34 
35  virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE) ;
36  virtual Bool_t setLabel(const char* label, Bool_t printError=kTRUE) ;
37 
38  // Printing interface (human readable)
39  virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
40 
41  // I/O streaming interface (machine readable)
42  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
43  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
44 
45  TIterator* MakeIterator() const ;
46  const RooArgSet& inputCatList() const { return _catSet ; }
47 
48  virtual Bool_t inRange(const char* rangeName) const ;
49  virtual Bool_t hasRange(const char* rangeName) const ;
50 
51 protected:
52 
53  Bool_t setType(const RooCatType* type, Bool_t prinError=kTRUE) ;
54  void updateIndexList() ;
55  TString currentLabel() const ;
56 
57  RooSetProxy _catSet ; // Set of input category
58  TIterator* _catIter ; //! Iterator over set of input categories
59 
60  virtual RooCatType evaluate() const ;
61 
62  ClassDef(RooSuperCategory,1) // Lvalue product operator for catategory lvalues
63 };
64 
65 #endif
virtual Bool_t inRange(const char *rangeName) const
Return true of all of the input category states are in the given range.
virtual TObject * clone(const char *newname) const
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
virtual RooCatType evaluate() const
Iterator over set of input categories.
RooSetProxy _catSet
Basic string class.
Definition: TString.h:125
TString currentLabel() const
Return the name of the current state, constructed from the state names of the input categories...
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Iterator abstract base class.
Definition: TIterator.h:30
TIterator * _catIter
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
TIterator * createIterator(Bool_t dir=kIterForward) const
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:22
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
const RooArgSet & inputCatList() const
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the state of this object to the specified output stream.
Bool_t setType(const RooCatType *type, Bool_t prinError=kTRUE)
Set the value of the super category by specifying the state object by setting the state names of the ...
virtual ~RooSuperCategory()
Destructor.
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set the value of the super category by specifying the state index code by setting the states of the c...
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual Bool_t hasRange(const char *rangeName) const
Return true if any of the input categories has a range named 'rangeName'.
TIterator * MakeIterator() const
Make an iterator over all state permutations of the input categories of this supercategory.
void updateIndexList()
Update the list of possible states of this super category.
Mother of all ROOT objects.
Definition: TObject.h:37
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
RooSuperCategory consolidates several RooAbsCategoryLValue objects into a single category.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set the value of the super category by specifying the state name by setting the state names of the co...
const Bool_t kTRUE
Definition: RtypesCore.h:87
char name[80]
Definition: TGX11.cxx:109