Skip to main content

A Python library for working with EDM4hep data, providing an object-oriented interface on top of Pandas DataFrames.

Project description

PyEDM4hep

codecov

PyEDM4hep is a Pythonic interface for EDM4hep event data, combining the power of Pandas DataFrames with an intuitive object-oriented API. It enables fast, flexible analysis of HEP event data stored in ROOT files, with seamless navigation between particles, hits, and decay trees.


Features

  • Object-oriented access to particles, hits, and calorimeter data
  • Bulk operations via Pandas DataFrames for high performance
  • ROOT file support using uproot
  • Relationship navigation (parents, daughters, hits, decay trees)
  • Built-in plotting for event overviews, decay trees, and kinematics
  • Detector geometry awareness for realistic analysis
  • Easy integration with Jupyter and scientific Python stack

Installation

PyEDM4hep requires Python 3.8+ and can be installed via pip:

pip install pyedm4hep

Or from source:

git clone https://github.com/murnanedaniel/pyEDM4hep.git
cd pyEDM4hep
pip install .

Quickstart

from pyedm4hep import EDM4hepEvent

# Define detector parameters (example values)
detector_params = {
    'tracking_radius': 1100.0,
    'tracking_z_max': 2500.0,
    'energy_threshold': 0.05
}

# Load an event from a ROOT file
file_path = 'path/to/events.root'
event = EDM4hepEvent(file_path, event_index=0, detector_params=detector_params)

# Access particles as a DataFrame
particles_df = event.get_particles_df()

# Work with a single particle
particle = event.get_particle(0)
print(particle.pdg, particle.pt, particle.vertex)

# Plot event overview
fig = event.plot.event_overview()
fig.suptitle("Event Overview")

Documentation


Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

  • Run tests with pytest.
  • Ensure code coverage remains high.
  • Document new features and update the changelog.

License

This project is licensed under the MIT License. See LICENSE for details.


Acknowledgments

  • Built on top of EDM4hep and uproot.
  • Inspired by the needs of the HEP analysis community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyedm4hep-0.1.1.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyedm4hep-0.1.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file pyedm4hep-0.1.1.tar.gz.

File metadata

  • Download URL: pyedm4hep-0.1.1.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for pyedm4hep-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d51fc2610546e76e1614acfe33300717e7cde80e9794d1f7c2ba610c8a0469d4
MD5 82de41236bcf290004c5386c200db70b
BLAKE2b-256 d1b2632d8c7bda72c86781b919a31c1e884a226dbfdfac46538d170bec4d6ffd

See more details on using hashes here.

File details

Details for the file pyedm4hep-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyedm4hep-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for pyedm4hep-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a305535fbfafe98d97bff0d65e43e458a217799c4ec495484a9ec5d7d251ade6
MD5 f1532f1ab84d5988ff2b7a08673272ce
BLAKE2b-256 c73068bf5de0ee429c419de8c2a98c5d18cd9f9afc704bf3868402fd3f6a2e70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page