00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooMultiCatIter.h,v 1.14 2007/05/11 09:11:30 verkerke Exp $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 #ifndef ROO_MULTI_CAT_ITER 00017 #define ROO_MULTI_CAT_ITER 00018 00019 #include "Riosfwd.h" 00020 #include "TIterator.h" 00021 #include "RooArgSet.h" 00022 #include "TObjString.h" 00023 class RooCategory ; 00024 class RooCatType ; 00025 00026 typedef TIterator* pTIterator ; 00027 typedef RooAbsCategoryLValue* pRooCategory ; 00028 00029 class RooMultiCatIter : public TIterator { 00030 public: 00031 // Constructors, assignment etc. 00032 RooMultiCatIter(const RooArgSet& catList, const char* rangeName=0) ; 00033 RooMultiCatIter(const RooMultiCatIter& other) ; 00034 virtual ~RooMultiCatIter() ; 00035 00036 // Iterator implementation 00037 virtual const TCollection* GetCollection() const ; 00038 virtual TObject* Next() ; 00039 virtual void Reset() ; 00040 virtual bool operator!=(const TIterator &aIter) const ; 00041 virtual TObject *operator*() const ; 00042 00043 protected: 00044 00045 TIterator& operator=(const TIterator&) { return *this ; } // forbidden for now 00046 00047 void initialize(const RooArgSet& catList) ; 00048 TObjString* compositeLabel() ; 00049 00050 RooArgSet _catList ; // Set of categories iterated over 00051 pTIterator* _iterList ; // Array of category type iterators 00052 pRooCategory* _catPtrList ; // Array of pointers to original categories 00053 RooCatType* _curTypeList ; // List of current types 00054 Int_t _nIter ; // Number of categories/iterators in use 00055 Int_t _curIter ; // Current location of master iterator 00056 TObjString _compositeLabel ; // 00057 TString _rangeName ; // Range name (optional) 00058 TObject* _curItem; // Current item returned by Next() 00059 00060 ClassDef(RooMultiCatIter,0) // Iterator over all state permutations of a list of categories 00061 }; 00062 00063 #endif