Skip to content

Order events by event number in diff_root_files.py

So, in order to be able to test outputs with shuffled events we added a simple script, Tools/PyUtils/bin/tree-orderer.py, that orders the events in the CollectionTree by event numbers. As far as diff-root is concerned, this works OK. However, we loose the meta-data along the way. Therefore, diff-pool is not happy. We could copy the meta-data in the Tools/PyUtils/bin/tree-orderer.py directly into the new file but I don't really like that hack.

In this MR I essentially updated Tools/PyUtils/python/scripts/diff_root_files.py so that it accepts a new argument, --order-trees, which orders the old and new trees according to the event numbers and does the comparison based on that instead of the simple loop over indices. From local tests this seems to work fine. With this, we no longer need to run and extra step and produce a redundant file. In any case, diff-pool doesn't necessarily care about the order of stuff in the file. So we can use the same file for both.

I'm cc-ing @jchapman and @tadej. John is also testing the new script (thanks a lot!) :)

Merge request reports