GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSXRaySource Class Reference

This class define a XRay source in GGEMS useful for CT/CBCT simulation. More...

#include "GGEMSXRaySource.hh"

Inheritance diagram for GGEMSXRaySource:
Inheritance graph
Collaboration diagram for GGEMSXRaySource:
Collaboration graph

Public Member Functions

 GGEMSXRaySource (std::string const &source_name)
 GGEMSXRaySource constructor. More...
 
 ~GGEMSXRaySource (void)
 GGEMSXRaySource destructor. More...
 
 GGEMSXRaySource (GGEMSXRaySource const &xray_source)=delete
 Avoid copy by reference. More...
 
GGEMSXRaySourceoperator= (GGEMSXRaySource const &xray_source)=delete
 Avoid assignement by reference. More...
 
 GGEMSXRaySource (GGEMSXRaySource const &&xray_source)=delete
 Avoid copy by rvalue reference. More...
 
GGEMSXRaySourceoperator= (GGEMSXRaySource const &&xray_source)=delete
 Avoid copy by rvalue reference. More...
 
void SetBeamAperture (GGfloat const &beam_aperture, std::string const &unit="deg")
 Set the beam aperture of the source. More...
 
void SetFocalSpotSize (GGfloat const &width, GGfloat const &height, GGfloat const &depth, std::string const &unit="mm")
 Set the focal spot size of the x-ray source. More...
 
void SetMonoenergy (GGfloat const &monoenergy, std::string const &unit="keV")
 set the value of energy in monoenergy mode More...
 
void SetPolyenergy (std::string const &energy_spectrum_filename)
 set the energy spectrum file for polyenergy mode More...
 
void Initialize (bool const &is_tracking=false) override
 Initialize a GGEMS source. More...
 
void PrintInfos (void) const override
 Printing infos about the source. More...
 
void GetPrimaries (GGsize const &thread_index, GGsize const &number_of_particles) override
 Generate primary particles. More...
 
- Public Member Functions inherited from GGEMSSource
 GGEMSSource (std::string const &source_name)
 GGEMSSource constructor. More...
 
virtual ~GGEMSSource (void)
 GGEMSSource destructor. More...
 
 GGEMSSource (GGEMSSource const &source)=delete
 Avoid copy by reference. More...
 
GGEMSSourceoperator= (GGEMSSource const &source)=delete
 Avoid assignement by reference. More...
 
 GGEMSSource (GGEMSSource const &&source)=delete
 Avoid copy by rvalue reference. More...
 
GGEMSSourceoperator= (GGEMSSource const &&source)=delete
 Avoid copy by rvalue reference. More...
 
std::string GetNameOfSource (void) const
 get the name of the source More...
 
void SetPosition (GGfloat const &pos_x, GGfloat const &pos_y, GGfloat const &pos_z, std::string const &unit="mm")
 Set the position of the source in the global coordinates. More...
 
void SetSourceParticleType (std::string const &particle_type)
 Set the type of the particle: electron, positron or photon. More...
 
void SetRotation (GGfloat const &rx, GGfloat const &ry, GGfloat const &rz, std::string const &unit="deg")
 Set the rotation of the source around global axis. More...
 
void SetNumberOfParticles (GGsize const &number_of_particles)
 Set the number of particles to simulate during the simulation. More...
 
void EnableTracking (void)
 Enabling tracking infos during simulation. More...
 
GGsize GetNumberOfBatchs (GGsize const &device_index) const
 method returning the number of particles by batch More...
 
GGsize GetNumberOfParticlesInBatch (GGsize const &device_index, GGsize const &batch_index)
 method returning the number of particles in a specific batch More...
 

Private Member Functions

void InitializeKernel (void) override
 Initialize kernel for specific source in OpenCL. More...
 
void FillEnergy (void)
 fill energy for poly or mono energy mode More...
 
void CheckParameters (void) const override
 Check mandatory parameters for a source. More...
 

Private Attributes

GGfloat beam_aperture_
 
GGfloat3 focal_spot_size_
 
GGbool is_monoenergy_mode_
 
GGfloat monoenergy_
 
std::string energy_spectrum_filename_
 
GGsize number_of_energy_bins_
 
cl::Buffer ** energy_spectrum_
 
cl::Buffer ** cdf_
 

Additional Inherited Members

- Protected Attributes inherited from GGEMSSource
std::string source_name_
 
GGsize number_of_particles_
 
GGsizenumber_of_particles_by_device_
 
GGsize ** number_of_particles_in_batch_
 
GGsizenumber_of_batchs_
 
GGchar particle_type_
 
std::string tracking_kernel_option_
 
GGEMSGeometryTransformationgeometry_transformation_
 
cl::Kernel ** kernel_get_primaries_
 
GGsize number_activated_devices_
 

Detailed Description

This class define a XRay source in GGEMS useful for CT/CBCT simulation.

Definition at line 40 of file GGEMSXRaySource.hh.

Constructor & Destructor Documentation

◆ GGEMSXRaySource() [1/3]

GGEMSXRaySource::GGEMSXRaySource ( std::string const &  source_name)
explicit

GGEMSXRaySource constructor.

Parameters
source_name- name of the source

Definition at line 43 of file GGEMSXRaySource.cc.

◆ ~GGEMSXRaySource()

GGEMSXRaySource::~GGEMSXRaySource ( void  )

GGEMSXRaySource destructor.

Definition at line 80 of file GGEMSXRaySource.cc.

◆ GGEMSXRaySource() [2/3]

GGEMSXRaySource::GGEMSXRaySource ( GGEMSXRaySource const &  xray_source)
delete

