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 hashes)
Built Distributions
lhereader-1.0.0-py3-none-any.whl
(14.8 kB
view hashes)
lhereader-1.0-py3-none-any.whl
(14.8 kB
view hashes)
Close
Hashes for lhereader-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038025f5b57f9da8787b67f2f9b1dee355c4232eba705f2e2793d4de365e04a1 |
|
MD5 | 057d006ad722459489b92d4aecfba5ac |
|
BLAKE2b-256 | 31ca975da61608beaaeeb439e9208f591f5ea65a12478094addaf9e71a8342f5 |