I was wondering if there is a simple way to do the following operation from a TTreeFormula. Ideally I have a scalar branch, one entry per event, and I would like to do something like
// assumes other code to load variable_in_tree
for (int i =0; i<N_total_events_in_tree; i++ ) sum_var+= variable_in_tree;
In other words, I would like to be able to have the equivalent of the pseudocode above in an interactive ROOT session in order to retried the sum of all values that the variable_in_tree takes in my tree.
Thanks in advance,