Avoid copy by reference.

Parameters
xray_source- reference on the GGEMS XRay source

◆ GGEMSXRaySource() [3/3]

GGEMSXRaySource::GGEMSXRaySource ( GGEMSXRaySource const &&  xray_source)
delete

Avoid copy by rvalue reference.

Parameters
xray_source- rvalue reference on the GGEMS XRay source

Member Function Documentation

◆ CheckParameters()

void GGEMSXRaySource::CheckParameters ( void  ) const
overrideprivatevirtual

Check mandatory parameters for a source.

Reimplemented from GGEMSSource.

Definition at line 271 of file GGEMSXRaySource.cc.

◆ FillEnergy()

void GGEMSXRaySource::FillEnergy ( void  )
private

fill energy for poly or mono energy mode

Definition at line 329 of file GGEMSXRaySource.cc.

◆ GetPrimaries()

void GGEMSXRaySource::GetPrimaries ( GGsize const &  thread_index,
GGsize const &  number_of_particles 
)
overridevirtual

Generate primary particles.

Parameters
thread_index- index of activated device (thread index)
number_of_particles- number of particles to generate

Implements GGEMSSource.

Definition at line 139 of file GGEMSXRaySource.cc.

◆ Initialize()

void GGEMSXRaySource::Initialize ( bool const &  is_tracking = false)
overridevirtual

Initialize a GGEMS source.

Parameters
is_tracking- flag activating tracking

Reimplemented from GGEMSSource.

Definition at line 425 of file GGEMSXRaySource.cc.

◆ InitializeKernel()

void GGEMSXRaySource::InitializeKernel ( void  )
overrideprivatevirtual

Initialize kernel for specific source in OpenCL.

Implements GGEMSSource.

Definition at line 120 of file GGEMSXRaySource.cc.

◆ operator=() [1/2]

GGEMSXRaySource & GGEMSXRaySource::operator= ( GGEMSXRaySource const &&  xray_source)
delete

Avoid copy by rvalue reference.

Parameters
xray_source- rvalue reference on the GGEMS XRay source

◆ operator=() [2/2]

GGEMSXRaySource & GGEMSXRaySource::operator= ( GGEMSXRaySource const &  xray_source)
delete

Avoid assignement by reference.

Parameters
xray_source- reference on the GGEMS XRay source

◆ PrintInfos()

void GGEMSXRaySource::PrintInfos ( void  ) const
overridevirtual

Printing infos about the source.

Implements GGEMSSource.

Definition at line 192 of file GGEMSXRaySource.cc.

◆ SetBeamAperture()

void GGEMSXRaySource::SetBeamAperture ( GGfloat const &  beam_aperture,
std::string const &  unit = "deg" 
)

Set the beam aperture of the source.

Parameters
beam_aperture- beam aperture of the x-ray source
unit- unit of the angle

Definition at line 446 of file GGEMSXRaySource.cc.

◆ SetFocalSpotSize()

void GGEMSXRaySource::SetFocalSpotSize ( GGfloat const &  width,
GGfloat const &  height,
GGfloat const &  depth,
std::string const &  unit = "mm" 
)

Set the focal spot size of the x-ray source.

Parameters
width- width of the focal spot size
height- height of the focal spot size
depth- depth of the focal spot size
unit- unit of the distance

Definition at line 455 of file GGEMSXRaySource.cc.

◆ SetMonoenergy()

void GGEMSXRaySource::SetMonoenergy ( GGfloat const &  monoenergy,
std::string const &  unit = "keV" 
)

set the value of energy in monoenergy mode

Parameters
monoenergy- Monoenergy value
unit- unit of the energy

Definition at line 251 of file GGEMSXRaySource.cc.

◆ SetPolyenergy()

void GGEMSXRaySource::SetPolyenergy ( std::string const &  energy_spectrum_filename)

set the energy spectrum file for polyenergy mode

Parameters
energy_spectrum_filename- filename containing the energy spectrum

Definition at line 261 of file GGEMSXRaySource.cc.

Member Data Documentation

◆ beam_aperture_

GGfloat GGEMSXRaySource::beam_aperture_
private

Beam aperture of the x-ray source

Definition at line 156 of file GGEMSXRaySource.hh.

◆ cdf_

cl::Buffer** GGEMSXRaySource::cdf_
private

Cumulative distribution function to generate a random energy

Definition at line 163 of file GGEMSXRaySource.hh.

◆ energy_spectrum_

cl::Buffer** GGEMSXRaySource::energy_spectrum_
private

Energy spectrum for OpenCL device

Definition at line 162 of file GGEMSXRaySource.hh.

◆ energy_spectrum_filename_

std::string GGEMSXRaySource::energy_spectrum_filename_
private

The energy spectrum filename for polyenergetic mode

Definition at line 160 of file GGEMSXRaySource.hh.

◆ focal_spot_size_

GGfloat3 GGEMSXRaySource::focal_spot_size_
private

Focal spot size of the x-ray source

Definition at line 157 of file GGEMSXRaySource.hh.

◆ is_monoenergy_mode_

GGbool GGEMSXRaySource::is_monoenergy_mode_
private

Boolean checking the mode of energy

Definition at line 158 of file GGEMSXRaySource.hh.

◆ monoenergy_

GGfloat GGEMSXRaySource::monoenergy_
private

Monoenergy mode

Definition at line 159 of file GGEMSXRaySource.hh.

◆ number_of_energy_bins_

GGsize GGEMSXRaySource::number_of_energy_bins_
private

Number of energy bins for the polyenergetic mode

Definition at line 161 of file GGEMSXRaySource.hh.


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