I’m having some rather odd problems with double arrays in ROOT. What follows is a simplified example of some of the problems that I have been having. All of these problems occur on 4.02/00 running on a Linux box, but they vanish when the code is run on 4.04/04 running on OS X.
I’ve attached the sample code, but unfortunately the data file is much to large to add as an attachment.
As is the code does not recognize the declaration of PN_P[10] as an array, so it will seg fault when an address is accessed. One “fix” to this is to insert a cout statement between the two
Float_t PN_Pulse[10][50];
cout << "" << endl;
Float_t PN_P[10];
The PN_P array will then be accessed fine, but the program will seg fault once it finishes. The other is to remove the retrieval of the ntuple data by commenting out
input_data->SetBranchAddress("PN_Pulse_Raw", &PN_Pulse);
The program will run fine and end with no problems. Unfortunately I need to access this data so it’s a very viable work around.
Am I missing a complexity with using double arrays or am I making a more obvious mistake?
Thanks for any help.
test.c (614 Bytes)