pylhe.LHEEvent

class pylhe.LHEEvent(eventinfo: ~pylhe.LHEEventInfo, particles: list[~pylhe.LHEParticle], weights: dict[str, float] = <factory>, scales: dict[str, float] = <factory>, attributes: dict[str, str] = <factory>, optional: list[str] = <factory>, _graph: ~graphviz.graphs.Digraph | None = None)[source]

Bases: object

Store a single event in the LHE format.

__init__(eventinfo: ~pylhe.LHEEventInfo, particles: list[~pylhe.LHEParticle], weights: dict[str, float] = <factory>, scales: dict[str, float] = <factory>, attributes: dict[str, str] = <factory>, optional: list[str] = <factory>, _graph: ~graphviz.graphs.Digraph | None = None) None

Methods

__init__(eventinfo, particles, weights, ...)

mothers(particle)

Return a list of the particle's mothers.

tolhe([rwgt, weights])

Return the event as a string in LHE format.

Attributes

graph

Get the graphviz.Digraph object.

eventinfo

Event information

particles

List of particles in the event

weights

Event weights

scales

Event scales

attributes

Event attributes not represented by dedicated fields

optional

Optional '#' comments stored in the event

attributes: dict[str, str]

Event attributes not represented by dedicated fields

eventinfo: LHEEventInfo

Event information

property graph: Digraph

Get the graphviz.Digraph object. The user now has full control …

E.g., see the source with my_LHEEvent_instance.graph.source.

When not in notebooks the graph can easily be visualized with the graphviz.Digraph.render or graphviz.Digraph.view functions, e.g.: my_LHEEvent_instance.graph.render(filename=”test”, format=”pdf”, view=True, cleanup=True)

mothers(particle: LHEParticle) list[LHEParticle][source]

Return a list of the particle’s mothers.

optional: list[str]

Optional ‘#’ comments stored in the event

particles: list[LHEParticle]

List of particles in the event

scales: dict[str, float]

Event scales

tolhe(rwgt: bool = True, weights: bool = False) str[source]

Return the event as a string in LHE format.

Args:

rwgt (bool): Include the weights in the ‘rwgt’ format. weights (bool): Include the weights in the ‘weights’ format.

Returns:

str: The event as a string in LHE format.

weights: dict[str, float]

Event weights