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:
objectStore 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, ...)mother_indices(particle)Return the positional indices of the particle's mothers in
self.particles.mothers(particle)Return a list of the particle's mothers.
tolhe(lheformat)Return the event as a string in LHE XML format.
Attributes
Get the graphviz.Digraph object.
Event information
List of particles in the event
Event weights
Event scales
Event attributes not represented by dedicated fields
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)
- mother_indices(particle: LHEParticle) list[int][source]
Return the positional indices of the particle’s mothers in
self.particles.The LHE
mother1/mother2fields are 1-based; absent mothers (0) are dropped.
- 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(lheformat: LHEXMLFormat = LHEXMLFormat(indent=' ', compress=False, weights=<LHEWeightFormat.RWGT: 'rwgt'>, eventinfo='{nparticles:3d} {pid:6d} {weight: 15.10e} {scale: 15.10e} {aqed: 15.10e} {aqcd: 15.10e}', particle='{id:5d} {status:3d} {mother1:3d} {mother2:3d} {color1:3d} {color2:3d} {px: 15.8e} {py: 15.8e} {pz: 15.8e} {e: 15.8e} {m: 15.8e} {lifetime: 10.4e} {spin: 10.4e}', initinfo=' {beamA: 6d} {beamB: 6d} {energyA: 14.7e} {energyB: 14.7e} {PDFgroupA: 5d} {PDFgroupB: 5d} {PDFsetA: 5d} {PDFsetB: 5d} {weightingStrategy: 5d} {numProcesses: 5d}', procinfo='{xSection: 14.7e} {error: 14.7e} {unitWeight: 14.7e} {procId: 5d}')) str[source]
Return the event as a string in LHE XML format.
- Args:
lheformat (LHEXMLFormat): How to serialize the event, see the LHEXMLFormat class.
- Returns:
str: The event as a string in LHE XML format.
- weights: dict[str, float]
Event weights