Hello Rooters,
I am trying to print all entries from a branch. But the program crushes with a "*** Break *** segmentation violation"
after it finished printing all numbers.
I already checked the variable “cl_eta_topo_em” in the ntuple and it is definetly a “float”.
What I found out is that if I declare my variable “eta_cl” as a float ARRAY with size>4 and always print the first entry of the array (eta_cl[0]) then it works!!
I don’t understand this behaviour, can anybody explain what is happening?
Thank you very much for your help!
Cheers,
Gerolf
PS: I am using ROOT 4.01/02
void test()
{
TFile * f = TFile::Open("ntuple/r2101257.root");
f->cd("TB");
float eta_cl;
tree->SetBranchAddress("cl_eta_topo_em",&eta_cl);
for(int i=1;i<400;i++){
tree->GetEntry(i);
printf("%f \n",eta_cl);
}
}