GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSSource Class Referenceabstract

GGEMS mother class for the source. More...

#include "GGEMSSource.hh"

Inheritance diagram for GGEMSSource:
Inheritance graph
Collaboration diagram for GGEMSSource:
Collaboration graph

Public Member Functions

 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...
 
virtual void CheckParameters (void) const
 Check mandatory parameters for a source. More...
 
virtual void Initialize (bool const &is_tracking=false)
 Initialize a GGEMS source. More...
 
virtual void GetPrimaries (GGsize const &thread_index, GGsize const &number_of_particles)=0
 Generate primary particles. More...
 
virtual void PrintInfos (void) const =0
 Printing infos about the source. More...
 

Protected Member Functions

virtual void InitializeKernel (void)=0
 Initialize kernel for specific source in OpenCL. More...
 

Protected Attributes

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_
 

Private Member Functions

void OrganizeParticlesInBatch (void)
 Organize the particles in batch. More...
 

Detailed Description

GGEMS mother class for the source.

Definition at line 44 of file GGEMSSource.hh.

Constructor & Destructor Documentation

◆ GGEMSSource() [1/3]

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

GGEMSSource constructor.

Parameters
source_name- name of the source

Definition at line 41 of file GGEMSSource.cc.

◆ ~GGEMSSource()

GGEMSSource::~GGEMSSource ( void  )
virtual

GGEMSSource destructor.

Definition at line 72 of file GGEMSSource.cc.

◆ GGEMSSource() [2/3]

GGEMSSource::GGEMSSource ( GGEMSSource const &  source)
delete

Avoid copy by reference.

Parameters
source- reference on the GGEMS source

◆ GGEMSSource() [3/3]

GGEMSSource::GGEMSSource ( GGEMSSource const &&  source)
delete

Avoid copy by rvalue reference.

Parameters
source- rvalue reference on the GGEMS source

Member Function Documentation

◆ CheckParameters()

void GGEMSSource::CheckParameters ( void  ) const
virtual

Check mandatory parameters for a source.

Reimplemented in GGEMSXRaySource.

Definition at line 177 of file GGEMSSource.cc.

◆ EnableTracking()

void GGEMSSource::EnableTracking ( void  )

Enabling tracking infos during simulation.

Definition at line 112 of file GGEMSSource.cc.

◆ GetNameOfSource()

std::string GGEMSSource::GetNameOfSource ( void  ) const
inline

get the name of the source

Returns
name of the source

Definition at line 91 of file GGEMSSource.hh.

◆ GetNumberOfBatchs()

GGsize GGEMSSource::GetNumberOfBatchs ( GGsize const &  device_index) const
inline

method returning the number of particles by batch

Parameters
device_index- index of activated device
Returns
the number of batch of particle

Definition at line 139 of file GGEMSSource.hh.

◆ GetNumberOfParticlesInBatch()

GGulong GGEMSSource::GetNumberOfParticlesInBatch ( GGsize const &  device_index,
GGsize const &  batch_index 
)
inline

method returning the number of particles in a specific batch

Parameters
device_index- index of activated device
batch_index- index of the batch
Returns
the number of particle for a specific batch

Definition at line 148 of file GGEMSSource.hh.

◆ GetPrimaries()

void GGEMSSource::GetPrimaries ( GGsize const &  thread_index,
GGsize const &  number_of_particles 
)
pure virtual

Generate primary particles.

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

Implemented in GGEMSXRaySource.

◆ Initialize()

void GGEMSSource::Initialize ( bool const &  is_tracking = false)
virtual

Initialize a GGEMS source.

Parameters
is_tracking- flag activating tracking

Reimplemented in GGEMSXRaySource.

Definition at line 287 of file GGEMSSource.cc.

◆ InitializeKernel()

void GGEMSSource::InitializeKernel ( void  )
protectedpure virtual

Initialize kernel for specific source in OpenCL.

