Editing values in TTree

Hi All,

I have some trees containing event data from a detector, with branches like time, energy, position, etc. When doing analysis, we have a fairly high number of pathological events that must be rejected manually. What we’d like to do is add another branch to the tree (or create a friend tree) called “flag”, which could be used to reject manually identified events.

The problem is that, when a new event needs to be flagged, the only way I can see to update the "flag"s branch would be to make a new friend tree, copy all the old values except for the few events that need to be updated, and delete the original friend. With very large trees, this is very inefficient!
Is there any way around this, i.e. to edit the values of one particular entry in a tree?

Thanks!
Ben

Why don’t you simply create a TEntryList with the list of events passing your cuts
and loop on this entry list to process your Tree?

Rene