liuk
October 2, 2007, 6:35pm
1
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:
RooFit v2.11 – Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2005 NIKHEF, University of California & Stanford University
All rights reserved, please read roofit.sourceforge.net/license.txt
Error in TBasket::Create : Cannot create key without file
Error in TTree::Fill : Failed filling branch:data.x, nbytes=-1
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
TTree *T = new TTree(…)
TFile *f = new TFile(…)
you should do:
TFile *f = new TFile(…)
TTree *T = new TTree(…)
Error in TBasket::Create : Cannot create key without file
Error in TTree::Fill : Failed filling branch:data.x, nbytes=-1
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
TTree *T = new TTree(…)
TFile *f = new TFile(…)
you should do:
TFile *f = new TFile(…)
TTree *T = new TTree(…)
Error: Symbol G__exception is not defined in current scope fit.C:71:
Error: type G__exception not defined FILE:/home/liuk/workshop/temp/test/RooFit/./fit.C LINE:71
*** Interpreter error recovered ***
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