ChangeFile() seg. violation?

From: Christopher Doran <cdoran_at_ncdf78.fnal.gov>
Date: Wed, 29 Jun 2005 10:44:34 -0500 (CDT)


Hello there,
First off, I am using version 3.05/07. I am trying to chain together a large number of large files (i.e. ~400 files at ~300MB each), create a tree that is a condensed version of the one in the chained files, and fill that tree with the data from the files.

I know the code works for a tree smaller than the max tree size. Now, I'm trying to run it over the entire data set. After spending a long time filling the tree, Fill() automatically created a second output file. I hadn't read about the ChangeFile() method yet so I was suprised but happy. Then, 5 seconds later, I got a segmentation violation. The first file filled up at about 1.9 GB but nothing made it into the second file.

I've run it again and received the same error. Then I found the ChangeFile() method and tried to implement it manually when the tree reached a much smaller size. If there were any file size or space issues, that should've taken care of it. However, I still get the segmentation violation error after running it over a chain of only ten files. Here's what I'm trying to do:

   Int_t nentries = Int_t(fChain->GetEntries());    Int_t nbytes = 0, nb = 0;

   TFile *myFile1 = new TFile("condensed.root","recreate");    TTree t1("T", "QCD Condensed Ntuple");
.
.
.

   //creating lots of branches, nothing interesting
.
.
.

   for (Int_t jentry=0; jentry<nentries;jentry++) {

      	nb = fChain->GetEntry(jentry);  
        nbytes += nb;

      	t1.Fill();

	if(nbytes > 10000000){
		t1.ChangeFile(myFile1);  //added this after first error
		nbytes = 0;
	}
   }            //--- loop over events

   myFile1 = t1.GetCurrentFile(); //added this after first error    myFile1->Write();
   myFile1->Close();

Can anyone tell me what's going wrong? Also, what is the maximum tree size for version 3.05/07 and is there a maximum file size? Thanks a lot for any help, this is my first post and I'm pretty new to ROOT!

Chris Doran
SULI Student, FNAL
DePauw University Received on Wed Jun 29 2005 - 17:45:03 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET