Skip to content
Snippets Groups Projects
Commit 26eb7015 authored by Rene Brun's avatar Rene Brun
Browse files

Because I was tired to always answer this question:

Dear rooters,

sometimes, while filling a TTree, I encountered this message:

Error in <TTree::Fill>: Failed filling branch:matches.matches, nbytes=-1

can someone explain me what does it mean? What mistake did I do while creating the code to fill that TTree?

I decided to systematically print this message in addition to the existing message
 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(...)


git-svn-id: http://root.cern.ch/svn/root/trunk@15603 27541ba8-7e3a-0410-8455-c3a389f83636
parent d04e3ff7
No related branches found
No related tags found
No related merge requests found
// @(#)root/tree:$Name: $:$Id: TTree.cxx,v 1.289 2006/06/25 14:14:11 pcanal Exp $
// @(#)root/tree:$Name: $:$Id: TTree.cxx,v 1.290 2006/06/27 14:36:28 brun Exp $
// Author: Rene Brun 12/01/96
/*************************************************************************
......@@ -2753,6 +2753,15 @@ Int_t TTree::Fill()
nbytes += (nwrite = branch->Fill());
if ( nwrite < 0 ) {
Error("Fill","Failed filling branch:%s.%s, nbytes=%d",GetName(),branch->GetName(),nwrite);
if (nerror < 2) {
printf(" This error is symptomatic of a Tree created as a memory-resident Tree\n");
printf(" Instead of doing:\n");
printf(" TTree *T = new TTree(...)\n");
printf(" TFile *f = new TFile(...)\n");
printf(" you should do:\n");
printf(" TFile *f = new TFile(...)\n");
printf(" TTree *T = new TTree(...)\n");
}
nerror++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment