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
- Break *** segmentation violation
Generating stack trace...
0x005ac0e3 in THashList::Delete(char const*) + 0x35 from
/usr/local/root/lib/libCore.so
0x00524e79 in TDirectory::~TDirectory() + 0x55 from
/usr/local/root/lib/libCore.so
0x005b23e7 in TObjectTable::Delete(char const*) + 0x27 from
/usr/local/root/lib/libCore.so
0x0059fad5 in TCollection::EmptyGarbageCollection() + 0x87 from
/usr/local/root/lib/libCore.so
0x0052f489 in TFile::Close(char const*) + 0x37d from
/usr/local/root/lib/libCore.so
0x0052e0cc in TFile::~TFile() + 0x3c from /usr/local/root/lib/libCore.so
0x00ff3f6a in TChain::LoadTree(long long) + 0x608 from
/usr/local/root/lib/libTree.so
0x04184a77 in lut::LoadTree(long long) + 0xa3 from
/home/sidoti/atlas/mufast/./test_C.so
0x04186e10 in lut::FitAll(int, int, int, bool, float, float) + 0x126
from /home/sidoti/atlas/mufast/./test_C.so
0x041889de in <unknown> from /home/sidoti/atlas/mufast/./test_C.so
0x0017fd5f in G__call_cppfunc + 0x2ad from /usr/local/root/lib/libCint.so
0x0016f204 in G__interpret_func + 0x70d from /usr/local/root/lib/libCint.so
0x00156b03 in G__getfunction + 0x1334 from /usr/local/root/lib/libCint.so
0x001e1f9b in G__getstructmem + 0x82a from /usr/local/root/lib/libCint.so
0x001db2e3 in G__getvariable + 0x4d6 from /usr/local/root/lib/libCint.so
0x0014ddd0 in G__getitem + 0x4ea from /usr/local/root/lib/libCint.so
0x0014caf9 in G__getexpr + 0x7065 from /usr/local/root/lib/libCint.so
0x00196de2 in G__exec_function + 0x1d5 from /usr/local/root/lib/libCint.so
0x0019daae in G__exec_statement + 0x23eb from
/usr/local/root/lib/libCint.so
0x00135c6b in G__exec_tempfile_core + 0x2ce from
/usr/local/root/lib/libCint.so
0x00135e48 in G__exec_tempfile_fp + 0x22 from
/usr/local/root/lib/libCint.so
0x001a5daa in G__process_cmd + 0x45f0 from /usr/local/root/lib/libCint.so
0x005b7b89 in TCint::ProcessLine(char const*,
TInterpreter::EErrorCode*) + 0xa9 from /usr/local/root/lib/libCore.so
0x005114a5 in TApplication::ProcessLine(char const*, bool, int*) +
0x66b from /usr/local/root/lib/libCore.so
0x003ce2e9 in TRint::HandleTermInput() + 0x1dd from
/usr/local/root/lib/libRint.so
0x003cd0ce in TTermInputHandler::Notify() + 0x24 from
/usr/local/root/lib/libRint.so
0x003ceb9e in TTermInputHandler::ReadNotify() + 0x12 from
/usr/local/root/lib/libRint.so
0x0064b005 in TUnixSystem::CheckDescriptors() + 0x143 from
/usr/local/root/lib/libCore.so
0x00649efb in TUnixSystem::DispatchOneEvent(bool) + 0x151 from
/usr/local/root/lib/libCore.so
0x00579774 in TSystem::InnerLoop() + 0x18 from
/usr/local/root/lib/libCore.so
0x00579719 in TSystem::Run() + 0x6f from /usr/local/root/lib/libCore.so
0x00511f86 in TApplication::Run(bool) + 0x32 from
/usr/local/root/lib/libCore.so
0x003cdde4 in TRint::Run(bool) + 0x3b2 from /usr/local/root/lib/libRint.so
0x080488dd in main + 0x71 from /usr/local/root/bin/root.exe
0x055e278a in __libc_start_main + 0xda from /lib/tls/libc.so.6
0x080487e1 in _Unwind_Resume + 0x31 from /usr/local/root/bin/root.exe
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