We recently discovered a worrysome bug in TTreeFormula.
The evaluation of the formula works nicely for vector-valued branches, as long as one only tries to access the first entry, e.g.
gives the correct result.
However, access of any further entries of the vector via TTreeFormula, e.g.
returns 0 in all cases, whereas TTree::Draw works as expected.
In older versions of ROOT, namely up to 5.34/09, this worked for TTreeFormula as well. All ROOT 5 releases after that and also all the ROOT 6 releases since then exhibit the unpleasant behavior.
We have attached a ROOT script that showcases the bug.