Crash in LoadTree

From: Antonio Sidoti(Roma) <antonio.sidoti_at_roma1.infn.it>
Date: Thu, 28 Jul 2005 18:59:28 +0200


Hello,
I have a problem looping on a TChain containing two or more root files. My macro is a test macro (not very different from the one obtained from the MakeClass function with just some cout added). Everything is almost OK if I run on a TChain made with just one file. "Almost" because I get a segmentation violation when I quit root (root> .q). If I run on a TChain that contains two or more files I get a segmentation violation while I finish to read the first file. It doesn't seem to me that these root files are corrupted (I can load them, draw variables from TTree, etc...). I attach a piece of log file. I am using root 4.04/02. What should I do to fix that ? I attach also my script code (test.C). Best Regards,
Thanks a lot,
Antonio

(...)
Entry:18937
Loading Tree
PIPPO Load Tree
PIPPO 1  

cat test.C

#define lut_cxx
#include "test.h"
#define DEBUG

using namespace std;
//#define M_PI 3.14592654

void lut::FitAll(Int_t stphi, Int_t steta, Int_t iadd, Bool_t verb, Float_t muphi, Float_t mueta){
  if (fChain == 0) return;
  Long64_t nentries = fChain->GetEntriesFast();   Int_t nbytes = 0, nb = 0;
  cout << "Total of " << nentries << " entries" << endl;   for (Long64_t jentry=0; jentry<nentries;jentry++) { // 1st loop on events     cout << "Loading Tree" << endl;
    Long64_t ientry = LoadTree(jentry);
    if (ientry < 0) break;
    nb = fChain->GetEntry(jentry); nbytes += nb;     cout << "file Name:" << endl;
    //fChain->GetCurrentFile()->Print();
    cout << "file Name:" << fChain->GetCurrentFile()->GetName() << endl;
    cout << endl;
    cout << "Entry:" << jentry << endl;
    cout << "CICCIO " << fChain->GetTree()->GetEntries() << endl;
  

  cout << "End first loop on events" << endl; } Received on Thu Jul 28 2005 - 19:00:23 MEST

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