Double Arrays

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)

[quote] 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[/quote]ROOT 4.04/04 is newer than 4.02/00. So I suspect that the problem has been solved.

Philippe.

Unfortunately I need to process all of the data on the Linux boxes, and 4.02.00 is the newest version available for them. The OS X box is only for writing and testing the code, hence the need to find a solution for 4.02.00.

Thanks.

If you have to work with 4.02/00 then you simply have to use ACliC to compile your code. You will need to add the appropriate header include (TTree.h, TFile.h, Riostream.h). You also have to remove the gROOT->Reset(); it should never be used from with a function (it’s purpose is to clean the environment, including, possibly, unloading the function you are executing!)

Cheers,
Philippe