Brahms, Thanks for all of the suggestions. The code works now. Bjorn, you were right. Djamel your suggestion would work to since I just needed a place to dump the memory allocated for the ntuple. Erik -----Original Message----- From: brahms-dev-l-bounces@lists.bnl.gov on behalf of Bjorn H Samset Sent: Fri 4/30/2004 5:05 AM To: BRAHMS Software list Cc: Subject: RE: [Brahms-dev-l] root error On Fri, 30 Apr 2004, Johnson, Erik B wrote: > Bjorn, > Thanks for the info. Here is what I'm doing with the ntulpe. I fill > it in a module. > > Aye, I think I've seen this before. What happens is that you open an ntuple in some unspecified place in ROOTs directory structure, i.e. not linked to a file. Then, when the tree goes over some size, it tries to write itself to file but doesn't know which file to write to. The fix, at least for me, was to do the following: MyClass::Begin() { f = new TFile(); f->cd(); nt = new TNtuple(); } MyClass::Event() { nt->Fill(); } MyClass::Finish() { f->cd(); nt->Write(); f->Close(); } I.e. the same as you do, just in a different order. Try it and see :-) -- Bjorn H. Samset Phone: 22856465/92051998 PhD student, heavy ion physics Adr: Schouterrassen 6 Inst. of Physics, University of Oslo 0573 Oslo \|/ ----------------------------> -*- <----------------------------- /|\ _______________________________________________ Brahms-dev-l mailing list Brahms-dev-l@lists.bnl.gov http://lists.bnl.gov/mailman/listinfo/brahms-dev-l _______________________________________________ Brahms-dev-l mailing list Brahms-dev-l@lists.bnl.gov http://lists.bnl.gov/mailman/listinfo/brahms-dev-lReceived on Fri Apr 30 07:07:58 2004
This archive was generated by hypermail 2.1.8 : Fri Apr 30 2004 - 07:08:15 EDT