Manipulating tree->GetUserInfo()

Dear ROOT experts,

I would like to

  • open a ROOT file which contains a tree
  • manipulate the GetUserInfo() list of that tree
  • save these changes to the same ROOT file

I can do this but get another “instance” (?) of the tree in the file after each such operation:

root [2] .ls TDirectoryFile* utm utm (UTM) folder KEY: TTree t;7 t KEY: TTree t;6 t KEY: TTree t;5 t KEY: TTree t;4 t KEY: TTree t;3 t KEY: TTree t;2 t KEY: TTree t;1 t

All I do is

after manipulating the user info list of the tree. Is there any way to do this without these extra “copies” (what are they? the size of the file grows but only by a little bit)?

Thanks,

Philipp

When you save your Tree header to the file, use the option kWriteDelete.
see doc of TObject::Write

Rene

Thanks, works as advertised! :slight_smile:

Best, Philipp