Update the example script in order to work with SPHENIX
Add the missing Gil lock for the error message.
The current version includes a few TODO related to future optimization (e.g. sorting). The code is already implemented in a way that will be easily upgraded.
A huge bug was present in the reader. It was fixed with the i--.