Energy Distributions

EnergyLaw

class EnergyLaw : public std::enable_shared_from_this<EnergyLaw>

Interface to represent uncorrelated energy distributions.

Subclassed by pndl::DiscretePhoton, pndl::EquiprobableEnergyBins, pndl::Evaporation, pndl::GeneralEvaporation, pndl::LevelInelasticScatter, pndl::Maxwellian, pndl::TabularEnergy, pndl::Watt

Public Functions

virtual ~EnergyLaw() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const = 0

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const = 0

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

EquiprobableEnergyBins

class EquiprobableEnergyBins : public pndl::EnergyLaw

Energy distribution which is provided as equiprobable energy bins.

Public Functions

EquiprobableEnergyBins(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

EquiprobableEnergyBins(const std::vector<double> &incoming_energy, const std::vector<std::vector<double>> &bin_bounds)
Parameters
  • incoming_energy – Incoming energy grid.

  • bin_bounds – A vector of vectors containing bin bounds, one for each point in the incoming energy grid.

~EquiprobableEnergyBins() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const std::vector<double> &incoming_energy() const

Returns a vector of the grid of incoming energy points for which an equiprobable bin set is stored.

inline const std::vector<double> &bin_bounds(std::size_t i) const

Returns the ith set of bin boundaries as a vector.

Parameters

i – Index for the incoming energy grid.

inline std::size_t size() const

Returns the number of incoming energies / bin boundary sets stored.

LevelInelasticScatter

class LevelInelasticScatter : public pndl::EnergyLaw

Energy distribution for inelastic scatter.

Public Functions

LevelInelasticScatter(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

LevelInelasticScatter(double Q, double AWR)
Parameters
  • Q – Q-value of the reaction.

  • AWR – Atomic Weight Ratio of nuclide.

~LevelInelasticScatter() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline double C1() const

Returns first parameter which is -(A+1)*Q/A.

inline double C2() const

Returns second parameter which is (A/(A+1))^2.

TabularEnergy

class TabularEnergy : public pndl::EnergyLaw

Energy distribution represented as a tabulated PDF and CDF.

Public Functions

TabularEnergy(const ACE &ace, std::size_t i, std::size_t JED)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

  • JED – Index offset to find the PDF and CDF tables.

TabularEnergy(const std::vector<double> &incoming_energy, const std::vector<PCTable> &tables)
Parameters
  • incoming_energy – Incoming energy grid.

  • tables – PCTables for each point in the incoming energy grid.

~TabularEnergy() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const std::vector<double> &incoming_energy() const

Reterns the incoming energy points in MeV for which a PCTable is stored.

inline const PCTable &table(std::size_t i) const

Returns the ith PDF/CDF, corresponding to the ith incoming energy.

Parameters

i – Index in the incoming energy grid.

inline std::size_t size() const

Returns the number of incoming energy points.

Evaporation

class Evaporation : public pndl::EnergyLaw

Energy distribution represented as an evaporation spectrum.

Public Functions

Evaporation(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

Evaporation(std::shared_ptr<Tabulated1D> temperature, double restriction_energy)
Parameters
  • temepratureTabulated1D function for the nuclear temperature.

  • restriction_energy – Restriction energy for the distribution.

~Evaporation() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const Tabulated1D &temperature() const

Returns the table containg the effective temperature as a function of incoming energy.

inline double U() const

Returns the value of the cuttoff energy of the distribution in MeV.

GeneralEvaporation

class GeneralEvaporation : public pndl::EnergyLaw

Energy distribution represented as a general evaporation spectrum.

Public Functions

GeneralEvaporation(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

GeneralEvaporation(std::shared_ptr<Tabulated1D> temperature, const std::vector<double> &bounds)
Parameters
  • temperature – Tabulated function for nuclear temperature.

  • bounds – Equiprobable bounds for X.

~GeneralEvaporation() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const Tabulated1D &temperature() const

Returns the table containg the effective temperature as a function of incoming energy.

inline const std::vector<double> &bin_bounds() const

Returns the the bin boundaries in a vector.

Maxwellian

class Maxwellian : public pndl::EnergyLaw

Energy distribution represented as a Maxwellian spectrum.

Public Functions

Maxwellian(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

Maxwellian(std::shared_ptr<Tabulated1D> temperature, double restriction_energy)
Parameters
  • temepratureTabulated1D function for the nuclear temperature.

  • restriction_energy – Restriction energy for the distribution.

~Maxwellian() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const Tabulated1D &temperature() const

Returns the table containg the effective temperature as a function of incoming energy.

inline double U() const

Returns the value of the cuttoff energy of the distribution in MeV.

Watt

class Watt : public pndl::EnergyLaw

Energy distribution represented as a Watt spectrum.

Public Functions

Watt(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

Watt(std::shared_ptr<Tabulated1D> a, std::shared_ptr<Tabulated1D> b, double restriction_energy)
Parameters
  • aTabulated1D function for a.

  • bTabulated1D function for b.

  • restriction_energy – Restriction energy for the distribution.

~Watt() = default
virtual double sample_energy(double E_in, const std::function<double()> &rng) const final override

Samples an energy (in MeV) from the distribution.

Parameters
  • E_in – Incident energy in MeV.

  • rng – Random number generation function.

virtual std::optional<double> pdf(double E_in, double E_out) const final override

Samples the PDF for the energy transfer from E_in to E_out where E_in is provided in the lab frame, and E_out is provided in the frame of the reaction data. Returned as an std::optional<double>, as some EnergyLaw types have no defined PDF.

Parameters
  • E_in – Incoming energy.

  • E_out – Outgoing energy.

inline const Tabulated1D &a() const

Returns the table containg the distribution parameter a, as a function of the incident energy.

inline const Tabulated1D &b() const

Returns the table containg the distribution parameter b, as a function of the incident energy.

inline double U() const

Returns the value of the cuttoff energy of the distribution in MeV.