I’m trying to read a fairly large (500 col, 2e6 rows) TTree into an array.
The performance is slower than I’d expect, and I was hoping to get advice on the how to improve performance.
Here is a snippet of code.
The outer loop reads entries.
The inner loop uses the branch names to put the values for that ttree row into the appropriate columns of the array.
Is there a high-performance way of doing this?
thanks for any thoughts on this,
P.S. The entries in the ttree are currently a mix of floats and ints, but I could make them all ints if that would help.
P.P.S. Notice that the entries to the array are set using a “set” method.
Unfortunately, I can’t get direct access to the array, and so that is a constraint on any solution.
for (long iEvent = 0 ; iEvent < nEventsToProcess ; iEvent++)
long varCounter = 0;
for (vector::iterator it = varNames.begin ();
it != varNames.end (); ++it)
int varValue = (int)chain->GetLeaf(it->c_str())->GetValue();
} // loop over variables } // loop over events[/code]