Delete RooObject in RooWorkspace

Hi Root Experts,

I need to delete something from a RooWorkspace, but it is difficult to remove it permanently.

Following this support thread[1], I thought that I would be able to do this [2]. After doing [2], I can “.ls” and myRooObject is gone. However, when I close and open the file, myRooObject has returned.

How can I delete something in the workspace?




root [0] TFile f = TFile(“myfile.root”, “UPDATE”)
root [1] myws->cd()
root [2] gDirectory->Delete("myRooObject)

Try: gDirectory->Delete(“myRooObject;*”);
If it helps, see and/or