#ifndef SCATTERING_ANGLE_DISTRIBUTION_H #define SCATTERING_ANGLE_DISTRIBUTION_H #include #include #include #include #include #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 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: std::shared_ptr energy_binning_; std::vector> 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 lower_distribution, std::shared_ptr higher_distribution, double decider_energy); // draw a value from the distribution double roll(std::mt19937* engine, double energy_eV); private: std::shared_ptr lower_distribution_; std::shared_ptr higher_distribution_; const double decider_energy_; }; #endif /* SCATTERING_ANGLE_DISTRIBUTION_H */