Skip to main content

A python module to read LHE files.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.tar.gz (2.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 3

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lhereader-1.0.tar.gz
Algorithm Hash digest
SHA256 5f850e83d0140aee903062ad65ee5042511268c2b7880dfe698c0d82790337b0
MD5 85f34e51b26677597dddf9a65b54f256
BLAKE2b-256 4aa35d87f5f8d75f84810323bba8c065d90fccaf1b36259591e2dea4edd322ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lhereader-1.0.0-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/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for lhereader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 038025f5b57f9da8787b67f2f9b1dee355c4232eba705f2e2793d4de365e04a1
MD5 057d006ad722459489b92d4aecfba5ac
BLAKE2b-256 31ca975da61608beaaeeb439e9208f591f5ea65a12478094addaf9e71a8342f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lhereader-1.0-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/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for lhereader-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb4ff920487618ab8904672c0558404e682eba65d78de1bb4c964f2fa4b132e6
MD5 64d67c7aa243de6ae748006d57f1413f
BLAKE2b-256 5106b9ea1991beef6a7b232bc539a66b955d09220fa07fc8d425d862c6cdfc7e

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