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"
22class RooCategory ;
23class RooCatType ;
25
28
29class RooMultiCatIter : public TIterator {
30public:
31 // Constructors, assignment etc.
32 RooMultiCatIter(const RooArgSet& catList, const char* rangeName=0) ;
33 RooMultiCatIter(const RooMultiCatIter& other) ;
34 ~RooMultiCatIter() override ;
35
36 // Iterator implementation
37 const TCollection* GetCollection() const override ;
38 TObject* Next() override ;
39 void Reset() override ;
40 bool operator!=(const TIterator &aIter) const override ;
41 TObject *operator*() const override ;
42
43protected:
44
45 TIterator& operator=(const TIterator&) override { 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// ClassDefOverride(RooMultiCatIter,0) // Iterator over all state permutations of a list of categories
61};
62
63#endif
RooAbsCategoryLValue * pRooCategory
TIterator * pTIterator
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
RooCategory is an object to represent discrete states.
Definition: RooCategory.h:28
TObject * Next() override
Iterator increment operator.
pTIterator * _iterList
RooCatType * _curTypeList
TIterator & operator=(const TIterator &) override
~RooMultiCatIter() override
Destructor.
void Reset() override
Rewind master iterator.
pRooCategory * _catPtrList
bool operator!=(const TIterator &aIter) const override
Comparison operator to other iterator Returns true if both iterator iterate over the same set of inpu...
const TCollection * GetCollection() const override
Dummy implementation, always returns zero.
RooMultiCatIter(const RooArgSet &catList, const char *rangeName=0)
Construct iterator over all permutations of states of categories in catList.
TObjString * compositeLabel()
Construct string with composite object label corresponding to the state name of a RooMultiCategory or...
RooArgSet _catList
TObject * operator*() const override
Return current item (dummy)
void initialize(const RooArgSet &catList)
Build iterator array for given catList.
TObjString _compositeLabel
TObject * _curItem
Collection abstract base class.
Definition: TCollection.h:65
Iterator abstract base class.
Definition: TIterator.h:30
Collectable string class.
Definition: TObjString.h:28
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136