pylhe

Python interface to read Les Houches Event (LHE) files.

Functions

read_lhe(filepath)

Read and yield the events in the LHE file.

read_lhe_file(filepath[, with_attributes])

Read an LHE file and return an LHEFile object.

read_lhe_init(filepath)

Read and return the init blocks.

read_lhe_with_attributes(filepath)

Iterate through file, similar to read_lhe but also set weights and attributes.

read_num_events(filepath)

Moderately efficient way to get the number of events stored in a file.

write_lhe_file(lheinit, lheevents, filepath)

Write the LHE file.

write_lhe_file_path(lhefile, filepath[, gz, ...])

Write the LHE file.

write_lhe_file_string(lhefile[, rwgt, weights])

Return the LHE file as a string.

write_lhe_string(lheinit, lheevents[, rwgt, ...])

Return the LHE file as a string.

Classes

LHEEvent(eventinfo, particles[, weights, ...])

Store a single event in the LHE format.

LHEEventInfo(**kwargs)

Store the event information in the LHE format.

LHEFile([init, events])

Represents an LHE file.

LHEInit(*args, **kwargs)

Store the <init> block as dict.

LHEInitInfo(*args, **kwargs)

Store the first line of the <init> block as dict.

LHEParticle(**kwargs)

Represents a single particle in the LHE format.

LHEProcInfo(*args, **kwargs)

Store the process info block as dict.