Iterating over RooArgSet

Dear PyRoot experts,

I have some trouble iterating over the contents of a RooArgSet. The code below gives an example:

#!/usr/bin/env python
import ROOT as root

f0b=root.RooRealVar("f0b","sigma",200,0.0,300.0);
f1b=root.RooRealVar("f1b","alpha",0,-0.05,2.0);

args = root.RooArgSet(f0b,f1b)
args.Print()
iter = args.createIterator()
while iter :
    print iter.GetName()
    iter.Next()

The output of this looks like this:

RooArgSet:: = (f0b,f1b)
f0b
f0b
f1b
f1b
f1b
.....

The biggest problem is that it appers that the iterator does not reach the end of the list. I’m also confused why the first entry appears twice.
How is this supposed to work?

Yours
Matthias

So it seems that I’ve solved my own problem. The following iterates correctly:

#!/usr/bin/env python

import ROOT as root

f0b=root.RooRealVar("f0b","sigma",200,0.0,300.0);
f1b=root.RooRealVar("f1b","alpha",0,-0.05,2.0);

args = root.RooArgSet(f0b,f1b)
args.Print()
iter = args.createIterator()
var = iter.Next()
while var :
    print var.GetName()
    var = iter.Next()