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

Class which represents a particle. More...

#include <particle.h>

Collaboration diagram for Particle:

Public Member Functions

 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

Eigen::Vector3d position_
 
Eigen::Vector3d direction_
 
double energy_ {}
 
bool terminated_ = false
 
bool isPrimary_ = true
 

Detailed Description

Class which represents a particle.

This class contains the properties of a particle.

Definition at line 36 of file particle.h.

Constructor & Destructor Documentation

◆ Particle()

Particle::Particle ( Eigen::Vector3d & position,
Eigen::Vector3d & direction,
double energy )

Constructor for the Particle class.

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

Member Function Documentation

◆ getDirection()

Eigen::Vector3d Particle::getDirection ( ) const
inline

Returns the direction of the particle.

Returns
The direction of the particle.

Definition at line 60 of file particle.h.

◆ getEnergy()

double Particle::getEnergy ( ) const
inline

Returns the energy of the particle.

Returns
The energy of the particle.

Definition at line 67 of file particle.h.

◆ getPosition()

Eigen::Vector3d Particle::getPosition ( ) const
inline

Returns the position of the particle.

Returns
The position of the particle.

Definition at line 53 of file particle.h.

◆ isPrimary()

bool Particle::isPrimary ( ) const
inline

Returns whether or not the particle is primary.

Returns
Whether or not the particle is primary.

Definition at line 129 of file particle.h.

◆ isTerminated()

bool Particle::isTerminated ( ) const
inline

Returns whether or not the particle has terminated.

Returns
Whether or not the particle has terminated.

Definition at line 113 of file particle.h.

◆ move()

void Particle::move ( const double & distance)
inline

Moves the particle by the given distance in the direction of the particle.

Parameters
distanceThe distance to move the particle by.

Definition at line 74 of file particle.h.

◆ rotate()

void Particle::rotate ( const double & theta,
const double & phi )
inline

Rotates the particle by the given angles with respect to the initial direction of the particle, represented by the z axis.

The z

Parameters
thetaThe polar angle to rotate the particle by.
phiThe azimuthal to rotate the particle by.

Definition at line 95 of file particle.h.

◆ setDirection()

void Particle::setDirection ( const Eigen::Vector3d & newDirection)
inline

Sets the direction of the particle.

Parameters
newDirectionThe new direction of the particle.

Definition at line 83 of file particle.h.

◆ setEnergy()

void Particle::setEnergy ( const double & newEnergy)
inline

Sets the energy of the particle.

Parameters
newEnergyThe new energy of the particle.

Definition at line 104 of file particle.h.

◆ setPrimary()

void Particle::setPrimary ( bool primary_status)
inline

Sets whether or not the particle is primary.

Parameters
primary_statusWhether or not the particle is primary.

Definition at line 138 of file particle.h.

◆ terminate()

void Particle::terminate ( )
inline

Terminates the particle.

Definition at line 120 of file particle.h.

Member Data Documentation

◆ direction_

Eigen::Vector3d Particle::direction_
private

Definition at line 143 of file particle.h.

◆ energy_

double Particle::energy_ {}
private

Definition at line 144 of file particle.h.

◆ isPrimary_

bool Particle::isPrimary_ = true
private

Definition at line 146 of file particle.h.

◆ position_

Eigen::Vector3d Particle::position_
private

Definition at line 142 of file particle.h.

◆ terminated_

bool Particle::terminated_ = false
private

Definition at line 145 of file particle.h.


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