(no subject)

From: Gunasingha Rathnayaka (phguna@feynman.phys.subr.edu)
Date: Thu Apr 10 2003 - 19:19:22 MEST


Hi,
	I am using ROOT 3.05/03 in a REDHAT 8.0 Linux PC. I have
 compiled this using source code. It looked it worked fine.

 I have a macro which runs fine in another machine which has
 ROOT 3.00/06. Code is at the end of this message. There is no
 way to mail the root data file, since it is too big to the roottalk
 mail server(80 MB).

 	When I tried the same code with ROOT 3.05/03 I get 
 following error. It seems this errors come when the
 statment 
	nbytes += EVENT->GetEvent(i);
 is added. 
 How can I get it fixed?

 Thanks,

 Gunasingha 

 email: phguna@feynman.phys.subr.edu


[grb]# root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   3.05/03     13 March 2003   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

FreeType Engine v2.1.3 used to render TrueType fonts.
Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.78, Mar 3 2003
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x read_root.C   

 *** Break *** segmentation violation
 Generating stack trace...
 0x40196b36 in TUnixSystem::StackTrace() + 0x36c from /cern/root/lib/libCore.so
 0x401956fa in TUnixSystem::DispatchSignals(ESignals) + 0x7a from /cern/root/lib/libCore.so
 0x4019490b in <unknown> from /cern/root/lib/libCore.so
 0x40198319 in <unknown> from /cern/root/lib/libCore.so
 0x40c3847e in <unknown> from /lib/i686/libpthread.so.0
 0x42028c48 in <unknown> from /cern/root/bin/root.exe
 0x40ade9e7 in TBranch::GetBasket(int) + 0xf7 from /cern/root/lib/libTree.so
 0x40adec6e in TBranch::GetEntry(int, int) + 0xbe from /cern/root/lib/libTree.so 0x40afc0db in TTree::GetEntry(int, int) + 0x8b from /cern/root/lib/libTree.so
 0x40b50a4a in TTree::GetEvent(int, int) + 0x20 from /cern/root/lib/libTree.so
 0x40b1173c in <unknown> from /cern/root/lib/libTree.so
 0x40551b55 in G__call_cppfunc + 0x261 from /cern/root/lib/libCint.so
 0x405423fc in G__interpret_func + 0x6dc from /cern/root/lib/libCint.so
 0x4052b09c in G__getfunction + 0x10e4 from /cern/root/lib/libCint.so
 0x405a899c in G__getstructmem + 0x77c from /cern/root/lib/libCint.so
 0x405a2b4a in G__getvariable + 0x4be from /cern/root/lib/libCint.so
 0x40524d27 in G__getitem + 0x46b from /cern/root/lib/libCint.so
 0x40523aa0 in G__getexpr + 0x735a from /cern/root/lib/libCint.so
 0x4051e581 in G__getexpr + 0x1e3b from /cern/root/lib/libCint.so
 0x4056be69 in G__exec_statement + 0x2569 from /cern/root/lib/libCint.so
 0x40568f88 in G__exec_loop + 0x23e from /cern/root/lib/libCint.so
 0x40569645 in G__exec_for + 0x18f from /cern/root/lib/libCint.so
 0x4056b94c in G__exec_statement + 0x204c from /cern/root/lib/libCint.so
 0x4050df70 in G__exec_tempfile_core + 0x2a2 from /cern/root/lib/libCint.so
 0x4050e14a in G__exec_tempfile + 0x22 from /cern/root/lib/libCint.so
 0x405732d9 in G__process_cmd + 0x3fb3 from /cern/root/lib/libCint.so
 0x4014f011 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0x9b from /cern/root/lib/libCore.so
 0x4014f100 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) + 0x46 from /cern/root/lib/libCore.so
 0x400d81ba in TApplication::ProcessFile(char const*, int*) + 0x81a from /cern/root/lib/libCore.so
 0x400d7929 in TApplication::ProcessLine(char const*, bool, int*) + 0x4ff from /cern/root/lib/libCore.so
 0x40c03b94 in TRint::HandleTermInput() + 0x11c from /cern/root/lib/libRint.so
 0x40c02b86 in TTermInputHandler::Notify() + 0x24 from /cern/root/lib/libRint.so 0x40c04336 in TTermInputHandler::ReadNotify() + 0x12 from /cern/root/lib/libRint.so
 0x40195a67 in TUnixSystem::CheckDescriptors() + 0xed from /cern/root/lib/libCore.so
 0x40195237 in TUnixSystem::DispatchOneEvent(bool) + 0x101 from /cern/root/lib/libCore.so
 0x401234a1 in TSystem::InnerLoop() + 0x1b from /cern/root/lib/libCore.so
 0x4012343a in TSystem::Run() + 0x78 from /cern/root/lib/libCore.so
 0x400d83d9 in TApplication::Run(bool) + 0x2d from /cern/root/lib/libCore.so
 0x40c03768 in TRint::Run(bool) + 0x2e4 from /cern/root/lib/libRint.so
 0x08048782 in main + 0x6e from /cern/root/bin/root.exe
 0x420158d4 in __libc_start_main + 0xa4 from /cern/root/bin/root.exe
 0x08048685 in _Unwind_Resume + 0x31 from /cern/root/bin/root.exe
Root > 


============================================================================
CODE
=============================================================================

// read_root.C

{

// Open ROOT file
  TFile *f = new TFile("FDS-71-122-12-01.root");

// Read Tree named "EVENT" in memory. 
// Tree pointer is assigned the same name.
  TTree *EVENT = (TTree *)f->Get("EVENT");

// Access each branch
  TBranch *b1 = (TBranch *)EVENT->GetBranch("TIME")   ;
  TBranch *b2 = (TBranch *)EVENT->GetBranch("ESI")    ;
  TBranch *b3 = (TBranch *)EVENT->GetBranch("ESCN")   ;
  TBranch *b4 = (TBranch *)EVENT->GetBranch("EBGO")   ;
  TBranch *b5 = (TBranch *)EVENT->GetBranch("TSUM")   ;
  TBranch *b6 = (TBranch *)EVENT->GetBranch("LSUM")   ;
  TBranch *b7 = (TBranch *)EVENT->GetBranch("LMAX")   ;
  TBranch *b8 = (TBranch *)EVENT->GetBranch("TRACK")  ;
  TBranch *b9 = (TBranch *)EVENT->GetBranch("TRACK2") ;

// Variables for Tree
  UInt_t  time ;
  Float_t esi[80][56] ;
  Float_t escn[3][2][42] ;
  Float_t ebgo[8][40] ;
  Float_t tsum ;
  Float_t lsum[15] ;
  Float_t lmax[15] ;
  Float_t track[6][2][3] ;
  Float_t track2[2][2][4] ;

// Set addresses
  b1->SetAddress(&time);
  b2->SetAddress(&esi[0][0]);
  b3->SetAddress(&escn[0][0][0]);
  b4->SetAddress(&ebgo[0][0]);
  b5->SetAddress(&tsum);
  b6->SetAddress(&lsum[0]);
  b7->SetAddress(&lmax[0]);
  b8->SetAddress(&track[0][0][0]);
  b9->SetAddress(&track2[0][0][0]);

// Event loop
  Int_t i ;
  Int_t nbytes = 0 ;
  Int_t nentries = EVENT->GetEntries() ;

   cout<<nentries<<endl;

  for(i= 0; i< nentries; i++) {

//	 cout<<i<<endl;

   nbytes += EVENT->GetEvent(i);

 //cout<<tsum<<endl;

  }

// Close ROOT file
  f->Close();
}



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET