|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file.
44 GGcout(
"GGEMSMaterials",
"GGEMSMaterials", 3) <<
"GGEMSMaterials creating..." <<
GGendl;
58 GGcout(
"GGEMSMaterials",
"GGEMSMaterials", 3) <<
"GGEMSMaterials created!!!" <<
GGendl;
67 GGcout(
"GGEMSMaterials",
"~GGEMSMaterials", 3) <<
"GGEMSMaterials erasing..." <<
GGendl;
74 GGcout(
"GGEMSMaterials",
"~GGEMSMaterials", 3) <<
"GGEMSMaterials erased!!!" <<
GGendl;
83 GGcout(
"GGEMSMaterials",
"Clean", 3) <<
"GGEMSMaterials cleaning..." <<
GGendl;
95 GGcout(
"GGEMSMaterials",
"Clean", 3) <<
"GGEMSMaterials cleaned!!!" <<
GGendl;
120 if (particle_name ==
"gamma") {
123 else if (particle_name ==
"e+") {
126 else if (particle_name ==
"e-") {
130 std::ostringstream oss(std::ostringstream::out);
131 oss <<
"Particle name " << particle_name <<
" unknown!!! The particles are:" << std::endl;
132 oss <<
" - gamma" << std::endl;
133 oss <<
" - e-" << std::endl;
158 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
"Material on device: " << opencl_manager.
GetDeviceName(device_index) <<
GGendl;
161 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
"Activated Materials: " <<
GGendl;
162 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
"-----------------------------------" <<
GGendl;
173 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" - Chemical Elements:" <<
GGendl;
177 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" + fraction of chemical element = " << material_table_device->
mass_fraction_[j+chemical_element_id]/
percent <<
" %" <<
GGendl;
181 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" - Energy loss fluctuation data:" <<
GGendl;
184 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" + f1: " << material_table_device->
f1_fluct_[i] <<
GGendl;
185 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" + f2: " << material_table_device->
f2_fluct_[i] <<
GGendl;
191 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" - Density correction data:" <<
GGendl;
195 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
" + -C = " << material_table_device->
c_density_[i] <<
GGendl;
212 GGcout(
"GGEMSMaterials",
"BuildMaterialTables", 3) <<
"Building the material tables..." <<
GGendl;
232 GGsize index_to_chemical_element = 0;
316 std::vector<std::string>::const_iterator iter_mat = std::find(
materials_.begin(),
materials_.end(), material_name);
318 std::ostringstream oss(std::ostringstream::out);
319 oss <<
"Material '" << material_name <<
"' not found!!!" << std::endl;
322 ptrdiff_t index = std::distance(
materials_.begin(), iter_mat);
328 return density /
g *
cm3;
350 return atomic_number_density / (
mol/
cm3);
375 if (particle_type ==
"gamma") {
378 else if (particle_type ==
"e+") {
381 else if (particle_type ==
"e-") {
387 return energy_cut /
keV;
396 GGcout(
"GGEMSMaterials",
"Initialize", 3) <<
"Initializing the materials..." <<
GGendl;
444 return materials->
GetDensity(material_name, 0);
453 return materials->
GetEnergyCut(material_name, particle_type, distance, unit);
GGEMSRangeCuts * range_cuts_
GGEMS class handling RAM memory.
GGfloat energy1_fluct_[255]
GGEMS class handling the navigators (detector + phantom) in GGEMS.
ptrdiff_t GetMaterialIndex(std::string const &material_name) const
get the index of the material
GGfloat density_of_material_[255]
GGfloat GetLogMeanExcitationEnergy(void) const
get the log mean excitation energy
GGEMS structure managing a specific material.
GGEMS class storing and converting the cut in energy cut.
void SetElectronDistanceCut(GGfloat const &cut)
set the electron length cut by the range cut manager
GGsize GetNumberOfActivatedDevice(void) const
get the number of activated devices
GGfloat get_atomic_number_density_ggems_materials(GGEMSMaterials *materials, char const *material_name)
Get the density of material in g.cm-3.
__constant GGfloat percent
GGfloat atomic_number_density_[255 *32]
std::string BestDistanceUnit(T const &value)
Choose best distance unit.
GGEMS class handling material(s) for a specific navigator.
void initialize_ggems_materials(GGEMSMaterials *materials)
Intialize the tables for the materials.
GGfloat mass_fraction_[255 *32]
GGfloat energy0_fluct_[255]
GGfloat GetX0Density(void) const
get the x0 density
GGfloat log_energy2_fluct_[255]
void SetPhotonDistanceCut(GGfloat const &cut)
set the photon length cut by the range cut manager
GGEMS class managing some physical params for ionization process for material.
GGuchar atomic_number_Z_[255 *32]
GGfloat GetF2Fluct(void) const
get the f2 fluctuation
void Deallocate(cl::Buffer *buffer, GGsize size, GGsize const &thread_index, std::string const &class_name="Undefined")
Deallocation of OpenCL memory.
GGfloat GetEnergy2Fluct(void) const
get the energy 2 fluctuation
void ReleaseDeviceBuffer(cl::Buffer *const device_ptr, T *host_ptr, GGsize const &thread_index)
Get the device pointer on host to write on it. Mandatory after a GetDeviceBufferWrite ou GetDeviceBuf...
GGfloat mean_excitation_energy_[255]
std::vector< std::string > chemical_element_name_
GGsize number_of_materials_
std::string BestEnergyUnit(T const &value)
Choose best energy unit, mega is the reference.
void Clean(void)
clean all declared materials on OpenCL device
GGEMS class storing and converting the cut in energy cut. The computations come from G4RToEConvForGam...
GGfloat GetEnergy1Fluct(void) const
get the energy 1 fluctuation
void Initialize(void)
Initialize the materials for a navigator/phantom.
GGEMSMaterials * create_ggems_materials(void)
Get the GGEMSMaterials pointer for python user.
GGfloat GetLogEnergy1Fluct(void) const
get the log energy 1 fluctuation
GGfloat GetEnergy0Fluct(void) const
get the energy 0 fluctuation
GGfloat GetLogEnergy2Fluct(void) const
get the log energy 2 fluctuation
cl::Buffer * Allocate(void *host_ptr, GGsize const &size, GGsize const &thread_index, cl_mem_flags flags, std::string const &class_name="Undefined")
Allocation of OpenCL memory.
void BuildMaterialTables(void)
Building material tables.
GGsize number_of_chemical_elements_[255]
GGfloat get_energy_cut_ggems_materials(GGEMSMaterials *materials, char const *material_name, char const *particle_type, GGfloat const distance, char const *unit)
Get the energy cut of material in keV.
GGsize index_of_chemical_elements_[255]
GGfloat GetCDensity(void) const
get the c density
GGfloat radiation_length_[255]
GGfloat GetADensity(void) const
get the a density
static GGEMSMaterialsDatabaseManager & GetInstance(void)
Create at first time the Singleton.
std::vector< std::string > materials_
GGfloat GetX1Density(void) const
get the x1 density
void SetPositronDistanceCut(GGfloat const &cut)
set the positron length cut by the range cut manager
GGfloat electron_energy_cut_[255]
std::vector< GGfloat > mixture_f_
GGfloat GetAtomicNumberDensity(std::string const &material, GGsize const &index) const
Compute the atomic number density of an element in a material.
GGfloat photon_energy_cut_[255]
Structure storing the material tables on OpenCL device.
void print_material_properties_ggems_materials(GGEMSMaterials *materials)
Print tables.
GGfloat energy2_fluct_[255]
GGEMS structure managing a specific chemical element.
GGEMSChemicalElement GetChemicalElement(std::string const &chemical_element_name) const
get the chemical element
T * GetDeviceBuffer(cl::Buffer *device_ptr, GGsize const &size, GGsize const &thread_index)
Get the device pointer on host to write on it. ReleaseDeviceBuffer must be used after this method!...
struct GGEMSMaterialTables_t GGEMSMaterialTables
void ConvertCutsFromDistanceToEnergy(GGEMSMaterials *materials)
Convert cut from length to energy.
#define GGendl
overload C++ std::endl
GGEMS class handling material(s) for a specific navigator.
GGfloat log_mean_excitation_energy_[255]
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
GGfloat number_of_electrons_by_volume_[255]
void clean_ggems_materials(GGEMSMaterials *materials)
clean all declared materials on OpenCL device
void add_material_ggems_materials(GGEMSMaterials *materials, char const *material_name)
Add a material.
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
GGfloat number_of_atoms_by_volume_[255]
void PrintInfos(void) const
printing labels and materials infos
GGfloat positron_energy_cut_[255]
void SetDistanceCut(std::string const &particle_name, GGfloat const &value, std::string const &unit)
set the cut for a particle in distance
GGfloat GetAtomicNumberDensity(std::string const &material_name, GGsize const &thread_index=0) const
get the atomic number density of material
GGsize total_number_of_chemical_elements_
cl::Buffer ** material_tables_
~GGEMSMaterials(void)
GGEMSMaterials destructor.
GGfloat GetF1Fluct(void) const
get the f1 fluctuation
GGfloat GetMDensity(void) const
get the m density
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
GGEMSMaterials(void)
GGEMSMaterials constructor.
GGfloat GetEnergyCut(std::string const &material_name, std::string const &particle_type, GGfloat const &distance, std::string const &unit, GGsize const &thread_index=0)
Get the energy cut of material in keV.
GGsize number_activated_devices_
void AddMaterial(std::string const &material_name)
Add a material associated to a phantom.
GGfloat GetRadiationLength(std::string const &material) const
get the radiation length of a material
GGEMS class managing the material database.
GGfloat GetD0Density(void) const
get the d0 density
GGEMSSingleMaterial GetMaterial(std::string const &material_name) const
get the material
GGfloat GetDensity(std::string const &material_name, GGsize const &thread_index=0) const
get the density of material
GGfloat GetMeanExcitationEnergy(void) const
get the mean excitation energy
GGfloat get_density_ggems_materials(GGEMSMaterials *materials, char const *material_name)
Get the density of material in g.cm-3.
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
T DistanceUnit(T const &value, std::string const &unit)
Choose best distance unit.
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
GGfloat log_energy1_fluct_[255]