Many, many more comments
This commit is contained in:
@@ -4,14 +4,20 @@
|
||||
#include <functional>
|
||||
#include <random>
|
||||
|
||||
// class defining the minimum requirements of an EnergyDistributionFunction child class
|
||||
class EnergyDistributionFunction {
|
||||
public:
|
||||
virtual double rollEnergy(std::mt19937* engine) = 0; // eV
|
||||
// draw an energy value using the provided engine in eV
|
||||
virtual double rollEnergy(std::mt19937* engine) = 0;
|
||||
};
|
||||
|
||||
// class for drawing an energy value from the Fermi spectrum of the Tritium beta decay
|
||||
// using the rejection method
|
||||
class TritiumBetaDecay : public EnergyDistributionFunction {
|
||||
public:
|
||||
// Constructor: initializes the random distributions
|
||||
TritiumBetaDecay();
|
||||
// draw an energy (eV) from the Fermi spectrum of the Tritium beta decay
|
||||
double rollEnergy(std::mt19937* engine);
|
||||
|
||||
private:
|
||||
@@ -20,18 +26,24 @@ class TritiumBetaDecay : public EnergyDistributionFunction {
|
||||
std::uniform_real_distribution<double> y_distribution_;
|
||||
};
|
||||
|
||||
// class for drawing an energy value from the Maxwell Boltzmann energy distribution
|
||||
class MaxwellBoltzmann : public EnergyDistributionFunction {
|
||||
public:
|
||||
// initialize the distribution with the temperature (in K)
|
||||
MaxwellBoltzmann(double temperature_K);
|
||||
double rollEnergy(std::mt19937* engine); // eV
|
||||
// draw an energy (in eV) from the Maxwell Boltzmann energy distribtion
|
||||
double rollEnergy(std::mt19937* engine);
|
||||
private:
|
||||
std::gamma_distribution<double> distribution_;
|
||||
};
|
||||
|
||||
// class for returnig a constant energy value
|
||||
class Constant : public EnergyDistributionFunction {
|
||||
public:
|
||||
// Constructor: takes the energy value (in eV) that will be returned later
|
||||
Constant(double constant_eV);
|
||||
double rollEnergy(std::mt19937* engine); // eV
|
||||
// return the energy (in eV) set at construction of the object
|
||||
double rollEnergy(std::mt19937* engine);
|
||||
private:
|
||||
const double constant_eV_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user