Skip to main content

A python module to read LHE files.

Project description

lhereader

A Python module to read LHE files. Originally by diptaparna, significantly rewritten by me. Requires python version > 3.6.

Usage example:

import numpy as np
from lhereader import LHEReader


reader = LHEReader('path/to/file.lhe')

# Mediator mass in each event
mmed = []
counter = 0
for iev, event in enumerate(reader):
    # Find DM particles
    dm = filter(lambda x: abs(x.pdgid)== 52, event.particles)

    # Sum over all DM four-momenta in the event
    combined_p4 = None
    for p4 in map(lambda x: x.p4(), dm):
        if combined_p4:
            combined_p4 += p4
        else:
            combined_p4 = p4
    mmed.append(combined_p4.mass)

print(f'Mean mediator mass: {np.mean(mmed)}')
print(f'Median mediator mass: {np.median(mmed)}')

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

lhereader-1.0.6.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

lhereader-1.0.6-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file lhereader-1.0.6.tar.gz.

File metadata

  • Download URL: lhereader-1.0.6.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for lhereader-1.0.6.tar.gz
Algorithm Hash digest
SHA256 3ce8752cccf560763f6634a7e98efc1ba80a604b19f3ec0b255ef0dd04182997
MD5 b8132718dc17e4820c79fbe32d55493d
BLAKE2b-256 691585fe03b49b20ce59368645bac1ee94eb32bda1e6fc8c0189207906a46866

See more details on using hashes here.

File details

Details for the file lhereader-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: lhereader-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for lhereader-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 24c9a036349f89ab4e6c916ea98a843b9be5358b34ca7e9d1173c8e56f0090a7
MD5 387725b8cadc2e32e6a081b225ee0db9
BLAKE2b-256 4015a5a35bc52cc397197720fcfe9f4e33b288a35d3a690d70840aafa15511b1

See more details on using hashes here.

Supported by

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