Free() error when macro returns

Hi I have a ROOT macro that always gives me the following error when
it returns:

*** glibc detected *** free(): invalid next size (fast): 0x093e0828 ***

This also causes ROOT to crash which is the main problem, sometimes it
hangs and I am trying to run this in a batch system as part of a
larger script. I cannot for the life of me figure out what is causing
this. Any help would be much appreciated. I have attached the script
but i believe it may be too long to debug. I am using ROOT 5.08.00b
and 5.02.00 on the batch nodes. Thanks in advance for any
help/illumination.

P.S. I hav a strong suspicion that this is related somehow to
building an index with a TChain but I am just not sure…


Loren A. Linden Levy
481 Loomis, Department of Physics
University of Illinois at Urbana-Champaign
1110 W. Green St., Urbana, IL 61801-3080
Tel: 217-244-7995 Fax: 217-333-1215
Email: lindenle@uiuc.edu
url: w3.physics.uiuc.edu/~lindenle/


yield_x_z.C (15.5 KB)

You have many compilation errors in your script. To see them, I suggest to do
root > .L yield_x_z.C+

Rene

Hi Rene,

Thanks for your quick reply, I had never actually tried to compile the script. I have one question though. Why is this error showing up:

yield_x_z.C:251: error: ‘semiInclusiveYield’ cannot be used as a function

for the line:

semiInclusiveYield(PIPLUS, ixzBins+iz)+=csbpweight[abs(itype)-3];

Where semiInclusiveYield is a TMatrixF. Am I doing something wrong here?

I cannot go further with your file. You did not send all the material,
eg file binning.C, fiducial_check.C, etc

In your witch/case block, change, eg

case 1: Float_t eventFidData[2]; E->SetBranchAddress("thx",&eventFidData[0]); E->SetBranchAddress("thy",&eventFidData[1]); Float_t trackFidData[2]; T->SetBranchAddress("thx",&trackFidData[0]); T->SetBranchAddress("thy",&trackFidData[1]); break; to

case 1: { Float_t eventFidData[2]; E->SetBranchAddress("thx",&eventFidData[0]); E->SetBranchAddress("thy",&eventFidData[1]); Float_t trackFidData[2]; T->SetBranchAddress("thx",&trackFidData[0]); T->SetBranchAddress("thy",&trackFidData[1]); break;}

Also change

TTree * T = file->Get("trackTree"); TTree * E = file->Get("eventTree"); to

TTree * T = (TTree*)file->Get("trackTree"); TTree * E = (TTree*)file->Get("eventTree");

Rene

Actually I really want to use the TChain code that is commented out. I only commented it out b/c i was trying to see if the build index across multiple files was causing my problem. I have attached all the codes this time. And I have made the change you suggested for the switch statement.

Alex
yield_x_z.C (15.5 KB)
fiducial_check.C (1.16 KB)
binning.C (852 Bytes)