Implemented in GGEMSXRaySource.

◆ operator=() [1/2]

GGEMSSource & GGEMSSource::operator= ( GGEMSSource const &&  source)
delete

Avoid copy by rvalue reference.

Parameters
source- rvalue reference on the GGEMS source

◆ operator=() [2/2]

GGEMSSource & GGEMSSource::operator= ( GGEMSSource const &  source)
delete

Avoid assignement by reference.

Parameters
source- reference on the GGEMS source

◆ OrganizeParticlesInBatch()

void GGEMSSource::OrganizeParticlesInBatch ( void  )
private

Organize the particles in batch.

Definition at line 226 of file GGEMSSource.cc.

◆ PrintInfos()

void GGEMSSource::PrintInfos ( void  ) const
pure virtual

Printing infos about the source.

Implemented in GGEMSXRaySource.

◆ SetNumberOfParticles()

void GGEMSSource::SetNumberOfParticles ( GGsize const &  number_of_particles)

Set the number of particles to simulate during the simulation.

Parameters
number_of_particles- number of particles to simulate

Definition at line 134 of file GGEMSSource.cc.

◆ SetPosition()

void GGEMSSource::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.

Parameters
pos_x- Position of the source in X
pos_y- Position of the source in Y
pos_z- Position of the source in Z
unit- unit of the distance

Definition at line 121 of file GGEMSSource.cc.

◆ SetRotation()

void GGEMSSource::SetRotation ( GGfloat const &  rx,
GGfloat const &  ry,
GGfloat const &  rz,
std::string const &  unit = "deg" 
)

Set the rotation of the source around global axis.

Parameters
rx- Rotation around X along global axis
ry- Rotation around Y along global axis
rz- Rotation around Z along global axis
unit- unit of the angle

Definition at line 164 of file GGEMSSource.cc.

◆ SetSourceParticleType()

void GGEMSSource::SetSourceParticleType ( std::string const &  particle_type)

Set the type of the particle: electron, positron or photon.

Parameters
particle_type- Type of the particle

Definition at line 143 of file GGEMSSource.cc.

Member Data Documentation

◆ geometry_transformation_

GGEMSGeometryTransformation* GGEMSSource::geometry_transformation_
protected

Pointer storing the geometry transformation

Definition at line 201 of file GGEMSSource.hh.

◆ kernel_get_primaries_

cl::Kernel** GGEMSSource::kernel_get_primaries_
protected

Kernel generating primaries on OpenCL device

Definition at line 203 of file GGEMSSource.hh.

◆ number_activated_devices_

GGsize GGEMSSource::number_activated_devices_
protected

Number of activated device

Definition at line 204 of file GGEMSSource.hh.

◆ number_of_batchs_

GGsize* GGEMSSource::number_of_batchs_
protected

Number of batchs for each device

Definition at line 197 of file GGEMSSource.hh.

◆ number_of_particles_

GGsize GGEMSSource::number_of_particles_
protected

Number of particles

Definition at line 193 of file GGEMSSource.hh.

◆ number_of_particles_by_device_

GGsize* GGEMSSource::number_of_particles_by_device_
protected

Number of particles by device

Definition at line 194 of file GGEMSSource.hh.

◆ number_of_particles_in_batch_

GGsize** GGEMSSource::number_of_particles_in_batch_
protected

Number of particles in batch for each device

Definition at line 196 of file GGEMSSource.hh.

◆ particle_type_

GGchar GGEMSSource::particle_type_
protected

Type of particle: photon, electron or positron

Definition at line 199 of file GGEMSSource.hh.

◆ source_name_

std::string GGEMSSource::source_name_
protected

Name of the source

Definition at line 192 of file GGEMSSource.hh.

◆ tracking_kernel_option_

std::string GGEMSSource::tracking_kernel_option_
protected

Preprocessor option for tracking

Definition at line 200 of file GGEMSSource.hh.


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