[Solved] Problem writing RooDataSet

Hi all,

I’m running the newest root version 5.34 and either I’m doing something completely wrong or I don’t understand the problem i have, cause I thought I used it the same way about a year ago…

I read a datafile with RooDataset and then just wanna write it back to another file (very easy example):

RooRealVar bt1("bt1","bt1",0.01,1.99,"s");
RooDataSet* data0=RooDataSet::read("cd130_events0",RooArgList(bt1));
[#1] INFO:DataHandling -- RooDataSet::read: reading file cd130_events0
[#1] INFO:DataHandling -- RooDataSet::read: read 2164 events (ignored 0 out of range events)

so far so good! but the writing always fails! What am I missing?

data0->Write("test.dat")
Error in <TROOT::WriteTObject>: The current directory (Rint) is not associated with a file. The object (test.dat) has not been written.
(Int_t)0

Thanks for your help!

okay sorry… it’s too late here in Japan, next time I should think before posting :smiley:

Error is very simple:
It has to be write() and not Write() (Not capital)!