GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSCrossSections.cc
Go to the documentation of this file.
1 // ************************************************************************
2 // * This file is part of GGEMS. *
3 // * *
4 // * GGEMS is free software: you can redistribute it and/or modify *
5 // * it under the terms of the GNU General Public License as published by *
6 // * the Free Software Foundation, either version 3 of the License, or *
7 // * (at your option) any later version. *
8 // * *
9 // * GGEMS is distributed in the hope that it will be useful, *
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 // * GNU General Public License for more details. *
13 // * *
14 // * You should have received a copy of the GNU General Public License *
15 // * along with GGEMS. If not, see <https://www.gnu.org/licenses/>. *
16 // * *
17 // ************************************************************************
18 
39 
43 
45 {
46  GGcout("GGEMSCrossSections", "GGEMSCrossSections", 3) << "GGEMSCrossSections creating..." << GGendl;
47 
48  em_processes_list_ = new GGEMSEMProcess*[3]; // Maximum of 3 processes
50 
52  for (auto&& i : is_process_activated_) i = false;
53 
54  // Get the OpenCL manager
57 
58  // Allocating memory for cross section tables on host and device
60  for (GGsize i = 0; i < number_activated_devices_; ++i) {
61  particle_cross_sections_[i] = opencl_manager.Allocate(nullptr, sizeof(GGEMSParticleCrossSections), i, CL_MEM_READ_WRITE, "GGEMSCrossSections");
62  }
63 
64  // Useful to avoid memory transfer between host and OpenCL
66 
67  GGcout("GGEMSCrossSections", "GGEMSCrossSections", 3) << "GGEMSCrossSections created!!!" << GGendl;
68 }
69 
73 
75 {
76  GGcout("GGEMSCrossSections", "~GGEMSCrossSections", 3) << "GGEMSCrossSections erasing..." << GGendl;
77 
78  if (em_processes_list_) {
79  for (GGsize i = 0; i < number_of_activated_processes_; ++i) {
80  delete em_processes_list_[i];
81  em_processes_list_[i] = nullptr;
82  }
83  delete[] em_processes_list_;
84  em_processes_list_ = nullptr;
85  }
86 
90  }
91 
92  GGcout("GGEMSCrossSections", "~GGEMSCrossSections", 3) << "GGEMSCrossSections erased!!!" << GGendl;
93 }
94 
98 
100 {
101  GGcout("GGEMSCrossSections", "Clean", 3) << "GGEMSCrossSections cleaning..." << GGendl;
102 
104 
106  for (GGsize i = 0; i < number_activated_devices_; ++i) {
107  opencl_manager.Deallocate(particle_cross_sections_[i], sizeof(GGEMSParticleCrossSections), i);
108  }
109  delete[] particle_cross_sections_;
110  particle_cross_sections_ = nullptr;
111  }
112 
113  GGcout("GGEMSCrossSections", "Clean", 3) << "GGEMSCrossSections cleaned!!!" << GGendl;
114 }
115 
119 
120 void GGEMSCrossSections::AddProcess(std::string const& process_name, std::string const& particle_type, bool const& is_secondary)
121 {
122  GGcout("GGEMSCrossSections", "AddProcess", 1) << "Adding " << process_name << " scattering process..." << GGendl;
123 
124  if (process_name == "Compton") {
129  }
130  else {
131  GGwarn("GGEMSCrossSections", "AddProcess", 3) << "Compton scattering process already activated!!!" << GGendl;
132  }
133  }
134  else if (process_name == "Photoelectric") {
139  }
140  else {
141  GGwarn("GGEMSCrossSections", "AddProcess", 3) << "PhotoElectric effect process already activated!!!" << GGendl;
142  }
143  }
144  else if (process_name == "Rayleigh") {
149  }
150  else {
151  GGwarn("GGEMSCrossSections", "AddProcess", 3) << "PhotoElectric effect process already activated!!!" << GGendl;
152  }
153  }
154  else {
155  std::ostringstream oss(std::ostringstream::out);
156  oss << "Unknown process!!! The available processes in GGEMS are:" << std::endl;
157  oss << " * For incident gamma:" << std::endl;
158  oss << " - 'Compton'" << std::endl;
159  oss << " - 'Photoelectric'" << std::endl;
160  oss << " - 'Rayleigh'" << std::endl;
161  GGEMSMisc::ThrowException("GGEMSCrossSections", "AddProcess", oss.str());
162  }
163 }
164 
168 
170 {
171  GGcout("GGEMSCrossSections", "Initialize", 1) << "Initializing cross section tables..." << GGendl;
172 
173  // Get the OpenCL manager
175 
176  // Get the process manager
178 
179  // Storing information for process manager
180  GGsize number_of_bins = process_manager.GetCrossSectionTableNumberOfBins();
181  GGfloat min_energy = process_manager.GetCrossSectionTableMinEnergy();
182  GGfloat max_energy = process_manager.GetCrossSectionTableMaxEnergy();
183 
184  // Initialize physics on each device
185  for (GGsize j = 0; j < number_activated_devices_; ++j) {
186  GGEMSParticleCrossSections* particle_cross_sections_device = opencl_manager.GetDeviceBuffer<GGEMSParticleCrossSections>(particle_cross_sections_[j], sizeof(GGEMSParticleCrossSections), j);
187 
188  particle_cross_sections_device->number_of_bins_ = number_of_bins;
189  particle_cross_sections_device->min_energy_ = min_energy;
190  particle_cross_sections_device->max_energy_ = max_energy;
191  for (GGsize i = 0; i < materials->GetNumberOfMaterials(); ++i) {
192  #ifdef _WIN32
193  strcpy_s(reinterpret_cast<char*>(particle_cross_sections_device->material_names_[i]), 32, (materials->GetMaterialName(i)).c_str());
194  #else
195  strcpy(reinterpret_cast<char*>(particle_cross_sections_device->material_names_[i]), (materials->GetMaterialName(i)).c_str());
196  #endif
197  }
198 
199  // Storing information from materials
200  particle_cross_sections_device->number_of_materials_ = static_cast<GGuchar>(materials->GetNumberOfMaterials());
201 
202  // Filling energy table with log scale
203  GGfloat slope = logf(max_energy/min_energy);
204  for (GGsize i = 0; i < number_of_bins; ++i) {
205  particle_cross_sections_device->energy_bins_[i] = min_energy * expf(slope * (static_cast<float>(i) / (static_cast<GGfloat>(number_of_bins)-1.0f))) * MeV;
206  }
207 
208  // Release pointer
209  opencl_manager.ReleaseDeviceBuffer(particle_cross_sections_[j], particle_cross_sections_device, j);
210 
211  // Loop over the activated physic processes and building tables
212  for (GGsize i = 0; i < number_of_activated_processes_; ++i)
213  em_processes_list_[i]->BuildCrossSectionTables(particle_cross_sections_[j], materials->GetMaterialTables(j), j);
214  }
215 
216  // Copy data from device to RAM memory (optimization for python users)
218 }
219 
223 
225 {
226  GGcout("GGEMSCrossSections", "LoadPhysicTablesOnHost", 1) << "Loading physic tables from OpenCL device to host (RAM)..." << GGendl;
227 
228  // Get the OpenCL manager
230 
231  GGEMSParticleCrossSections* particle_cross_sections_device = opencl_manager.GetDeviceBuffer<GGEMSParticleCrossSections>(particle_cross_sections_[0], sizeof(GGEMSParticleCrossSections), 0);
232 
233  particle_cross_sections_host_->number_of_bins_ = particle_cross_sections_device->number_of_bins_;
235  particle_cross_sections_host_->min_energy_ = particle_cross_sections_device->min_energy_;
236  particle_cross_sections_host_->max_energy_ = particle_cross_sections_device->max_energy_;
237 
239  for(GGuchar j = 0; j < 32; ++j) {
240  particle_cross_sections_host_->material_names_[i][j] = particle_cross_sections_device->material_names_[i][j];
241  }
242  }
243 
245  particle_cross_sections_host_->energy_bins_[i] = particle_cross_sections_device->energy_bins_[i];
246  }
247 
249 
250  for(GGuchar i = 0; i < NUMBER_PHOTON_PROCESSES; ++i) {
251  particle_cross_sections_host_->photon_cs_id_[i] = particle_cross_sections_device->photon_cs_id_[i];
252  }
253 
254  for(GGuchar j = 0; j < NUMBER_PHOTON_PROCESSES; ++j) {
255  for(GGuint i = 0; i < 256*MAX_CROSS_SECTION_TABLE_NUMBER_BINS; ++i) {
256  particle_cross_sections_host_->photon_cross_sections_[j][i] = particle_cross_sections_device->photon_cross_sections_[j][i];
257  }
258  }
259 
260  for(GGuchar j = 0; j < NUMBER_PHOTON_PROCESSES; ++j) {
261  for(GGuint i = 0; i < 101*MAX_CROSS_SECTION_TABLE_NUMBER_BINS; ++i) {
263  }
264  }
265 
266  // Release pointer
267  opencl_manager.ReleaseDeviceBuffer(particle_cross_sections_[0], particle_cross_sections_device, 0);
268 }
269 
273 
274 GGfloat GGEMSCrossSections::GetPhotonCrossSection(std::string const& process_name, std::string const& material_name, GGfloat const& energy, std::string const& unit) const
275 {
276  // Get min and max energy in the table, and number of bins
281 
282  // Converting energy
283  GGfloat e_MeV = EnergyUnit(energy, unit);
284 
285  if (e_MeV < min_energy || e_MeV > max_energy) {
286  std::ostringstream oss(std::ostringstream::out);
287  oss << "Problem energy: " << e_MeV << " " << unit << " is not in the range [" << min_energy << ", " << max_energy << "] MeV!!!" << std::endl;
288  GGEMSMisc::ThrowException("GGEMSCrossSections", "GetPhotonCrossSection", oss.str());
289  }
290 
291  // Get the process id
292  GGuchar process_id = 0;
293  if (process_name == "Compton") {
294  process_id = COMPTON_SCATTERING;
295  }
296  else if (process_name == "Photoelectric") {
297  process_id = PHOTOELECTRIC_EFFECT;
298  }
299  else if (process_name == "Rayleigh") {
300  process_id = RAYLEIGH_SCATTERING;
301  }
302  else {
303  std::ostringstream oss(std::ostringstream::out);
304  oss << "Unknown process!!! The available processes for photon in GGEMS are:" << std::endl;
305  oss << " - 'Compton'" << std::endl;
306  oss << " - 'Photoelectric'" << std::endl;
307  oss << " - 'Rayleigh'" << std::endl;
308  GGEMSMisc::ThrowException("GGEMSCrossSections", "GetPhotonCrossSection", oss.str());
309  }
310 
311  // Get id of material
312  GGsize mat_id = 0;
313  for (GGsize i = 0; i < number_of_materials; ++i) {
314  if (strcmp(material_name.c_str(), reinterpret_cast<char*>(particle_cross_sections_host_->material_names_[i])) == 0) {
315  mat_id = i;
316  break;
317  }
318  }
319 
320  // Get density of material
322  GGfloat density = material_database_manager.GetMaterial(material_name).density_;
323 
324  // Computing the energy bin
325  GGsize energy_bin = static_cast<GGsize>(BinarySearchLeft(e_MeV, particle_cross_sections_host_->energy_bins_, static_cast<GGint>(number_of_bins), 0, 0));
326 
327  // Compute cross section using linear interpolation
328  GGfloat energy_a = particle_cross_sections_host_->energy_bins_[energy_bin];
329  GGfloat energy_b = particle_cross_sections_host_->energy_bins_[energy_bin+1];
330  GGfloat cross_section_a = particle_cross_sections_host_->photon_cross_sections_[process_id][energy_bin + number_of_bins*mat_id];
331  GGfloat cross_section_b = particle_cross_sections_host_->photon_cross_sections_[process_id][energy_bin+1 + number_of_bins*mat_id];
332 
333  GGfloat cross_section = LinearInterpolation(energy_a, cross_section_a, energy_b, cross_section_b, e_MeV);
334 
335  return (cross_section/density) / (cm2/g);
336 }
337 
341 
343 {
344  return new(std::nothrow) GGEMSCrossSections;
345 }
346 
350 
351 void add_process_ggems_cross_sections(GGEMSCrossSections* cross_sections, char const* process_name, char const* particle_name, bool const is_secondary)
352 {
353  cross_sections->AddProcess(process_name, particle_name, is_secondary);
354 }
355 
359 
361 {
362  cross_sections->Initialize(materials);
363 }
364 
368 
369 float get_cs_cross_sections(GGEMSCrossSections* cross_sections, char const* process_name, char const* material_name, GGfloat const energy, char const* unit)
370 {
371  return cross_sections->GetPhotonCrossSection(process_name, material_name, energy, unit);
372 }
373 
377 
379 {
380  cross_sections->Clean();
381 }
GGEMSParticleCrossSections_t::number_of_materials_
GGsize number_of_materials_
Definition: GGEMSParticleCrossSections.hh:44
GGEMSParticleCrossSections_t::number_of_bins_
GGsize number_of_bins_
Definition: GGEMSParticleCrossSections.hh:43
GGEMSCrossSections::number_activated_devices_
GGsize number_activated_devices_
Definition: GGEMSCrossSections.hh:161
GGEMSRAMManager.hh
GGEMS class handling RAM memory.
GGEMSCrossSections::em_processes_list_
GGEMSEMProcess ** em_processes_list_
Definition: GGEMSCrossSections.hh:156
GGEMSComptonScattering.hh
Compton Scattering process from standard model for Geant4 (G4KleinNishinaCompton)
GGEMSParticleCrossSections_t::number_of_activated_photon_processes_
GGsize number_of_activated_photon_processes_
Definition: GGEMSParticleCrossSections.hh:54
MAX_CROSS_SECTION_TABLE_NUMBER_BINS
#define MAX_CROSS_SECTION_TABLE_NUMBER_BINS
Definition: GGEMSProcessConstants.hh:58
GGEMSMathAlgorithms.hh
Definitions of miscellaneous mathematical functions.
COMPTON_SCATTERING
__constant GGchar COMPTON_SCATTERING
Definition: GGEMSProcessConstants.hh:43
GGEMSCrossSections
GGEMS class handling the cross sections tables.
Definition: GGEMSCrossSections.hh:53
GGEMSParticleCrossSections
struct GGEMSParticleCrossSections_t GGEMSParticleCrossSections
GGEMSCrossSections::is_process_activated_
std::vector< bool > is_process_activated_
Definition: GGEMSCrossSections.hh:158
GGEMSParticleCrossSections_t::energy_bins_
GGfloat energy_bins_[MAX_CROSS_SECTION_TABLE_NUMBER_BINS]
Definition: GGEMSParticleCrossSections.hh:47
GGEMSOpenCLManager::GetNumberOfActivatedDevice
GGsize GetNumberOfActivatedDevice(void) const
get the number of activated devices
Definition: GGEMSOpenCLManager.hh:167
GGEMSMaterials::GetMaterialTables
cl::Buffer * GetMaterialTables(GGsize const &thread_index) const
get the pointer on material tables on OpenCL device
Definition: GGEMSMaterials.hh:164
GGEMSMaterials
GGEMS class handling material(s) for a specific navigator.
Definition: GGEMSMaterials.hh:49
GGwarn
GGEMSStream GGwarn
Definition: GGEMSPrint.cc:36
GGEMSCrossSections.hh
GGEMS class handling the cross sections tables.
LinearInterpolation
GGfloat LinearInterpolation(GGfloat const xa, GGfloat const ya, GGfloat const xb, GGfloat const yb, GGfloat const x)
interpolate the x value between point A and B
Definition: GGEMSMathAlgorithms.hh:86
GGEMSParticleCrossSections_t
Structure storing the photon cross sections for OpenCL device.
Definition: GGEMSParticleCrossSections.hh:41
GGEMSProcessesManager.hh
GGEMS class managing the processes in GGEMS simulation.
BinarySearchLeft
GGint BinarySearchLeft(GGfloat const key, GGfloat const *array, GGint const size, GGint const offset, GGint min)
Find the index of the key value in the p_array buffer.
Definition: GGEMSMathAlgorithms.hh:49
GGushort
#define GGushort
Definition: GGEMSTypes.hh:217
MeV
__constant GGfloat MeV
Definition: GGEMSSystemOfUnits.hh:103
GGEMSParticleCrossSections_t::photon_cross_sections_
GGfloat photon_cross_sections_[NUMBER_PHOTON_PROCESSES][256 *MAX_CROSS_SECTION_TABLE_NUMBER_BINS]
Definition: GGEMSParticleCrossSections.hh:52
PHOTOELECTRIC_EFFECT
__constant GGchar PHOTOELECTRIC_EFFECT
Definition: GGEMSProcessConstants.hh:44
GGEMSCrossSections::number_of_activated_processes_
GGsize number_of_activated_processes_
Definition: GGEMSCrossSections.hh:157
GGEMSOpenCLManager::Deallocate
void Deallocate(cl::Buffer *buffer, GGsize size, GGsize const &thread_index, std::string const &class_name="Undefined")
Deallocation of OpenCL memory.
Definition: GGEMSOpenCLManager.cc:981
GGEMSOpenCLManager::ReleaseDeviceBuffer
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...
Definition: GGEMSOpenCLManager.hh:495
GGEMSCrossSections::GetPhotonCrossSection
GGfloat GetPhotonCrossSection(std::string const &process_name, std::string const &material_name, GGfloat const &energy, std::string const &unit) const
Get the cross section value for a process for a specific energy.
Definition: GGEMSCrossSections.cc:274
GGEMSCrossSections::LoadPhysicTablesOnHost
void LoadPhysicTablesOnHost(void)
Load physic tables from OpenCL device to RAM. Optimization for python user.
Definition: GGEMSCrossSections.cc:224
GGEMSProcessesManager::GetCrossSectionTableNumberOfBins
GGsize GetCrossSectionTableNumberOfBins(void) const
get the number of bins in the cross section table
Definition: GGEMSProcessesManager.hh:136
GGEMSProcessesManager::GetCrossSectionTableMinEnergy
GGfloat GetCrossSectionTableMinEnergy(void) const
get the minimum energy in the cross section table
Definition: GGEMSProcessesManager.hh:122
GGEMSComptonScattering
Compton Scattering process from standard model for Geant4 (G4KleinNishinaCompton)
Definition: GGEMSComptonScattering.hh:41
create_ggems_cross_sections
GGEMSCrossSections * create_ggems_cross_sections(void)
Get the GGEMSCrossSections pointer for python user.
Definition: GGEMSCrossSections.cc:342
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSCrossSections::particle_cross_sections_host_
GGEMSParticleCrossSections * particle_cross_sections_host_
Definition: GGEMSCrossSections.hh:160
GGEMSCrossSections::AddProcess
void AddProcess(std::string const &process_name, std::string const &particle_type, bool const &is_secondary=false)
add a process to the GGEMS simulation
Definition: GGEMSCrossSections.cc:120
GGint
#define GGint
Definition: GGEMSTypes.hh:224
GGEMSParticleCrossSections_t::photon_cs_id_
GGchar photon_cs_id_[NUMBER_PHOTON_PROCESSES]
Definition: GGEMSParticleCrossSections.hh:55
clean_ggems_cross_sections
void clean_ggems_cross_sections(GGEMSCrossSections *cross_sections)
clean all cross sections on each OpenCL device
Definition: GGEMSCrossSections.cc:378
cm2
__constant GGfloat cm2
Definition: GGEMSSystemOfUnits.hh:58
GGEMSProcessesManager::GetCrossSectionTableMaxEnergy
GGfloat GetCrossSectionTableMaxEnergy(void) const
get the maximum energy in the cross section table
Definition: GGEMSProcessesManager.hh:129
GGEMSParticleCrossSections_t::max_energy_
GGfloat max_energy_
Definition: GGEMSParticleCrossSections.hh:46
GGEMSOpenCLManager::Allocate
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.
Definition: GGEMSOpenCLManager.cc:945
GGEMSEMProcess
GGEMS mother class for electromagnectic process.
Definition: GGEMSEMProcess.hh:47
GGEMSCrossSections::particle_cross_sections_
cl::Buffer ** particle_cross_sections_
Definition: GGEMSCrossSections.hh:159
GGEMSMaterials::GetMaterialName
std::string GetMaterialName(GGsize i) const
get the name of the material at position i
Definition: GGEMSMaterials.hh:132
GGEMSRayleighScattering.hh
Rayleigh scattering process using Livermore model.
get_cs_cross_sections
float get_cs_cross_sections(GGEMSCrossSections *cross_sections, char const *process_name, char const *material_name, GGfloat const energy, char const *unit)
get the cross section value of process
Definition: GGEMSCrossSections.cc:369
GGEMSMaterials::GetNumberOfMaterials
GGsize GetNumberOfMaterials(void) const
Get the number of materials in the phantom.
Definition: GGEMSMaterials.hh:156
GGEMSMaterialsDatabaseManager::GetInstance
static GGEMSMaterialsDatabaseManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSMaterialsDatabaseManager.hh:97
NUMBER_PROCESSES
__constant GGchar NUMBER_PROCESSES
Definition: GGEMSProcessConstants.hh:36
GGEMSSingleMaterial::density_
GGfloat density_
Definition: GGEMSMaterialsDatabaseManager.hh:67
NUMBER_PHOTON_PROCESSES
#define NUMBER_PHOTON_PROCESSES
Definition: GGEMSProcessConstants.hh:42
GGcout
GGEMSStream GGcout
Definition: GGEMSPrint.cc:34
GGEMSPhotoElectricEffect.hh
Photoelectric Effect process using Sandia table.
GGEMSRayleighScattering
rayleigh scattering process using Sandia table
Definition: GGEMSRayleighScattering.hh:41
GGEMSProcessesManager
GGEMS class managing the processes in GGEMS simulation.
Definition: GGEMSProcessesManager.hh:42
g
__constant GGfloat g
Definition: GGEMSSystemOfUnits.hh:111
GGEMSCrossSections::Clean
void Clean(void)
clean all cross sections on each OpenCL device
Definition: GGEMSCrossSections.cc:99
GGEMSCrossSections::~GGEMSCrossSections
~GGEMSCrossSections(void)
GGEMSCrossSections destructor.
Definition: GGEMSCrossSections.cc:74
GGEMSOpenCLManager::GetDeviceBuffer
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!...
Definition: GGEMSOpenCLManager.hh:480
GGEMSCrossSections::GGEMSCrossSections
GGEMSCrossSections(void)
GGEMSCrossSections constructor.
Definition: GGEMSCrossSections.cc:44
initialize_ggems_cross_sections
void initialize_ggems_cross_sections(GGEMSCrossSections *cross_sections, GGEMSMaterials *materials)
Intialize the cross section tables for process and materials.
Definition: GGEMSCrossSections.cc:360
GGendl
#define GGendl
overload C++ std::endl
Definition: GGEMSPrint.hh:60
GGEMSMaterials.hh
GGEMS class handling material(s) for a specific navigator.
GGEMSParticleCrossSections_t::photon_cross_sections_per_atom_
GGfloat photon_cross_sections_per_atom_[NUMBER_PHOTON_PROCESSES][101 *MAX_CROSS_SECTION_TABLE_NUMBER_BINS]
Definition: GGEMSParticleCrossSections.hh:53
GGEMSPhotoElectricEffect
Photoelectric Effect process using Sandia table.
Definition: GGEMSPhotoElectricEffect.hh:41
GGEMSParticleCrossSections_t::material_names_
GGchar material_names_[256][64]
Definition: GGEMSParticleCrossSections.hh:57
GGEMSOpenCLManager
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
Definition: GGEMSOpenCLManager.hh:54
GGEMSCrossSections::Initialize
void Initialize(GGEMSMaterials const *materials)
Initialize all the activated processes computing tables on OpenCL device.
Definition: GGEMSCrossSections.cc:169
EnergyUnit
T EnergyUnit(T const &value, std::string const &unit)
Choose best energy unit.
Definition: GGEMSSystemOfUnits.hh:316
RAYLEIGH_SCATTERING
__constant GGchar RAYLEIGH_SCATTERING
Definition: GGEMSProcessConstants.hh:45
GGuchar
#define GGuchar
Definition: GGEMSTypes.hh:203
GGuint
#define GGuint
Definition: GGEMSTypes.hh:231
GGEMSMaterialsDatabaseManager
GGEMS class managing the material database.
Definition: GGEMSMaterialsDatabaseManager.hh:79
GGEMSProcessesManager::GetInstance
static GGEMSProcessesManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSProcessesManager.hh:60
GGEMSMaterialsDatabaseManager::GetMaterial
GGEMSSingleMaterial GetMaterial(std::string const &material_name) const
get the material
Definition: GGEMSMaterialsDatabaseManager.hh:167
add_process_ggems_cross_sections
void add_process_ggems_cross_sections(GGEMSCrossSections *cross_sections, char const *process_name, char const *particle_name, bool const is_secondary)
Add a process to cross section table.
Definition: GGEMSCrossSections.cc:351
GGEMSMisc::ThrowException
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
Definition: GGEMSTools.cc:61
GGfloat
#define GGfloat
Definition: GGEMSTypes.hh:273
GGEMSOpenCLManager::GetInstance
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSOpenCLManager.hh:72
GGEMSParticleCrossSections_t::min_energy_
GGfloat min_energy_
Definition: GGEMSParticleCrossSections.hh:45