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.2.tar.gz (51.7 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.2-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyedm4hep-0.1.2.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.32.4 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.61.2 importlib-metadata/8.5.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

File hashes

Hashes for pyedm4hep-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a2efd7a5bc91f6e61fc4f579e9570acf134a38e236a2f538b4e98a3e49c3e9a5
MD5 741bba7e2d0550dc820867361ec33135
BLAKE2b-256 52be4677e4e575e127c61286a499cda2b5688cb1a65d067b8cce9c3f91fd203e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyedm4hep-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.32.4 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.61.2 importlib-metadata/8.5.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

File hashes

Hashes for pyedm4hep-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b9dbd50009cdeffaddf789ca35c8398ef50f35db9b9c5881ba837acc37f9b8
MD5 2310941afbb3ca10b4414f76d0cbaacf
BLAKE2b-256 4164799cd51f85ee6797587634caee15ea0b1de0c75f709ea825379806db644a

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