Many, many more comments

This commit is contained in:
2024-12-04 17:15:04 +01:00
parent 8696517336
commit 03854339ca
100 changed files with 1702 additions and 49 deletions
@@ -9,23 +9,33 @@
#include "simulation/energy_binning.h"
// class defining the minimum requirements of a scattering angle distribution
class ScatteringAngleDistribution {
public:
// draw a value for the scattering angle depending on the energy (in eV) and
// the random engine
virtual double roll(std::mt19937* engine, double energy_eV) = 0;
};
// class for an isotropic scattering angle distribution
class IsotropicAngleDistribution : public ScatteringAngleDistribution {
public:
// Constructor: initializes a uniform distribution between (o,2pi)
IsotropicAngleDistribution();
// draw from a uniform distribution
double roll(std::mt19937* engine, double energy_eV = 0.);
private:
std::uniform_real_distribution<double> distribution_;
};
// class for drawing from a piecewise linear scattering angle distribution
class AngleDistributionFromFile : public ScatteringAngleDistribution {
public:
// Constructor: takes string containing the absolute path (including the file)
// that contains the data of the scattering angle distribution
AngleDistributionFromFile(std::string absolute_filepath);
// draw a value from the distribution
double roll(std::mt19937* engine, double energy_eV);
private:
@@ -33,12 +43,17 @@ class AngleDistributionFromFile : public ScatteringAngleDistribution {
std::vector<std::piecewise_linear_distribution<double>> angle_distributions_;
};
// class for a composition of two scattering angle distibutions
class CompositeAngleDistribution : public ScatteringAngleDistribution {
public:
// Constructor: takes two ScatteringAngleDistributions and a decider energy (eV)
// if energy_eV < decider energy use lower_distribution
// otherwise use the higher_distribution
CompositeAngleDistribution(
std::shared_ptr<ScatteringAngleDistribution> lower_distribution,
std::shared_ptr<ScatteringAngleDistribution> higher_distribution,
double decider_energy);
// draw a value from the distribution
double roll(std::mt19937* engine, double energy_eV);
private: