MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Photon Class Reference

Class which represents a photon. Inherits from Particle. More...

#include <photon.h>

Collaboration diagram for Photon:

Public Member Functions

 Photon (Eigen::Vector3d &position, Eigen::Vector3d &direction, double energy)
 Constructor for the Photon class.
 
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 addCoherentScatter ()
 Adds a coherent scatter to the scattering history.
 
void addIncoherentScatter ()
 Adds an incoherent scatter to the scattering history.
 
int getTotalScatterCount () const
 Returns to total number of scatters in the scattering history.
 
int getCoherentScatterCount () const
 Returns the number of coherent scatters in the scattering history.
 
int getIncoherentScatterCount () const
 Returns the number of incoherent scatters in the scattering history.
 
- Public Member Functions inherited from Particle
 Particle (Eigen::Vector3d &position, Eigen::Vector3d &direction, double energy)
 Constructor for the Particle class.
 
Eigen::Vector3d getPosition () const
 Returns the position of the particle.
 
Eigen::Vector3d getDirection () const
 Returns the direction of the particle.
 
double getEnergy () const
 Returns the energy of the particle.
 
void move (const double &distance)
 Moves the particle by the given distance in the direction of the particle.
 
void setDirection (const Eigen::Vector3d &newDirection)
 Sets the direction of the particle.
 
void rotate (const double &theta, const double &phi)
 Rotates the particle by the given angles with respect to the initial direction of the particle, represented by the z axis.
 
void setEnergy (const double &newEnergy)
 Sets the energy of the particle.
 
bool isTerminated () const
 Returns whether or not the particle has terminated.
 
void terminate ()
 Terminates the particle.
 
bool isPrimary () const
 Returns whether or not the particle is primary.
 
void setPrimary (bool primary_status)
 Sets whether or not the particle is primary.
 

Private Attributes

std::shared_ptr< ParticleInteractionBehaviorinteraction_behavior_
 
PhotonScatteringHistory scattering_history_
 

Detailed Description

Class which represents a photon. Inherits from Particle.

Adds specific photon interacts and scattering history to the Particle class.

Definition at line 25 of file photon.h.

Constructor & Destructor Documentation

◆ Photon() [1/2]

Photon::Photon ( )
inline

Definition at line 27 of file photon.h.

◆ Photon() [2/2]

Photon::Photon ( Eigen::Vector3d & position,
Eigen::Vector3d & direction,
double energy )
inline

Constructor for the Photon class.

Parameters
positionThe initial position of the photon.
directionThe initial direction of the photon.
energyThe initial energy of the photon.

Definition at line 35 of file photon.h.

Member Function Documentation

◆ addCoherentScatter()

void Photon::addCoherentScatter ( )
inline

Adds a coherent scatter to the scattering history.

Definition at line 60 of file photon.h.

◆ addIncoherentScatter()

void Photon::addIncoherentScatter ( )
inline

Adds an incoherent scatter to the scattering history.

Definition at line 68 of file photon.h.

◆ getCoherentScatterCount()

int Photon::getCoherentScatterCount ( ) const
inline

Returns the number of coherent scatters in the scattering history.

Returns
The number of coherent scatters in the scattering history.

Definition at line 87 of file photon.h.

◆ getIncoherentScatterCount()

int Photon::getIncoherentScatterCount ( ) const
inline

Returns the number of incoherent scatters in the scattering history.

Returns
The number of incoherent scatters in the scattering history.

Definition at line 96 of file photon.h.

◆ getTotalScatterCount()

int Photon::getTotalScatterCount ( ) const
inline

Returns to total number of scatters in the scattering history.

Returns
The total number of scatters in the scattering history.

Definition at line 78 of file photon.h.

◆ interact()

double Photon::interact ( Material & material)
inline

Performs the current interaction behavior of the photon.

Returns
The energy deposited at location of interaction.

Definition at line 44 of file photon.h.

◆ setInteractionBehavior()

void Photon::setInteractionBehavior ( std::shared_ptr< ParticleInteractionBehavior > interaction_behavior)
inline

Sets the interaction behavior of the photon.

Parameters
interaction_behaviorThe interaction behavior to set.

Definition at line 53 of file photon.h.

Member Data Documentation

◆ interaction_behavior_

std::shared_ptr<ParticleInteractionBehavior> Photon::interaction_behavior_
private

Definition at line 102 of file photon.h.

◆ scattering_history_

PhotonScatteringHistory Photon::scattering_history_
private

Definition at line 103 of file photon.h.


The documentation for this class was generated from the following file: