Skip to content

[Feature] CDF-based dataset handling #428

@melekderman

Description

@melekderman

Is your feature request related to a problem? Please describe.

DistributionMultiTable could only be constructed from a tabulated PDF; the CDF was always derived internally via multi_cdf_from_pdf. Electron reaction data files (ionization secondary-electron energy distributions and elastic-scattering cosine) are provided as a tabulated CDF. There was no way to feed this data into the multi-table sampler, and degenerate single-point tables / zero-denominator cases were not handled, which could cause divide-by-zero or NaN samples.

Describe the feature you'd like.

Add a "direct-CDF" mode to DistributionMultiTable and the multi-table
sampler:

  • DistributionMultiTable accepts an optional cdf= argument; when given,
    the CDF is used directly and PDF derivation is skipped.
  • ElectronReactionIonization / ElectronReactionElasticScattering detect a
    CDF dataset in the HDF5 group and use it, falling back to PDF otherwise.
  • _sample_multi_table handles three cases:
    • degenerate table (size == 1) → return the single value,
    • direct-CDF mode (pdf_length == 0) → linear interpolation on the CDF,
    • PDF-based mode (neutron data) → existing sampling, guarded against the p0 == p1 and c0 == c1 zero-denominator cases.

This keeps full backward compatibility for neutrons while enabling CDF sampling from electron data.

How can this issue be closed?

  • DistributionMultiTable supports direct CDF input
  • Electron ionization & elastic-scattering reactions read CDF data
  • _sample_multi_table samples direct-CDF and PDF-based tables without divide-by-zero / NaN
  • Existing neutron sampling results unchanged (regression check)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions