A Problem with Memory-resident TTree

Hi, ROOTers.

I recently updated my ROOT from v5.14 to v5.16, and I find some of my programs, which worked all correctly under ROOT v5.14, do not work any more. These programs all contain codes like this:

void fit(void)
{
...

TFile *datafile = new TFile("data.root", "READ");
TTree *mytree = (TTree *)datafile->Get("save");

Double_t theta;
mytree->SetBranchAddress("theta", &theta);

RooRealVar x("x", "x", 0, -1, 1);
RooDataSet data("data", "data", RooArgSet(x));

Int_t i;

for(i = 0; i < mytree->GetEntries(); i++)
{
    mytree->GetEntry(i);
    x = theta;
    data.add(RooArgSet(x));
}

...
}

ROOT v5.16 gives following error messages:

Even if I added TFile *temp = new TFile("temp.root", "recreate") before the RooDataSet ..., the problem still occurs. Is there any changes in the corresponding aspects of ROOT from v5.14 to v5.16? And how can I fix this problem?

Thanks very much in advance.

Hi,

This problem has been fixed in ROOT 5.17

Wouter