Logo ROOT  
Reference Guide
RooMultiCatIter.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooMultiCatIter.h,v 1.14 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_MULTI_CAT_ITER
17 #define ROO_MULTI_CAT_ITER
18 
19 #include "TIterator.h"
20 #include "RooArgSet.h"
21 #include "TObjString.h"
22 class RooCategory ;
23 class RooCatType ;
25 
26 typedef TIterator* pTIterator ;
28 
29 class RooMultiCatIter : public TIterator {
30 public:
31  // Constructors, assignment etc.
32  RooMultiCatIter(const RooArgSet& catList, const char* rangeName=0) ;
33  RooMultiCatIter(const RooMultiCatIter& other) ;
34  virtual ~RooMultiCatIter() ;
35 
36  // Iterator implementation
37  virtual const TCollection* GetCollection() const ;
38  virtual TObject* Next() ;
39  virtual void Reset() ;
40  virtual bool operator!=(const TIterator &aIter) const ;
41  virtual TObject *operator*() const ;
42 
43 protected:
44 
45  TIterator& operator=(const TIterator&) { return *this ; } // forbidden for now
46 
47  void initialize(const RooArgSet& catList) ;
49 
50  RooArgSet _catList ; // Set of categories iterated over
51  pTIterator* _iterList ; // Array of category type iterators
52  pRooCategory* _catPtrList ; // Array of pointers to original categories
53  RooCatType* _curTypeList ; // List of current types
54  Int_t _nIter ; // Number of categories/iterators in use
55  Int_t _curIter ; // Current location of master iterator
57  TString _rangeName ; // Range name (optional)
58  TObject* _curItem; // Current item returned by Next()
59 
60 // ClassDef(RooMultiCatIter,0) // Iterator over all state permutations of a list of categories
61 };
62 
63 #endif
RooMultiCatIter::_curIter
Int_t _curIter
Definition: RooMultiCatIter.h:55
pTIterator
TIterator * pTIterator
Definition: RooMultiCatIter.h:24
RooMultiCatIter::operator=
TIterator & operator=(const TIterator &)
Definition: RooMultiCatIter.h:45
RooMultiCatIter::RooMultiCatIter
RooMultiCatIter(const RooArgSet &catList, const char *rangeName=0)
Construct iterator over all permutations of states of categories in catList.
Definition: RooMultiCatIter.cxx:48
RooMultiCatIter::_rangeName
TString _rangeName
Definition: RooMultiCatIter.h:57
RooMultiCatIter
Definition: RooMultiCatIter.h:29
RooArgSet.h
TObjString.h
RooMultiCatIter::_curTypeList
RooCatType * _curTypeList
Definition: RooMultiCatIter.h:53
pRooCategory
RooAbsCategoryLValue * pRooCategory
Definition: RooMultiCatIter.h:27
TString
Definition: TString.h:136
RooMultiCatIter::~RooMultiCatIter
virtual ~RooMultiCatIter()
Destructor.
Definition: RooMultiCatIter.cxx:112
TIterator
Definition: TIterator.h:30
TObjString
Definition: TObjString.h:28
RooMultiCatIter::Next
virtual TObject * Next()
Iterator increment operator.
Definition: RooMultiCatIter.cxx:161
TIterator.h
RooMultiCatIter::GetCollection
virtual const TCollection * GetCollection() const
Dummy implementation, always returns zero.
Definition: RooMultiCatIter.cxx:127
RooMultiCatIter::_compositeLabel
TObjString _compositeLabel
Definition: RooMultiCatIter.h:56
RooMultiCatIter::operator*
virtual TObject * operator*() const
Return current item (dummy)
Definition: RooMultiCatIter.cxx:223
RooMultiCatIter::_iterList
pTIterator * _iterList
Definition: RooMultiCatIter.h:51
RooMultiCatIter::_catList
RooArgSet _catList
Definition: RooMultiCatIter.h:50
RooMultiCatIter::initialize
void initialize(const RooArgSet &catList)
Build iterator array for given catList.
Definition: RooMultiCatIter.cxx:71
RooCategory
Definition: RooCategory.h:27
RooMultiCatIter::operator!=
virtual bool operator!=(const TIterator &aIter) const
Comparison operator to other iterator Returns true if both iterator iterate over the same set of inpu...
Definition: RooMultiCatIter.cxx:235
TObject
Definition: TObject.h:37
RooCatType
Definition: RooCatTypeLegacy.h:23
RooMultiCatIter::_catPtrList
pRooCategory * _catPtrList
Definition: RooMultiCatIter.h:52
RooMultiCatIter::Reset
virtual void Reset()
Rewind master iterator.
Definition: RooMultiCatIter.cxx:204
RooMultiCatIter::_curItem
TObject * _curItem
Definition: RooMultiCatIter.h:58
TCollection
Definition: TCollection.h:63
RooAbsCategoryLValue
Definition: RooAbsCategoryLValue.h:25
RooMultiCatIter::_nIter
Int_t _nIter
Definition: RooMultiCatIter.h:54
RooMultiCatIter::compositeLabel
TObjString * compositeLabel()
Construct string with composite object label corresponding to the state name of a RooMultiCategory or...
Definition: RooMultiCatIter.cxx:141
RooArgSet
Definition: RooArgSet.h:28
int