[ROOT] TTree->Fill() seg. fault

From: Mark Messier (messier@indiana.edu)
Date: Wed Dec 18 2002 - 00:53:32 MET


Hi Folks,

I'm running into a seg. fault during TTree->Fill(). I've attached a simple 
root macro which demonstrates my problem. Test conditions are in the 
comments:

//
// Demonstrate TTree::Fill seg. fault
//
// Using: RedHat Linux 8.0 (2.4.18-18.8.0)
//        gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
//        root 3.04.01
//
// this macro gives a seg fault at t->Fill();
// However, using root 3.03.07 (all others the same) this works without 
// problems.
//
// messier@indiana.edu
{
TFile* f = new TFile("events.root","RECREATE");
TTree* t = new TTree("t","EDMEvent tree");
if (t==0) abort();
if (f==0) abort();
std::cerr << "File and tree open." << std::endl;

// For simplicity just try a 1d histogram instead of something more
// compilcated
TH1F*  e = new TH1F("e","e",20,0.0,1.0);
t->Branch("EventBranch","TH1F",&e,64000,99);

for (int i=0; i<10; ++i) {
  std::cerr << "Fill::" << std::endl;
  t->Fill();
  std::cerr << "Done.\n" << std::endl;
}
f->Write();
f->Close();
}
// == end macro

Any ideas about what I might be doing wrong?

Thanks,
Mark



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:24 MET