RooFit: Cannot use cut formula when creating a RooDataSet

I want to create a RooDataSet from a TTree, with a selection cut string. But the created RooDataSet would have zero entries. The following macro demonstrate the problem:

{
  gROOT->Reset();

  // create a test tree
  f=new TFile("t1.root","recreate");
  t = new TTree("t","t");
  Float_t v1,v2;
  t.Branch("v1",&v1);
  t.Branch("v2",&v2);
  for(int i=0; i < 10; ++i ){
    v1 = v2 = i;
    t.Fill();
  }
  t.Write();
  delete f;

//////////////////

  f = new TFile("t1.root");
  t = gettree("t");

  RooRealVar rv1("v1","v1",0,10);
  RooRealVar rv2("v2","v2",0,10);

  RooArgSet varset;
  varset.add(rv1);
  varset.add(rv2);

  // try to create with a cut
  rd = new RooDataSet("rd","rd",t,varset,"v1 > 5");
  cout<< rd.numEntries() <<endl; // WRONG, numEntries() returns 0
}

Do I do something wrong?

Hi,

Thanks for reporting this. It turns out this is a bug that was introduced in a recent
reorganization of RooFit data classes. A fix has been applied in RooFit 3.10
(in ROOT 5.25./02), which is out today.

Wouter