5#include "photon_interactions.h"
8#include "particle_interaction_behavior.h"
27 Photon() : interaction_behavior_(std::make_shared<PhotoelectricEffect>()) {}
35 Photon(Eigen::Vector3d& position, Eigen::Vector3d& direction,
double energy) :
Particle(position, direction, energy) {
36 interaction_behavior_ = std::make_shared<PhotoelectricEffect>();
45 return interaction_behavior_->interact(*
this, material);
54 interaction_behavior_ = std::move(interaction_behavior);
61 scattering_history_.coherent++;
62 scattering_history_.total++;
69 scattering_history_.incoherent++;
70 scattering_history_.total++;
79 return scattering_history_.total;
88 return scattering_history_.coherent;
97 return scattering_history_.incoherent;
102 std::shared_ptr<ParticleInteractionBehavior> interaction_behavior_;
Class which represents a material.
Class which represents a particle.
Class which represents a photon. Inherits from Particle.
int getCoherentScatterCount() const
Returns the number of coherent scatters in the scattering history.
double interact(Material &material)
Performs the current interaction behavior of the photon.
void setInteractionBehavior(std::shared_ptr< ParticleInteractionBehavior > interaction_behavior)
Sets the interaction behavior of the photon.
void addIncoherentScatter()
Adds an incoherent scatter to the scattering history.
int getIncoherentScatterCount() const
Returns the number of incoherent scatters in the scattering history.
Photon(Eigen::Vector3d &position, Eigen::Vector3d &direction, double energy)
Constructor for the Photon class.
void addCoherentScatter()
Adds a coherent scatter to the scattering history.
int getTotalScatterCount() const
Returns to total number of scatters in the scattering history.
Struct which contains the scattering history of a photon.