Failed filling branch (via RooFit)

Hello,
I’m getting errors like this when trying to fit:

Error in TTree::Fill: Failed filling branch:datad0_signal.delMass, 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(…)

My code:


#include <math.h>

gSystem->Load(“libRooFit.so”);

TFile signal_file = TFile("…/rootfiles/dgammagammaAllRuns.root");
TFile ccbar_file = TFile("…/rootfiles/ccbar.root");

TTree signal_tree = (TTree) signal_file.Get(“WithDStarTag”);
TTree ccbar_tree = (TTree) ccbar_file.Get(“WithDStarTag”);

RooRealVar delMass(“delMass”, “delMass”, 0.14, 0.152);
delMass.setBins(48);
using namespace RooFit;
RooArgSet ntupleVarSet(delMass);

RooDataSet *datasignal = new RooDataSet(“datad0_signal”, "full signal dataset ", signal_tree, ntupleVarSet);


I’ve tried the suggestion, and TFile is defined first. I’ve tried declaring it as a pointer and as a non-pointer. This error seems innocuous, but it’s rather annoying. Any idea?

Thanks,
James

I ended up suppressing the error messages by modifying the source. I’m sure this is not the best idea, but if anyone knows of a way to get rid of these errors, please let me know.

James

[quote]I ended up suppressing the error messages by modifying the source. [/quote]Which source did you modify? How did you modify it?

[quote] This error is symptomatic of a Tree created as a memory-resident Tree [/quote]Actually, it is usually more indicative of a TTree being attached to a read only file (and/or a full partition).

Cheers,
Philippe

I modified my local tree/src/TTree.cxx file.

I think this is my case. So I can just ignore this error. Is there a way to open it as read/write?

Hi,

This is somewhat strange :slight_smile:. The TTree created by RooDataSet should be in memory (and hence if your input is large, you could actually be running out of memory) …

The method to look at (and eventually modify) is RooTreeData::createTree …

Philippe

Hello Philippe,

This might explain why I have had my script (I think) crash my computer on my home computer. But what exactly are you proposing I modify? I’ve removed the error message from the other file, and it gets rid of this repeated message.

James

[quote]This might explain why I have had my script (I think) crash my computer on my home computer. But what exactly are you proposing I modify? I’ve removed the error message from the other file, and it gets rid of this repeated message.
[/quote]You could modify to write to a temporary file of your choice instead of the memory …

Cheers,
Philippe

I’ll look into it. But wouldn’t this be a common occurance? Shouldn’t this be changed in CVS anyways. At least maybe the error message should be rewriten?

No, they are indicative of a real problem (I still don’t know exactly which in your case).

[quote]Shouldn’t this be changed in CVS anyways.[/quote]Possibly. Hopefully Wouter will be able to take a look.

Cheers,
Philippe.

Hi,

I’ll have a look. I’ll send a more substantive reply shortly.

Wouter