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.5.tar.gz
(2.8 kB
view details)
Built Distribution
lhereader-1.0.5-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file lhereader-1.0.5.tar.gz
.
File metadata
- Download URL: lhereader-1.0.5.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581bb2abc49585472a7192f81fa5c23c0102d4fc562a4bbd2e46a0af8355ec0a |
|
MD5 | 74f6594a8233939e7db6d32881eec133 |
|
BLAKE2b-256 | e2198ee6c10b6567f728f5b796510957bc62e770d250fd3fa5cc823b6db7f53b |
File details
Details for the file lhereader-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: lhereader-1.0.5-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6992ff48af16f5955bb6811aa8b25a6811087100a564a9ee79a8ad5c47b10dec |
|
MD5 | a1e1e14f7a538addff9b303f0040cc09 |
|
BLAKE2b-256 | c25991322ea9d6117d98e7269ad5dde20642ffdbfc6c97395fe0547e652ad1bd |