Hey,
So I compile root on a formal compiler (scons). The issue I am having is retrieving information from a TTree branch containing a C/C++ array. When I look into the branch in the cint root interface all of the data is there; however, when I try to do the same on the compile I get random numbers (as though the values of the variables were never set. Consider this code (assuming I did everything else beforehand correctly):
int main()
{
TTree * rEvent = NULL;
TREE * Event = new TREE(rEvent);
for(int x = 0; x < rEvent->GetEntries(); x++)
{
Event->GetEntry(x);
for(int y = 0; y < Event->nTracks; y++)
cout << Event->q[y] << '\t' << y << '\t' << x << endl;
cout << endl;
}
return 0;
}
Where:
“TREE” is a class generated by root from the method TTree::MakeClass(char*)
nTracks is a member of “TREE”
q[5] is a member of “TREE” (note that there is a maximum of 5 elements in the array)
*There are a lot of events in the file it reads