LHEReader: LHE to ROOT Converter
- LHEReader is a lightweight Python program that converts LHE format events into ROOT TTrees for fast analysis in high-energy physics.
- It processes both .lhe and .lhe.gz files, extracting essential event-level and particle-level data including momenta, spin, and color flow.
- The tool provides a minimal, stable schema for immediate downstream analysis with ROOT/C++ or PyROOT, supporting quick kinematic checks and sample validation.
Searching arXiv for the specified paper and closely related context.
LHEReader is a lightweight program designed to convert Les Houches Event (LHE) files into ROOT files so that parton-level Monte Carlo events can be analyzed directly within the ROOT ecosystem. It is presented as a Python script, LHEReader.py, that reads .lhe or compressed .lhe.gz inputs event-by-event and writes a ROOT file containing a single TTree named events, carrying event-level and particle-level information required for immediate analysis in ROOT/C++ or PyROOT (Desai, 2 Mar 2026).
1. Purpose and scope
LHEReader addresses a specific interface problem in high-energy physics workflows. Monte Carlo event generators such as MadGraph5 produce parton-level events in the standard LHE format, and these files encode particle identities, status codes, four-momenta, spin, parentage and color information, together with event-level quantities such as scales, , , and event weights. While LHE is widely supported across the HEP toolchain, ROOT-based analyses typically require data in ROOT TTrees. LHEReader solves this by converting LHE content into a ROOT representation with a stable and minimal schema (Desai, 2 Mar 2026).
The documented use cases are pragmatic rather than expansive. The program is presented as useful for quick kinematic checks, validation of generated samples, educational workflows, and for reading LHE output produced not only by matrix-element generators but also by tools like MadAnalysis5. Its role is therefore not to replace the broader event-generation stack, but to provide a direct bridge between LHE-formatted hard-scatter or parton-level records and downstream ROOT analysis.
2. Program architecture and ROOT schema
The program is implemented as a Python script using ROOT/PyROOT. The paper states that it reads LHE files event-by-event and fills branches in a ROOT TTree; it does not describe the XML parsing strategy in detail beyond that point, and no specific LHE schema version or XML library details are given (Desai, 2 Mar 2026).
The output consists of a single TTree named events. At the event level, the documented scalar branches are:
numParticles(int): number of particles in the eventeventweight(float): event weight from the LHE recordscale(float): event scalealpha_qed(float): used for the eventalpha_qcd(float): used for the event
At the particle level, the program stores one std::vector<T> per event for each of the following quantities:
pid(vector<int>): PDG ID for each particlestatus(vector<int>): status codemother1,mother2(vector<int>): mother indices as in LHEcolor1,color2(vector<int>): color-flow tagspx,py,pz(vector<float>): momentum componentsenergy,mass(vector<float>): particle energy and masstau(vector<float>): proper lifetimespin(vector<float>): spin/helicity information
These branches are sufficient to reconstruct basic kinematics, mother-daughter relations, and color connections at the parton level. The paper explicitly notes that the output does not report run numbers, event numbers, PDF IDs, , , or lists of alternative weights.
The paper also provides a C++ example for reading the output:
9
and a loop skeleton:
0
A branch naming discrepancy is therefore documented: the branch table lists eventweight, while the code snippet uses weight. Users are advised to check the actual branch name in the produced output file. The example further illustrates selection of final-state particles with status == 1, use of PDG IDs to identify species, and a simple truth-level missing transverse energy proxy constructed from neutrinos.
3. Supported inputs, event content, and kinematic semantics
LHEReader supports both .lhe and .lhe.gz as inputs. The output branch definitions show that it reads particle PDG IDs, status codes, mother indices, color tags, four-momenta, mass, spin, lifetime, and the event-level quantities scale, alpha_qed, alpha_qcd, and eventweight (Desai, 2 Mar 2026).
The paper is explicit about what it does not specify. It does not list supported LHE versions or the exact tags and blocks parsed, such as <init>, <initrwgt>, <rwgt>, or PDF blocks. It does not mention x1/x2, PDF IDs, , beam information, or per-event multiple weights and systematics. Only a single eventweight branch is documented. This means that workflows relying on multiweight schemes, PDF information, or beam configurations are outside the documented feature set.
The conventions and units are also only indirectly characterized. The paper does not explicitly state units in the branches, although the selection examples use GeV thresholds, which is consistent with standard LHE momentum units. The kinematic relations used or implied in the analysis examples are:
For event weighting, the ROOT output contains a scalar eventweight branch copied from the LHE. The paper does not specify an explicit histogram normalization or scaling formula implemented within LHEReader. It notes, for context, that a common event weight in analyses is 0 or 1 when scaling to luminosity 2, but it does not state that LHEReader applies such a formula internally.
4. Installation, invocation, and downstream analysis
The documented installation target is Linux with ROOT and PyROOT enabled, and Python 3.10 is reported as tested. The repository is given as https://github.com/amanmdesai/LHEReader.git. The conversion commands are presented in minimal form (Desai, 2 Mar 2026):
1
2
Compressed inputs are likewise accepted:
3
The downstream usage pattern is equally direct. A ROOT or PyROOT analysis opens the generated ROOT file, retrieves the events tree, binds the necessary scalar and vector branches, and loops over entries and particles to apply selections or fill histograms. The paper gives a corresponding C++ pattern:
4
Within the documented workflow, LHEReader sits between upstream event production and downstream ROOT analysis. Upstream tools include MadGraph5 and MadAnalysis5, with Pythia8 and FastJet in the fast-simulation chain; downstream, the output is intended for any ROOT-based analysis in C++ or PyROOT. The paper includes an EventLoop C++ skeleton showing how to read the events tree, use status and pid to implement truth-level selections, compute variables such as 3 from neutrinos, and fill histograms.
5. Demonstration analyses and performance evaluation
The paper evaluates conversion performance using two leading-order MadGraph5 samples: 4 and 5. For 6, the reported average conversion time is approximately 7 ms per event for 8 events, with a total of 9 s, and approximately 0 ms/event for 1 events, with a total of 2 s. For 3, the reported rates are approximately 4 ms/event for 5 events, with a total of 6 s, and approximately 7 ms/event for 8 events, with a total of 9 s (Desai, 2 Mar 2026).
The physics workflow example is 0 with 1 and 2. Generation is performed with MadGraph5 at leading order, with beam energy set to 3 TeV for LHC Run 3 and using PDF4LHC21 PDFs via LHAPDF6. The quoted cross-section, including branching fractions and as reported from MadGraph5 in the paper, is 4 fb5; the unit appears in the paper exactly in that form. Parton shower and hadronization are performed with Pythia8, and object reconstruction is carried out via MadAnalysis5 using FastJet with the anti-6 algorithm and 7. Samples are scaled to an integrated luminosity of 8 fb9 for illustrative plots.
The analysis selections are described at both parton and reconstructed levels. The illustrative lepton requirements are exactly two opposite-sign, same-flavor isolated leptons with:
- 0 GeV
- 1
- 2 GeV 3 GeV
Jets are required to satisfy:
- 4 GeV
- 5
For 6 tagging, parton-level 7 jets are identified from truth using PDG ID. At reconstructed level, the pid branch is used for a simplified truth-based tag, and a 8 9-tag efficiency is assumed. Isolation between selected leptons and 0 jets is enforced through 1. Higgs reconstruction requires at least two 2 jets, and the leading and subleading 3 jets are used, with a combined transverse momentum greater than 4 GeV, to reconstruct the Higgs-candidate 5 system.
The paper reports several illustrative outputs: reconstructed-level distributions of the 6 of muons, electrons, and 7 jets; the 8 of the 9 pair; dilepton invariant-mass distributions peaking around the 0 boson mass for the 1 and 2 channels; and a Higgs mass distribution exhibiting a delta-like peak at parton level and a broadened distribution after reconstruction. A simple 3 proxy from neutrinos is shown in the code illustration, and an example veto cut of 4 GeV is mentioned, although the summation procedure is not formalized beyond the snippet.
6. Limitations, reproducibility, and relation to other tools
The limitations are defined primarily by omission in the documented schema rather than by an explicit unsupported-feature list. The paper does not state support for <initrwgt> blocks or multiple per-event systematic weights, PDF information such as 5, 6, or PDF IDs, beam energies or beam IDs at the TTree level, or run and event numbers. Only one eventweight branch is documented. Users needing richer metadata are therefore directed, in effect, to verify availability or extend the program (Desai, 2 Mar 2026).
The treatment of beyond-the-Standard-Model content is similarly narrow in scope. No specific guidance is given for BSM particles beyond general PDG ID handling; mother-daughter and color-flow vectors are preserved as in the LHE. This suggests that the program is structurally agnostic to particle content so long as it is encoded in standard LHE fields, but the paper does not formalize any BSM-specific validation.
The paper cites other LHE readers, including scikit-hep/pylhe, but does not present a detailed comparison. The stated advantage of LHEReader is its simplicity: a direct LHE-to-ROOT conversion with a stable, minimal TTree schema and a ready-to-use ROOT EventLoop example. Reproducibility details include Linux as the target environment, ROOT with PyROOT enabled, Python 3.10 as tested, and the use of MadGraph5, Pythia8, MadAnalysis5, FastJet with anti-7 and 8, and PDF4LHC21 via LHAPDF6 in the demonstration chain. The program is also reported as having been released on Zenodo, with initial v1.0 in 2023 and an update to v1.6.1 by 2026, and as having been presented at AIP Congress 2024.
Taken together, these characteristics define LHEReader as a practical bridge from LHE to ROOT centered on essential event- and particle-level information rather than comprehensive preservation of all possible LHE metadata. Where the paper is silent, the appropriate interpretation is that support is not specified and should be verified against the documented output.