openmc.ReactionFilter

class openmc.ReactionFilter(bins, filter_id=None)[source]

Bins tally events based on the reaction type (MT number).

Added in version 0.15.4.

Parameters:
  • bins (str, int, or iterable thereof) – The reaction types to tally. Can be reaction name strings (e.g., '(n,elastic)', '(n,gamma)') or integer MT numbers (e.g., 2, 102). Integer MT values are automatically converted to their canonical string representation.

  • filter_id (int) – Unique identifier for the filter

Variables:
  • bins (numpy.ndarray of str) – Reaction name strings

  • id (int) – Unique identifier for the filter

  • num_bins (int) – The number of filter bins

classmethod from_hdf5(group, **kwargs)[source]

Construct a new Filter instance from HDF5 data.

Parameters:

group (h5py.Group) – HDF5 group to read from

Keyword Arguments:

meshes (dict) – Dictionary mapping integer IDs to openmc.MeshBase objects. Only used for openmc.MeshFilter objects.

classmethod from_xml_element(elem, **kwargs)[source]

Generate a filter from an XML element

Parameters:
  • elem (lxml.etree._Element) – XML element

  • **kwargs – Keyword arguments (e.g., mesh information)

Returns:

Filter object

Return type:

openmc.Filter