Removing RooDataSet from RooWorkspace

Dear ROOT experts,

is there a way of removing a RooDataSet that is contained in a RooWorkspace?
My code (a quite large workflow, that I can’t very easily change) produces a workspace with a huge dataset. I want to store all the information contained in the workspace but the dataset into a file, so I thought the easiest way of doing so would be to store the complete workspace after having removed the dataset from it.

I have tried things like:

w.data(“data”).IsA().Destructor(w.data(“data”))

However, when I try to do things like w.Print() it crashes when trying to read the dataset “data”… Also doing afterwards

w.RecursiveRemove(“data”)

crashes, as the object “data” does not exist anymore.

Is there a way of properly doing this?

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.