Angular Distributions¶
AngleDistribution¶
-
class AngleDistribution¶
Holds all of the angular distributions at all provided energies for a single reaction.
Public Functions
-
AngleDistribution()¶
-
AngleDistribution(const ACE &ace, int locb)¶
- Parameters
ace – ACE file to take data from.
locb – Index in the XSS array to start reading angular distribution.
- Parameters
energy_grid – Incoming energies which has angle laws.
laws – Angle laws for each incoming energy.
-
~AngleDistribution() = default¶
-
double sample_angle(double E_in, const std::function<double()> &rng) const¶
Samples a scattering cosine for the given energy.
- Parameters
E_in – Incident energy before scatter, in MeV.
rng – Random number generator function.
-
double pdf(double E_in, double mu) const¶
Evaluates the PDF for having a scattering cosine of mu at incoming energy E_in.
- Parameters
E_in – Incoming energy.
mu – Scattering cosine.
-
inline std::size_t size() const¶
Returns the number of energies/angular distributions stored.
-
inline const std::vector<double> &energy() const¶
Reference to the vector of energy values (in MeV) which have an angular distribution.
-
inline double energy(std::size_t i) const¶
Gets the ith energy point (in MeV) which has an angular distribution.
- Parameters
i – Index in the energy grid.
-
AngleDistribution()¶
AngleLaw¶
-
class AngleLaw : public std::enable_shared_from_this<AngleLaw>¶
Interface to represent an angular distribution for a single energy.
Subclassed by pndl::AngleTable, pndl::EquiprobableAngleBins, pndl::Isotropic, pndl::Legendre
Public Functions
-
virtual ~AngleLaw() = default¶
-
virtual double sample_mu(const std::function<double()> &rng) const = 0¶
Samples a scattering cosine from the distribution.
- Parameters
xi – Random variable from the interval [0,1).
rng – Random number generator function.
-
virtual double pdf(double mu) const = 0¶
Returns the PDF for the desired scattering cosine.
- Parameters
mu – Scatter cosnine at which to evaluate the PDF.
-
virtual ~AngleLaw() = default¶
EquiprobableAngleBins¶
-
class EquiprobableAngleBins : public pndl::AngleLaw¶
Angular distribution represented as equiprobable cosine bins.
Public Functions
-
EquiprobableAngleBins(const ACE &ace, std::size_t i)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
-
EquiprobableAngleBins(const std::vector<double> &bounds)¶
- Parameters
bounds – Vector of 33 bin bounds.
-
~EquiprobableAngleBins() = default¶
-
virtual double sample_mu(const std::function<double()> &rng) const final override¶
Samples a scattering cosine from the distribution.
- Parameters
xi – Random variable from the interval [0,1).
rng – Random number generator function.
-
virtual double pdf(double mu) const final override¶
Returns the PDF for the desired scattering cosine.
- Parameters
mu – Scatter cosnine at which to evaluate the PDF.
-
inline std::size_t size() const¶
Returns the number of bin boundaries (number of bins + 1);.
-
inline const std::vector<double> &bin_bounds() const¶
Returns the vector with the bin boundaries.
-
EquiprobableAngleBins(const ACE &ace, std::size_t i)¶
AngleTable¶
-
class AngleTable : public pndl::AngleLaw¶
Angular distribution which is provided as tabulated PDF and CDF.
Public Functions
-
AngleTable(const ACE &ace, std::size_t i)¶
- Parameters
ace – ACE file to take data from.
i – Starting index of distribution in the XSS array.
-
AngleTable(const std::vector<double> &cosines, const std::vector<double> &pdf, const std::vector<double> &cdf, Interpolation interp)¶
- Parameters
cosines – Conines of scattering angle which are tabulated.
pdf – The Probability Density Function for the provided values.
cdf – The Cumulative Density Function for the provided values.
interp – Interpolation rule for the data. May be either Histogram or LinLin.
-
AngleTable(const Legendre &legendre)¶
- Parameters
legendre – Legendre distribution which will be linearized to create an AngleTable.
-
AngleTable(const PCTable &table)¶
- Parameters
table – PCTable contianing the PDF and CDF for the cosine distribution.
-
~AngleTable() = default¶
-
virtual double sample_mu(const std::function<double()> &rng) const final override¶
Samples a scattering cosine from the distribution.
- Parameters
xi – Random variable from the interval [0,1).
rng – Random number generator function.
-
inline virtual double pdf(double mu) const final override¶
Returns the PDF for the desired scattering cosine.
- Parameters
mu – Scatter cosnine at which to evaluate the PDF.
-
inline std::size_t size() const¶
Returns the number of points in the tabulated data.
-
inline const std::vector<double> &cosines() const¶
Returns the vector of the cosine points.
-
inline const std::vector<double> &pdf() const¶
Returns the vector of the PDF values.
-
inline const std::vector<double> &cdf() const¶
Returns the vector of the CDF values.
-
inline Interpolation interpolation() const¶
Returns the type of interpolation used on the table (Histogram or LinLin).
-
AngleTable(const ACE &ace, std::size_t i)¶
Legendre¶
-
class Legendre : public pndl::AngleLaw¶
Angular distribution represented by a series of Legendre polynomials.
Public Functions
-
Legendre(const std::vector<double> &a)¶
Constructs a Legendre series from coefficients, starting with the 1st order moment.
- Parameters
a – Vector containing the Legendre moments, from the 1st order up. These coefficients will be multiplied by (2l + 1)/2.
-
virtual double sample_mu(const std::function<double()> &rng) const final override¶
Samples a scattering cosine from the distribution.
- Parameters
xi – Random variable from the interval [0,1).
rng – Random number generator function.
-
virtual double pdf(double mu) const final override¶
Returns the PDF for the desired scattering cosine.
- Parameters
mu – Scatter cosnine at which to evaluate the PDF.
-
Legendre(const std::vector<double> &a)¶
Isotropic¶
-
class Isotropic : public pndl::AngleLaw¶
Isotropic angular distribution.
Public Functions
-
inline Isotropic()¶
-
~Isotropic() = default¶
-
virtual double sample_mu(const std::function<double()> &rng) const final override¶
Samples a scattering cosine from the distribution.
- Parameters
xi – Random variable from the interval [0,1).
rng – Random number generator function.
-
virtual double pdf(double mu) const final override¶
Returns the PDF for the desired scattering cosine.
- Parameters
mu – Scatter cosnine at which to evaluate the PDF.
-
inline Isotropic()¶