Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GenEventData #59

Merged
merged 16 commits into from
Jan 21, 2023
Merged

Support GenEventData #59

merged 16 commits into from
Jan 21, 2023

Conversation

HDembinski
Copy link
Member

@HDembinski HDembinski commented Jan 19, 2023

  • Adds GenEventData class
  • Adds read-only Numpy API for GenEvent

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

@coveralls
Copy link

coveralls commented Jan 19, 2023

Coverage Status

coverage: 99.125%. remained the same
when pulling f038305 on geneventdata
into 6866c8b on main.

@HDembinski HDembinski merged commit 4f3b94f into main Jan 21, 2023
@HDembinski HDembinski deleted the geneventdata branch January 21, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants