- class heparchy.write.HdfEventWriter(heparchy.write.base.EventWriterBase)[source]
Context manager interface to create and write events.
- edges[source]¶
A structured array providing edges for a graph representation, with fields “in” and “out”.
- pmu[source]¶
A structured array providing particle 4-momenta, with fields “x”, “y”, “z”, “e”
- Type¶
numpy.ndarray[double]
- status[source]¶
Status codes, describing the reason for the generation of each particle in the event.
- masks[source]¶
Write-only dictionary-like interface to set boolean masks over the particle datasets.
- custom_meta[source]¶
Write-only dictionary-like interface to set user-defined metadata on the event.
Examples
Store custom metadata to an event:
>>> import heparchy >>> >>> with heparchy.write.HdfWriter("showers.hdf5") as hep_file: >>> with hep_file.new_process("higgs") as proc: >>> with proc.new_event() as event: >>> event.custom_meta["num_jets"] = 4Public members¶
- HdfEventWriter(proc: HdfProcessWriter)[source]
Initialize self. See help(type(self)) for accurate signature.
- property edge_weights : ndarray[Any, dtype[float64]][source]
hepwrite¶
- set_color(data: ndarray[Any, dtype[Any]]) None[source]
Write color / anticolor pairs for all particles to event.
- set_status(data: ndarray[Any, dtype[int32]]) None[source]
Write status codes for all particles to event.
- set_helicity(data: ndarray[Any, dtype[int16]]) None[source]
Write helicity values for all particles to event.
- set_mask(name: str, data: ndarray[Any, dtype[bool_]]) None[source]
Write bool mask for all particles in event.
Last update:
Nov 16, 2022