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.2.tar.gz
(2.7 kB
view hashes)
Built Distribution
lhereader-1.0.2-py3-none-any.whl
(14.8 kB
view hashes)
Close
Hashes for lhereader-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dc0f4461019eef344cb37cf55df3e573a532fc5237abf7392f299ac6fb45d60 |
|
MD5 | 38c61338d392a731f47474f7b10629f0 |
|
BLAKE2b-256 | e2a9db42bdb9dc2030f89344086d3218917d1f4fcfa501a8cb2a6ed00482696b |