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)
Is your feature request related to a problem? Please describe.
DistributionMultiTablecould only be constructed from a tabulated PDF; the CDF was always derived internally viamulti_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 orNaNsamples.Describe the feature you'd like.
Add a "direct-CDF" mode to
DistributionMultiTableand the multi-tablesampler:
DistributionMultiTableaccepts an optionalcdf=argument; when given,the CDF is used directly and PDF derivation is skipped.
ElectronReactionIonization/ElectronReactionElasticScatteringdetect aCDFdataset in the HDF5 group and use it, falling back toPDFotherwise._sample_multi_tablehandles three cases:size == 1) → return the single value,pdf_length == 0) → linear interpolation on the CDF,p0 == p1andc0 == c1zero-denominator cases.This keeps full backward compatibility for neutrons while enabling CDF sampling from electron data.
How can this issue be closed?
DistributionMultiTablesupports direct CDF input_sample_multi_tablesamples direct-CDF and PDF-based tables without divide-by-zero /NaN