Huge performance improvement

I have long been aware of some inefficiencies in the ROOT6 conditions code due to unnecessary nested loops,
I finally got around to fixing this today, and there was a factor of 15 speedup, i.e. more than an order of magnitude.
I should have done this months ago!
Please merge this a few months ago-).  If that is not possible, immediately would be acceptable.