Hi rooters,
I have the following problem filling a TTree ,
does someone
I have a program (fusgamma_OneRing.cxx)
which reads one Tree of data, makes an analysis
and puts the output in 5 different Tree .
TFile *outtree = new TFile(outfile,āRECREATEā);
TTree *outT = new TTree(āh1_gamā,āreduced_dataā);
TFile *outtree1 = new TFile(outfile1,āRECREATEā);
TTree *outT1 = new TTree(āh1_gam1ā,āreduced_dataā);
.
.
.
outT->Branch(āmulfuā,&mulfu,āmulfu/Iā);
outT->Branch(āmulfiā,&mulfi,āmulfi/Iā);
outT->Branch(ābaffuā,baffu,ābaffu[mulfu]/Iā);
outT->Branch(ābaffiā,baffi,ābaffi[mulfi]/Iā);
outT->Branch(āenfusā,enfus,āenfus[mulfu]/Dā);
outT->Branch(āenfisā,enfis,āenfis[mulfi]/Dā);
outT->Branch(ālibfusā,&libfus,ālibfus/Iā);
outT->Branch(ālibfisā,&libfis,ālibfis/Iā);
outT1->Branch(āmulfu1ā,&mulfu1,āmulfu1/Iā);
outT1->Branch(āmulfiā,&mulfi,āmulfi/Iā);
outT1->Branch(ābaffu1ā,baffu1,ābaffu1[mulfu1]/Iā);
outT1->Branch(ābaffiā,baffi,ābaffi[mulfi]/Iā);
outT1->Branch(āenfus1ā,enfus1,āenfus1[mulfu1]/Dā);
outT1->Branch(āenfisā,enfis,āenfis[mulfi]/Dā);
outT1->Branch(ālibfus1ā,&libfus1,ālibfus1/Iā);
outT1->Branch(ālibfisā,&libfis,ālibfis/Iā);
.
.
.
outT->Fill();
outT1->Fill();
.
.
.
I compiled the makefile and the program seemed to work.
But for one of the two systems which I want to analyze
I got this error
Error in TTree::Fill: Failed filling branch:h1_gam3.libfus3, 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 TTree::Fill: Failed filling branch:h1_gam3.libfis, nbytes=-1
Error in TTree::Fill: Failed filling branch:h1_gam4.mulfu4, nbytes=-1
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
Then, I added a line outT->SetAutoSave(600000000);
for each Tree
(trying to increase the AutoSave)
TFile *outtree = new TFile(outfile,āRECREATEā);
TTree *outT = new TTree(āh1_gamā,āreduced_dataā);
outT->SetAutoSave(600000000);
but now when I run my program I get again the same error
Any other suggestions ?
Thanks in advance,
R.