ROOT  6.06/09
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 "Riosfwd.h"
20 #include "TIterator.h"
21 #include "RooArgSet.h"
22 #include "TObjString.h"
23 class RooCategory ;
24 class RooCatType ;
26 
27 typedef TIterator* pTIterator ;
29 
30 class RooMultiCatIter : public TIterator {
31 public:
32  // Constructors, assignment etc.
33  RooMultiCatIter(const RooArgSet& catList, const char* rangeName=0) ;
34  RooMultiCatIter(const RooMultiCatIter& other) ;
35  virtual ~RooMultiCatIter() ;
36 
37  // Iterator implementation
38  virtual const TCollection* GetCollection() const ;
39  virtual TObject* Next() ;
40  virtual void Reset() ;
41  virtual bool operator!=(const TIterator &aIter) const ;
42  virtual TObject *operator*() const ;
43 
44 protected:
45 
46  TIterator& operator=(const TIterator&) { return *this ; } // forbidden for now
47 
48  void initialize(const RooArgSet& catList) ;
50 
51  RooArgSet _catList ; // Set of categories iterated over
52  pTIterator* _iterList ; // Array of category type iterators
53  pRooCategory* _catPtrList ; // Array of pointers to original categories
54  RooCatType* _curTypeList ; // List of current types
55  Int_t _nIter ; // Number of categories/iterators in use
56  Int_t _curIter ; // Current location of master iterator
58  TString _rangeName ; // Range name (optional)
59  TObject* _curItem; // Current item returned by Next()
60 
61  ClassDef(RooMultiCatIter,0) // Iterator over all state permutations of a list of categories
62 };
63 
64 #endif
RooArgSet _catList
RooCatType * _curTypeList
TObjString * compositeLabel()
Construct string with composite object label corresponding to the state name of a RooMultiCategory or...
Collectable string class.
Definition: TObjString.h:32
pTIterator * _iterList
RooMultiCatIter(const RooArgSet &catList, const char *rangeName=0)
Construct iterator over all permutations of states of categories in catList.
RooAbsCategoryLValue * pRooCategory
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
Iterator abstract base class.
Definition: TIterator.h:32
virtual bool operator!=(const TIterator &aIter) const
Comparison operator to other iterator Returns true if both iterator iterate over the same set of inpu...
virtual void Reset()
Rewind master iterator.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual TObject * Next()
Iterator increment operator.
virtual const TCollection * GetCollection() const
Dummy implementation, always returns zero.
virtual ~RooMultiCatIter()
Destructor.
TObject * _curItem
virtual TObject * operator*() const
Return current item (dummy)
TIterator & operator=(const TIterator &)
Collection abstract base class.
Definition: TCollection.h:48
TIterator * pTIterator
TObjString _compositeLabel
Mother of all ROOT objects.
Definition: TObject.h:58
pRooCategory * _catPtrList
void initialize(const RooArgSet &catList)
Build iterator array for given catList.