How to modify TTree entry?

Please, explain the next question.

I’d like to load TTree, modify some entries (with predefined entry index)and save again.
I’s not clear for me how to modify entry.

Thanks!

Hi,

TTree are designed as a write-once, read-many type of persistent container. It is practically impossible to modify existing entry.

You can other either make a modify copy of your TTree (see $ROOTSYS/tutorials/copytree*.C) or create a new TTree with just the modified value and use it as ‘friend’ of the original tree.

Cheers,
Philippe.