manoj
February 12, 2013, 4:40pm
1
Hello Rooters,
While adding root file in TChain, I got this error:
Warning in <TStreamerInfo::Compile>: Counter fNClusterRange should not be skipped from class TTree
Because of this (I guess), the program crashes when I do
chain->SetBranchAddress("x", &x, &b_x);
and read the entries. It does not crash if I remove the above line.
Any suggestion how to fix this error? I am using root 5.26/00d.
Thanks.
manoj
February 12, 2013, 6:28pm
2
Ok, I am no longer getting warning after updating to root 5_34. However, I am still facing crashing problem. The minimum code is:
void plot()
{
TChain *chain = new TChain("tree");
chain->Add("out.root");
int nEvent = chain->GetEntries();
int id;
TBranch *b_id;
chain->SetBranchAddress("id", &id, &b_id);
for(int i=0; i<nEvent; i++) {
cout << chain->GetEntry(i) << endl;;
}
}
It crashes. However, I can load the root file interactively and scan the branches, works fine. Also, it works fine with
chain->Draw("id >> h(200, 0, 2000)");
It crashes due to the line
chain->SetBranchAddress("id", &id, &b_id);
Any help?
Thanks.
In the end of your “void plot()” (just before doing “return”), try to add:
chain->ResetBranchAddresses();
manoj
February 12, 2013, 6:54pm
4
Thanks for reply. Unfortunately, it does not work.
Try (post the output here):
root [0] TFile *f = TFile::Open(“out.root”);
root [1] f->ls();
root [2] tree->Print();
manoj
February 12, 2013, 8:09pm
6
f->ls gives
KEY: TTree tree;1 tree
tree.Print() gives
*............................................................................*
*Br 17 :id : id[id]/I *
*Entries : 80001 : Total Size= 2062408 bytes File Size = 222186 *
*Baskets : 75 : Basket Size= 32000 bytes Compression= 9.27 *
*............................................................................*
manoj
February 12, 2013, 9:28pm
8
[color=#FF0000][/color] WTF WTF[color=#FF0000] [/color]