ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooMultiCatIter.h,v 1.14 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_MULTI_CAT_ITER
#define ROO_MULTI_CAT_ITER

#include "Riosfwd.h"
#include "TIterator.h"
#include "RooArgSet.h"
#include "TObjString.h"
class RooCategory ;
class RooCatType ;

typedef TIterator* pTIterator ;
typedef RooAbsCategoryLValue* pRooCategory ;

class RooMultiCatIter : public TIterator {
public:
  // Constructors, assignment etc.
  RooMultiCatIter(const RooArgSet& catList, const char* rangeName=0) ;
  RooMultiCatIter(const RooMultiCatIter& other) ;
  virtual ~RooMultiCatIter() ;

  // Iterator implementation
  virtual const TCollection* GetCollection() const ;
  virtual TObject* Next() ;
  virtual void Reset() ;
  virtual bool operator!=(const TIterator &aIter) const ;
  virtual TObject *operator*() const ;

protected:
  
  TIterator& operator=(const TIterator&) { return *this ; } // forbidden for now

  void initialize(const RooArgSet& catList) ;
  TObjString* compositeLabel() ;

  RooArgSet        _catList  ;   // Set of categories iterated over
  pTIterator*      _iterList ;   // Array of category type iterators 
  pRooCategory*  _catPtrList ;   // Array of pointers to original categories
  RooCatType*   _curTypeList ;   // List of current types
  Int_t _nIter ;                 // Number of categories/iterators in use
  Int_t _curIter ;               // Current location of master iterator
  TObjString _compositeLabel ;   //
  TString _rangeName ;           // Range name (optional)
  TObject* _curItem;             // Current item returned by Next()

  ClassDef(RooMultiCatIter,0) // Iterator over all state permutations of a list of categories
};

#endif
 RooMultiCatIter.h:1
 RooMultiCatIter.h:2
 RooMultiCatIter.h:3
 RooMultiCatIter.h:4
 RooMultiCatIter.h:5
 RooMultiCatIter.h:6
 RooMultiCatIter.h:7
 RooMultiCatIter.h:8
 RooMultiCatIter.h:9
 RooMultiCatIter.h:10
 RooMultiCatIter.h:11
 RooMultiCatIter.h:12
 RooMultiCatIter.h:13
 RooMultiCatIter.h:14
 RooMultiCatIter.h:15
 RooMultiCatIter.h:16
 RooMultiCatIter.h:17
 RooMultiCatIter.h:18
 RooMultiCatIter.h:19
 RooMultiCatIter.h:20
 RooMultiCatIter.h:21
 RooMultiCatIter.h:22
 RooMultiCatIter.h:23
 RooMultiCatIter.h:24
 RooMultiCatIter.h:25
 RooMultiCatIter.h:26
 RooMultiCatIter.h:27
 RooMultiCatIter.h:28
 RooMultiCatIter.h:29
 RooMultiCatIter.h:30
 RooMultiCatIter.h:31
 RooMultiCatIter.h:32
 RooMultiCatIter.h:33
 RooMultiCatIter.h:34
 RooMultiCatIter.h:35
 RooMultiCatIter.h:36
 RooMultiCatIter.h:37
 RooMultiCatIter.h:38
 RooMultiCatIter.h:39
 RooMultiCatIter.h:40
 RooMultiCatIter.h:41
 RooMultiCatIter.h:42
 RooMultiCatIter.h:43
 RooMultiCatIter.h:44
 RooMultiCatIter.h:45
 RooMultiCatIter.h:46
 RooMultiCatIter.h:47
 RooMultiCatIter.h:48
 RooMultiCatIter.h:49
 RooMultiCatIter.h:50
 RooMultiCatIter.h:51
 RooMultiCatIter.h:52
 RooMultiCatIter.h:53
 RooMultiCatIter.h:54
 RooMultiCatIter.h:55
 RooMultiCatIter.h:56
 RooMultiCatIter.h:57
 RooMultiCatIter.h:58
 RooMultiCatIter.h:59
 RooMultiCatIter.h:60
 RooMultiCatIter.h:61
 RooMultiCatIter.h:62
 RooMultiCatIter.h:63