Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The GenEventData class is an alternative representation of the GenEvent. It is a different data structure, so converting between the two objects is not free of cost, but the cost is moderate.
The GenEventData class was introduced by the HepMC3 devs, because it has a simple layout that allows one to store the instances in ROOT trees. From the perspective of a Python user is also interesting, because it allows one to access and manipulate the particles and vertices in an event in form of numpy arrays, which are views into the memory of the GenEventData object. This is cheap and processing numpy arrays is fast.
In case of read-only access, one can do better than converting GenEvents to GenEventData objects. An alternative Numpy API was added to the GenEvent, which provides faster read-only access to particle and vertex data members.
If you need to process events in Python, you now have several options, see docs/examples/processing.ipynb