- class heparchy.read.HdfProcessReader(heparchy.read.base.ProcessReaderBase)[source]
A heparchy process object. This is a numerically subscriptable iterator.
- Parameters¶
- decay[source]¶
Provides access to incoming and outgoing parton PDG codes in the process. This has been deprecated due to the complexity introduced with intermediate states. Consider using signal_pdgs instead.
Examples
Access a process named “higgs” and access events:
>>> with heparchy.read.HdfReader("showers.hdf5") as hep_file: >>> proc = hep_file["higgs"] >>> for event in proc: # iterate with for loop >>> ... >>> event = proc[5] # 6th event with explicit indexingRead metadata stored in a process:
>>> with heparchy.read.HdfReader("showers.hdf5") as hep_file: >>> proc = hep_file["higgs"] >>> print(proc.process_string) >>> print(proc.signal_pdgs) >>> print(proc.com_energy) >>> print(proc.custom_meta["decay_channels"]) p p > h z , (h > b b~) , (z > l+ l-) [25, 5, -5] (1300.0, "GeV") semileptonicNotes
When implicitly iterating over this object (as in a for loop), the order of event retrieval will _generally_ follow the numerical order of the events, but this is not guaranteed. The iterator is based on HDF5’s underlying B-tree structure, and will iterate in _native order_, _ie._ events will be read as quickly as possible. Native ordering does not change unless the file is modified, so the implicit iterator is consistent. However, if you require data to be retrieved in numerical order, rather than native order, use explicit indexing (as in the example above).
Public members¶
- HdfProcessReader(file_obj: HdfReader, key: str)[source]
Initialize self. See help(type(self)) for accurate signature.
- __getitem__(evt_num: int) HdfEventReader[source]
Provides option to get EventReaderBase object without iteration. Instead user supplies event number.
- read_event(evt_num: int) HdfEventReader[source]
Returns the event indexed by the passed index.
- property process_string : str[source]
- property decay : dict[str, ndarray[Any, dtype[int32]]][source]
Returns dictionary with two entries, describing the hard interaction for this process.
- property signal_pdgs : ndarray[Any, dtype[int32]][source]
- property com_energy : tuple[float, str][source]
Returns dictionary with two entries, describing the centre-of-mass energy for this hard process.
- get_custom_meta(name: str) Any[source]
Returns user-defined metadata stored under the give name.
Last update:
Nov 16, 2022