11#include "probability_dist.h"
14namespace SourceHelpers {
15 Eigen::Vector3d angleToUnitDirection(
double theta,
double phi);
16 Eigen::MatrixXd readCSV(
const std::string& file);
25 virtual double sampleEnergy() = 0;
79 Eigen::Matrix<double, Eigen::Dynamic, 2> probabilities_matrix_;
88 virtual Eigen::Vector3d sampleDirection(
const Eigen::Vector3d &photon_initial_position) = 0;
105 Eigen::Vector3d
sampleDirection(
const Eigen::Vector3d &photon_initial_position)
override;
129 Eigen::Vector3d
sampleDirection(
const Eigen::Vector3d &photon_initial_position)
override;
131 Eigen::Vector3d pass_through_point_;
155 Eigen::Vector3d
sampleDirection(
const Eigen::Vector3d &photon_initial_position)
override;
157 Eigen::Vector3d corner_;
158 Eigen::Vector3d edge1_;
159 Eigen::Vector3d edge2_;
160 Eigen::Vector3d normal_;
163 void handleOrthogonalEdges();
165 bool areEdgesOrthogonal();
189 Eigen::Vector3d
sampleDirection(
const Eigen::Vector3d &photon_initial_position)
override;
191 Eigen::Vector3d center_;
192 Eigen::Vector3d normal_;
199 Eigen::Vector3d calculateNormalizedPerimeterVector(
double theta);
207 virtual Eigen::Vector3d samplePosition() = 0;
211 Eigen::Vector3d position_;
252 std::unique_ptr<Directionality> directionality,
253 std::unique_ptr<SourceGeometry> source_geometry);
261 std::unique_ptr<EnergySpectrum> energy_spectrum_;
262 std::unique_ptr<Directionality> directionality_;
263 std::unique_ptr<SourceGeometry> source_geometry_;
Class which represents a beam directionality.
BeamDirectionality(Eigen::Vector3d pass_through_point)
Constructor for the BeamDirectionality class.
Eigen::Vector3d sampleDirection(const Eigen::Vector3d &photon_initial_position) override
Returns a sample from the beam directionality.
Virtual class which represents a directionality for a photon source.
Class which represents a disc isotropic directionality.
DiscIsotropicDirectionality(Eigen::Vector3d center, Eigen::Vector3d normal, double radius)
Constructor for the DiscIsotropicDirectionality class.
Eigen::Vector3d sampleDirection(const Eigen::Vector3d &photon_initial_position) override
Returns a sample from the disc isotropic directionality.
Virtual class which represents an energy spectrum for a photon source.
Class which represents an isotropic directionality.
Eigen::Vector3d sampleDirection(const Eigen::Vector3d &photon_initial_position) override
Returns a sample from the isotropic directionality.
Class which represents a monoenergetic energy spectrum.
MonoenergeticSpectrum(double energy)
Constructor for the MonoenergeticSpectrum class.
double sampleEnergy() override
Returns the energy of the monoenergetic spectrum.
Class which represents a photon. Inherits from Particle.
Class which represents a photon source.
PhotonSource(std::unique_ptr< EnergySpectrum > energy_spectrum, std::unique_ptr< Directionality > directionality, std::unique_ptr< SourceGeometry > source_geometry)
Constructor for the PhotonSource class.
Photon generatePhoton()
Returns a photon generated from the photon source.
Class which represents a point geometry.
PointGeometry(const Eigen::Vector3d &position)
Constructor for the PointGeometry class.
Eigen::Vector3d samplePosition() override
Returns the position of the point.
Class which represents a polyenergetic energy spectrum.
double sampleEnergy() override
Returns a sample from the polyenergetic spectrum.
double getExpectationValue() const
Returns the expectation value of the polyenergetic spectrum.
PolyenergeticSpectrum(const Eigen::Matrix< double, Eigen::Dynamic, 2 > &probabilities_matrix)
Constructor for the PolyenergeticSpectrum class.
Class which uses inversion sampling to sample from a discrete distribution.
Class which represents a rectangular isotropic directionality.
RectangularIsotropicDirectionality(Eigen::Vector3d corner, Eigen::Vector3d edge1, Eigen::Vector3d edge2)
Constructor for the RectangularIsotropicDirectionality class.
Eigen::Vector3d sampleDirection(const Eigen::Vector3d &photon_initial_position) override
Returns a sample from the rectangular isotropic directionality.
Virtual class which represents a geometry for a photon source.
Contains constants used throughout the code.