Attaching tag/version # or string to TTree


Is there a smart way to add a version # (e.g. a string) to a root-tree so that people know the version of the code that was used to make the root-tuple?

The only simple thing I can think of is some modification of the root-tree title (I would like my code to accept pointers to root-trees as an argument, so it’d be better if I could modify the title of an existing root-tree). I could also add some other entity to the tree, but I have no idea how to do any of the above!

Thanks a lot.


You can encode your version number in the Tree title
or tree->SetUniqueID(myversion_number)

Hi Rene,

Thanks for the tip - I tried it & works as advertised.

Since I wanted to add a string (and not just an integer), I decided to implement something different:

  string _oldName = _root_tree->GetTitle();
  char _newName[1024]; 
  sprintf(_newName, "%s; cvs package vXX-YY-ZZ", _oldName);