GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSNavigator.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 
37 
41 
42 GGEMSNavigator::GGEMSNavigator(std::string const& navigator_name)
43 : navigator_name_(navigator_name),
44  navigator_id_(NAVIGATOR_NOT_INITIALIZED),
45  is_update_pos_(false),
46  is_update_rot_(false),
47  is_tracking_(false),
48  output_basename_(""),
49  solids_(nullptr),
50  number_of_solids_(0),
51  dose_calculator_(nullptr),
52  is_dosimetry_mode_(false)
53 {
54  GGcout("GGEMSNavigator", "GGEMSNavigator", 3) << "GGEMSNavigator creating..." << GGendl;
55 
56  position_xyz_.x = 0.0f;
57  position_xyz_.y = 0.0f;
58  position_xyz_.z = 0.0f;
59 
60  rotation_xyz_.x = 0.0f;
61  rotation_xyz_.y = 0.0f;
62  rotation_xyz_.z = 0.0f;
63 
64  // Store the phantom navigator in phantom navigator manager
66 
67  // Allocation of materials
68  materials_ = new GGEMSMaterials();
69 
70  // Allocation of cross sections including physics
72 
73  // Get the number of activated device
76 
77  GGcout("GGEMSNavigator", "GGEMSNavigator", 3) << "GGEMSNavigator created!!!" << GGendl;
78 }
79 
83 
85 {
86  GGcout("GGEMSNavigator", "~GGEMSNavigator", 3) << "GGEMSNavigator erasing..." << GGendl;
87 
88  if (solids_) {
89  for (GGsize i = 0; i < number_of_solids_; ++i) {
90  delete solids_[i];
91  solids_[i] = nullptr;
92  }
93  delete[] solids_;
94  solids_ = nullptr;
95  }
96 
97  if (materials_) {
98  delete materials_;
99  materials_ = nullptr;
100  }
101 
102  if (cross_sections_) {
103  delete cross_sections_;
104  cross_sections_ = nullptr;
105  }
106 
107  GGcout("GGEMSNavigator", "~GGEMSNavigator", 3) << "GGEMSNavigator erased!!!" << GGendl;
108 }
109 
113 
115 {
116  dose_calculator_ = dosimetry_calculator;
117  is_dosimetry_mode_ = true;
118 }
119 
123 
124 void GGEMSNavigator::SetPosition(GGfloat const& position_x, GGfloat const& position_y, GGfloat const& position_z, std::string const& unit)
125 {
126  is_update_pos_ = true;
127  position_xyz_.s[0] = DistanceUnit(position_x, unit);
128  position_xyz_.s[1] = DistanceUnit(position_y, unit);
129  position_xyz_.s[2] = DistanceUnit(position_z, unit);
130 }
131 
135 
136 void GGEMSNavigator::SetRotation(GGfloat const& rx, GGfloat const& ry, GGfloat const& rz, std::string const& unit)
137 {
138  is_update_rot_ = true;
139  rotation_xyz_.x = AngleUnit(rx, unit);
140  rotation_xyz_.y = AngleUnit(ry, unit);
141  rotation_xyz_.z = AngleUnit(rz, unit);
142 }
143 
147 
148 void GGEMSNavigator::SetThreshold(GGfloat const& threshold, std::string const& unit)
149 {
150  threshold_ = EnergyUnit(threshold, unit);
151 }
152 
156 
157 void GGEMSNavigator::SetNavigatorID(GGsize const& navigator_id)
158 {
159  navigator_id_ = navigator_id;
160 }
161 
165 
167 {
168  is_tracking_ = true;
169 }
170 
174 
176 {
177  GGcout("GGEMSNavigator", "CheckParameters", 3) << "Checking the mandatory parameters..." << GGendl;
178 
179  // Checking id of the navigator
181  std::ostringstream oss(std::ostringstream::out);
182  oss << "Id of the navigator is not set!!!";
183  GGEMSMisc::ThrowException("GGEMSNavigator", "CheckParameters", oss.str());
184  }
185 
186  // Checking output name
187  if (output_basename_.empty()) {
188  std::ostringstream oss(std::ostringstream::out);
189  oss << "Output basename not set!!!";
190  GGEMSMisc::ThrowException("GGEMSNavigator", "CheckParameters", oss.str());
191  }
192 }
193 
197 
199 {
200  GGcout("GGEMSNavigator", "Initialize", 3) << "Initializing a GGEMS navigator..." << GGendl;
201 
202  // Checking the parameters of phantom
203  CheckParameters();
204 
205  // Loading the materials and building tables to OpenCL device and converting cuts
207 
208  // Initialization of electromagnetic process and building cross section tables for each particles and materials
210 }
211 
215 
216 void GGEMSNavigator::StoreOutput(std::string basename)
217 {
218  output_basename_= basename;
219 }
220 
224 
226 {
227  // Getting the OpenCL manager and infos for work-item launching
229  cl::CommandQueue* queue = opencl_manager.GetCommandQueue(thread_index);
230  cl::Event* event = opencl_manager.GetEvent(thread_index);
231 
232  // Get Device name and storing methode name + device
233  GGsize device_index = opencl_manager.GetIndexOfActivatedDevice(thread_index);
234  std::string device_name = opencl_manager.GetDeviceName(device_index);
235  std::ostringstream oss(std::ostringstream::out);
236  oss << "GGEMSNavigator::ParticleSolidDistance on " << device_name << ", index " << device_index;
237 
238  // Pointer to primary particles, and number to particles in buffer
240  cl::Buffer* primary_particles = source_manager.GetParticles()->GetPrimaryParticles(thread_index);
241  GGsize number_of_particles = source_manager.GetParticles()->GetNumberOfParticles(thread_index);
242 
243  // Getting work group size, and work-item number
244  GGsize work_group_size = opencl_manager.GetWorkGroupSize();
245  GGsize number_of_work_items = opencl_manager.GetBestWorkItem(number_of_particles);
246 
247  // Parameters for work-item in kernel
248  cl::NDRange global_wi(number_of_work_items);
249  cl::NDRange local_wi(work_group_size);
250 
251  // Loop over all the solids
252  for (GGsize s = 0; s < number_of_solids_; ++s) {
253  // Getting solid data infos
254  cl::Buffer* solid_data = solids_[s]->GetSolidData(thread_index);
255 
256  // Getting kernel, and setting parameters
257  cl::Kernel* kernel = solids_[s]->GetKernelParticleSolidDistance(thread_index);
258  kernel->setArg(0, number_of_particles);
259  kernel->setArg(1, *primary_particles);
260  kernel->setArg(2, *solid_data);
261 
262  // Launching kernel
263  GGint kernel_status = queue->enqueueNDRangeKernel(*kernel, 0, global_wi, local_wi, nullptr, event);
264  opencl_manager.CheckOpenCLError(kernel_status, "GGEMSNavigator", "ParticleSolidDistance");
265  queue->finish();
266 
267  // GGEMS Profiling
269  profiler_manager.HandleEvent(*event, oss.str());
270  }
271 }
272 
276 
277 void GGEMSNavigator::ProjectToSolid(GGsize const& thread_index)
278 {
279  // Getting the OpenCL manager and infos for work-item launching
281  cl::CommandQueue* queue = opencl_manager.GetCommandQueue(thread_index);
282  cl::Event* event = opencl_manager.GetEvent(thread_index);
283 
284  // Get Device name and storing methode name + device
285  GGsize device_index = opencl_manager.GetIndexOfActivatedDevice(thread_index);
286  std::string device_name = opencl_manager.GetDeviceName(device_index);
287  std::ostringstream oss(std::ostringstream::out);
288  oss << "GGEMSNavigator::ProjectToSolid on " << device_name << ", index " << device_index;
289 
290  // Pointer to primary particles, and number to particles in buffer
292  cl::Buffer* primary_particles = source_manager.GetParticles()->GetPrimaryParticles(thread_index);
293  GGsize number_of_particles = source_manager.GetParticles()->GetNumberOfParticles(thread_index);
294 
295  // Getting work group size, and work-item number
296  GGsize work_group_size = opencl_manager.GetWorkGroupSize();
297  GGsize number_of_work_items = opencl_manager.GetBestWorkItem(number_of_particles);
298 
299  // Parameters for work-item in kernel
300  cl::NDRange global_wi(number_of_work_items);
301  cl::NDRange local_wi(work_group_size);
302 
303  // Loop over all the solids
304  for (GGsize s = 0; s < number_of_solids_; ++s) {
305  // Getting solid data infos
306  cl::Buffer* solid_data = solids_[s]->GetSolidData(thread_index);
307 
308  // Getting kernel, and setting parameters
309  cl::Kernel* kernel = solids_[s]->GetKernelProjectToSolid(thread_index);
310  kernel->setArg(0, number_of_particles);
311  kernel->setArg(1, *primary_particles);
312  kernel->setArg(2, *solid_data);
313 
314  // Launching kernel
315  GGint kernel_status = queue->enqueueNDRangeKernel(*kernel, 0, global_wi, local_wi, nullptr, event);
316  opencl_manager.CheckOpenCLError(kernel_status, "GGEMSNavigator", "ProjectToSolid");
317  queue->finish();
318 
319  // GGEMS Profiling
321  profiler_manager.HandleEvent(*event, oss.str());
322  }
323 }
324 
328 
329 void GGEMSNavigator::TrackThroughSolid(GGsize const& thread_index)
330 {
331  // Getting the OpenCL manager and infos for work-item launching
333  cl::CommandQueue* queue = opencl_manager.GetCommandQueue(thread_index);
334  cl::Event* event = opencl_manager.GetEvent(thread_index);
335 
336  // Get Device name and storing methode name + device
337  GGsize device_index = opencl_manager.GetIndexOfActivatedDevice(thread_index);
338  std::string device_name = opencl_manager.GetDeviceName(device_index);
339  std::ostringstream oss(std::ostringstream::out);
340  oss << "GGEMSNavigator::TrackThroughSolid on " << device_name << ", index " << device_index;
341 
342  // Pointer to primary particles, and number to particles in buffer
344  cl::Buffer* primary_particles = source_manager.GetParticles()->GetPrimaryParticles(thread_index);
345  GGsize number_of_particles = source_manager.GetParticles()->GetNumberOfParticles(thread_index);
346 
347  // Getting OpenCL pointer to random number
348  cl::Buffer* randoms = source_manager.GetPseudoRandomGenerator()->GetPseudoRandomNumbers(thread_index);
349 
350  // Getting OpenCL buffer for cross section
351  cl::Buffer* cross_sections = cross_sections_->GetCrossSections(thread_index);
352 
353  // Getting OpenCL buffer for materials
354  cl::Buffer* materials = materials_->GetMaterialTables(thread_index);
355 
356  // Getting work group size, and work-item number
357  GGsize work_group_size = opencl_manager.GetWorkGroupSize();
358  GGsize number_of_work_items = opencl_manager.GetBestWorkItem(number_of_particles);
359 
360  // Parameters for work-item in kernel
361  cl::NDRange global_wi(number_of_work_items);
362  cl::NDRange local_wi(work_group_size);
363 
364  // Loop over all the solids
365  for (GGsize s = 0; s < number_of_solids_; ++s) {
366  // Getting solid and label (for GGEMSVoxelizedSolid) data infos
367  cl::Buffer* solid_data = solids_[s]->GetSolidData(thread_index);
368  cl::Buffer* label_data = solids_[s]->GetLabelData(thread_index);
369 
370  // Get type of registered data and OpenCL buffer to data
371  std::string data_reg_type = solids_[s]->GetRegisteredDataType();
372 
373  // Get buffers depending on mode of simulation
374  // Histogram mode (for system, CT ...)
375  cl::Buffer* histogram = nullptr;
376  cl::Buffer* scatter_histogram = nullptr;
377  // Dosimetry mode (for voxelized phantom ...)
378  cl::Buffer* photon_tracking_dosimetry = nullptr;
379  cl::Buffer* hit_tracking_dosimetry = nullptr;
380  cl::Buffer* edep_tracking_dosimetry = nullptr;
381  cl::Buffer* edep_squared_tracking_dosimetry = nullptr;
382  cl::Buffer* dosimetry_params = nullptr;
383  if (data_reg_type == "HISTOGRAM") {
384  histogram = solids_[s]->GetHistogram(thread_index);
385  scatter_histogram = solids_[s]->GetScatterHistogram(thread_index);
386  }
387  else if (data_reg_type == "DOSIMETRY") {
388  dosimetry_params = dose_calculator_->GetDoseParams(thread_index);
389  photon_tracking_dosimetry = dose_calculator_->GetPhotonTrackingBuffer(thread_index);
390  hit_tracking_dosimetry = dose_calculator_->GetHitTrackingBuffer(thread_index);
391  edep_tracking_dosimetry = dose_calculator_->GetEdepBuffer(thread_index);
392  edep_squared_tracking_dosimetry = dose_calculator_->GetEdepSquaredBuffer(thread_index);
393  }
394 
395  // Getting kernel, and setting parameters
396  cl::Kernel* kernel = solids_[s]->GetKernelTrackThroughSolid(thread_index);
397  kernel->setArg(0, number_of_particles);
398  kernel->setArg(1, *primary_particles);
399  kernel->setArg(2, *randoms);
400  kernel->setArg(3, *solid_data);
401  kernel->setArg(4, *label_data); // Useful only for GGEMSVoxelizedSolid
402  kernel->setArg(5, *cross_sections);
403  kernel->setArg(6, *materials);
404  kernel->setArg(7, threshold_);
405  if (data_reg_type == "HISTOGRAM") {
406  kernel->setArg(8, *histogram);
407  kernel->setArg(9, *scatter_histogram);
408  }
409  else if (data_reg_type == "DOSIMETRY") {
410  kernel->setArg(8, *dosimetry_params);
411  kernel->setArg(9, *edep_tracking_dosimetry);
412  kernel->setArg(10, *edep_squared_tracking_dosimetry);
413  kernel->setArg(11, *hit_tracking_dosimetry);
414  kernel->setArg(12, *photon_tracking_dosimetry);
415  }
416 
417  // Launching kernel
418  GGint kernel_status = queue->enqueueNDRangeKernel(*kernel, 0, global_wi, local_wi, nullptr, event);
419  opencl_manager.CheckOpenCLError(kernel_status, "GGEMSNavigator", "TrackThroughSolid");
420 
421  // GGEMS Profiling
423  profiler_manager.HandleEvent(*event, oss.str());
424  queue->finish();
425  }
426 }
427 
431 
432 void GGEMSNavigator::ComputeDose(GGsize const& thread_index)
433 {
434  if (is_dosimetry_mode_) dose_calculator_->ComputeDose(thread_index);
435 }
436 
440 
442 {
443  GGcout("GGEMSNavigator", "PrintInfos", 0) << GGendl;
444  GGcout("GGEMSNavigator", "PrintInfos", 0) << "GGEMSNavigator Infos:" << GGendl;
445  GGcout("GGEMSNavigator", "PrintInfos", 0) << "---------------------" << GGendl;
446  GGcout("GGEMSNavigator", "PrintInfos", 0) << "* Navigator name: " << navigator_name_ << GGendl;
447  for (GGsize i = 0; i < number_of_solids_; ++i) {
448  solids_[i]->PrintInfos();
449  }
451  GGcout("GGEMSNavigator", "PrintInfos", 0) << "* Output: " << output_basename_ << GGendl;
452  GGcout("GGEMSNavigator", "PrintInfos", 0) << GGendl;
453 }
GGEMSNavigator::PrintInfos
void PrintInfos(void) const
Print infos about navigator.
Definition: GGEMSNavigator.cc:441
GGEMSSourceManager::GetInstance
static GGEMSSourceManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSSourceManager.hh:67
GGEMSNavigator::Initialize
virtual void Initialize(void)
Definition: GGEMSNavigator.cc:198
GGEMSNavigator::ParticleSolidDistance
void ParticleSolidDistance(GGsize const &thread_index)
Compute distance between particle and solid.
Definition: GGEMSNavigator.cc:225
GGEMSParticles::GetNumberOfParticles
GGsize GetNumberOfParticles(GGsize const &thread_index) const
Get the number of particles on activated device.
Definition: GGEMSParticles.hh:116
GGEMSCrossSections
GGEMS class handling the cross sections tables.
Definition: GGEMSCrossSections.hh:53
GGEMSNavigator::solids_
GGEMSSolid ** solids_
Definition: GGEMSNavigator.hh:255
GGEMSNavigatorManager::Store
void Store(GGEMSNavigator *navigator)
storing the navigator pointer to navigator manager
Definition: GGEMSNavigatorManager.cc:80
GGEMSNavigator::is_update_pos_
bool is_update_pos_
Definition: GGEMSNavigator.hh:247
GGEMSOpenCLManager::GetNumberOfActivatedDevice
GGsize GetNumberOfActivatedDevice(void) const
get the number of activated devices
Definition: GGEMSOpenCLManager.hh:167
GGEMSSolid::GetKernelProjectToSolid
cl::Kernel * GetKernelProjectToSolid(GGsize const &thread_index) const
get the pointer to kernel associated to a device
Definition: GGEMSSolid.hh:180
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
GGEMSCrossSections::GetCrossSections
cl::Buffer * GetCrossSections(GGsize const &thread_index) const
return the pointer to OpenCL buffer storing cross sections
Definition: GGEMSCrossSections.hh:129
AngleUnit
T AngleUnit(T const &value, std::string const &unit)
Choose best angle unit.
Definition: GGEMSSystemOfUnits.hh:360
GGEMSProfilerManager::GetInstance
static GGEMSProfilerManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSProfilerManager.hh:66
GGEMSCrossSections.hh
GGEMS class handling the cross sections tables.
GGEMSDosimetryCalculator::GetPhotonTrackingBuffer
cl::Buffer * GetPhotonTrackingBuffer(GGsize const &thread_index) const
get the buffer for photon tracking in dosimetry mode
Definition: GGEMSDosimetryCalculator.hh:181
GGEMSDosimetryCalculator.hh
Class providing tools storing and computing dose in phantom.
GGEMSDosimetryCalculator
Class providing tools storing and computing dose in phantom.
Definition: GGEMSDosimetryCalculator.hh:48
GGEMSSolid::GetSolidData
cl::Buffer * GetSolidData(GGsize const &thread_index) const
get the informations about the solid geometry
Definition: GGEMSSolid.hh:100
GGEMSSourceManager::GetPseudoRandomGenerator
GGEMSPseudoRandomGenerator * GetPseudoRandomGenerator(void) const
method returning the OpenCL stack on pseudo random numbers
Definition: GGEMSSourceManager.hh:169
GGEMSOpenCLManager::CheckOpenCLError
void CheckOpenCLError(GGint const &error, std::string const &class_name, std::string const &method_name) const
check the OpenCL error
Definition: GGEMSOpenCLManager.cc:1048
GGEMSNavigator::SetDosimetryCalculator
void SetDosimetryCalculator(GGEMSDosimetryCalculator *dosimetry_calculator)
give adress of dosimetry calculator to navigator
Definition: GGEMSNavigator.cc:114
GGEMSNavigator::output_basename_
std::string output_basename_
Definition: GGEMSNavigator.hh:253
GGEMSNavigator::CheckParameters
virtual void CheckParameters(void) const
Definition: GGEMSNavigator.cc:175
GGEMSOpenCLManager::GetBestWorkItem
GGsize GetBestWorkItem(GGsize const &number_of_elements) const
get the best number of work item
Definition: GGEMSOpenCLManager.cc:1030
GGEMSNavigator::navigator_id_
GGsize navigator_id_
Definition: GGEMSNavigator.hh:246
GGEMSOpenCLManager::GetEvent
cl::Event * GetEvent(GGsize const &thread_index) const
return an event to activated context
Definition: GGEMSOpenCLManager.hh:230
GGEMSNavigator::GGEMSNavigator
GGEMSNavigator(std::string const &navigator_name)
GGEMSNavigator constructor.
Definition: GGEMSNavigator.cc:42
GGEMSSolid::GetScatterHistogram
cl::Buffer * GetScatterHistogram(GGsize const &thread_index) const
return the point on scatter histogram
Definition: GGEMSSolid.hh:204
GGEMSNavigator::~GGEMSNavigator
virtual ~GGEMSNavigator(void)
GGEMSNavigator destructor.
Definition: GGEMSNavigator.cc:84
GGEMSDosimetryCalculator::GetEdepSquaredBuffer
cl::Buffer * GetEdepSquaredBuffer(GGsize const &thread_index) const
get the buffer for edep squared in dosimetry mode
Definition: GGEMSDosimetryCalculator.hh:205
GGEMSNavigator::SetThreshold
void SetThreshold(GGfloat const &threshold, std::string const &unit="keV")
Set the energy threshold to navigator.
Definition: GGEMSNavigator.cc:148
GGEMSNavigator::is_dosimetry_mode_
bool is_dosimetry_mode_
Definition: GGEMSNavigator.hh:262
GGEMSSolid::GetKernelParticleSolidDistance
cl::Kernel * GetKernelParticleSolidDistance(GGsize const &thread_index) const
get the pointer to kernel associated to a device
Definition: GGEMSSolid.hh:172
GGEMSNavigator::SetNavigatorID
void SetNavigatorID(GGsize const &navigator_id)
set the navigator index
Definition: GGEMSNavigator.cc:157
GGEMSNavigatorManager::GetInstance
static GGEMSNavigatorManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSNavigatorManager.hh:60
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGEMSDosimetryCalculator::GetEdepBuffer
cl::Buffer * GetEdepBuffer(GGsize const &thread_index) const
get the buffer for edep in dosimetry mode
Definition: GGEMSDosimetryCalculator.hh:197
GGint
#define GGint
Definition: GGEMSTypes.hh:224
GGEMSMaterials::Initialize
void Initialize(void)
Initialize the materials for a navigator/phantom.
Definition: GGEMSMaterials.cc:394
GGEMSNavigator::threshold_
GGfloat threshold_
Definition: GGEMSNavigator.hh:249
GGEMSSourceManager::GetParticles
GGEMSParticles * GetParticles(void) const
method returning the OpenCL stack on particles
Definition: GGEMSSourceManager.hh:162
GGEMSNavigator::dose_calculator_
GGEMSDosimetryCalculator * dose_calculator_
Definition: GGEMSNavigator.hh:261
GGEMSNavigator::TrackThroughSolid
void TrackThroughSolid(GGsize const &thread_index)
Move particle through solid.
Definition: GGEMSNavigator.cc:329
GGEMSSolid::PrintInfos
virtual void PrintInfos(void) const =0
printing infos about solid
GGEMSSolid::GetRegisteredDataType
std::string GetRegisteredDataType(void) const
get the type of registered data
Definition: GGEMSSolid.hh:164
GGEMSProfilerManager
GGEMS class managing profiler data.
Definition: GGEMSProfilerManager.hh:48
GGEMSOpenCLManager::GetWorkGroupSize
GGsize GetWorkGroupSize(void) const
Get the work group size defined in GGEMS on activated OpenCL context.
Definition: GGEMSOpenCLManager.hh:198
GGEMSNavigator::number_activated_devices_
GGsize number_activated_devices_
Definition: GGEMSNavigator.hh:264
GGEMSSolid::GetLabelData
cl::Buffer * GetLabelData(GGsize const &thread_index) const
get buffer to label buffer
Definition: GGEMSSolid.hh:108
GGEMSNavigator::ComputeDose
void ComputeDose(GGsize const &thread_index)
Compute dose in volume.
Definition: GGEMSNavigator.cc:432
GGEMSDosimetryCalculator::GetHitTrackingBuffer
cl::Buffer * GetHitTrackingBuffer(GGsize const &thread_index) const
get the buffer for hit tracking in dosimetry mode
Definition: GGEMSDosimetryCalculator.hh:189
GGEMSNavigator::navigator_name_
std::string navigator_name_
Definition: GGEMSNavigator.hh:241
GGEMSSolid::GetKernelTrackThroughSolid
cl::Kernel * GetKernelTrackThroughSolid(GGsize const &thread_index) const
get the pointer to kernel associated to a device
Definition: GGEMSSolid.hh:188
GGEMSNavigator::number_of_solids_
GGsize number_of_solids_
Definition: GGEMSNavigator.hh:256
GGEMSSolid::GetHistogram
cl::Buffer * GetHistogram(GGsize const &thread_index) const
return the point on histogram
Definition: GGEMSSolid.hh:196
GGcout
GGEMSStream GGcout
Definition: GGEMSPrint.cc:34
GGEMSNavigator::materials_
GGEMSMaterials * materials_
Definition: GGEMSNavigator.hh:257
GGEMSNavigator::is_tracking_
bool is_tracking_
Definition: GGEMSNavigator.hh:250
GGEMSSourceManager.hh
GGEMS class handling the source(s)
NAVIGATOR_NOT_INITIALIZED
#define NAVIGATOR_NOT_INITIALIZED
Definition: GGEMSNavigator.hh:37
GGEMSNavigator::SetRotation
void SetRotation(GGfloat const &rx, GGfloat const &ry, GGfloat const &rz, std::string const &unit="deg")
Set the rotation of the global navigator around global axis.
Definition: GGEMSNavigator.cc:136
GGEMSVoxelizedSolid.hh
GGEMS class for voxelized solid.
GGendl
#define GGendl
overload C++ std::endl
Definition: GGEMSPrint.hh:60
s
__constant GGfloat s
Definition: GGEMSSystemOfUnits.hh:85
GGEMSOpenCLManager
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
Definition: GGEMSOpenCLManager.hh:54
GGEMSNavigator::EnableTracking
void EnableTracking(void)
Enable tracking during simulation.
Definition: GGEMSNavigator.cc:166
GGEMSCrossSections::Initialize
void Initialize(GGEMSMaterials const *materials)
Initialize all the activated processes computing tables on OpenCL device.
Definition: GGEMSCrossSections.cc:169
GGEMSNavigator::is_update_rot_
bool is_update_rot_
Definition: GGEMSNavigator.hh:248
GGEMSDosimetryCalculator::GetDoseParams
cl::Buffer * GetDoseParams(GGsize const &thread_index) const
get the buffer storing dosimetry params
Definition: GGEMSDosimetryCalculator.hh:213
EnergyUnit
T EnergyUnit(T const &value, std::string const &unit)
Choose best energy unit.
Definition: GGEMSSystemOfUnits.hh:316
GGEMSOpenCLManager::GetDeviceName
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
Definition: GGEMSOpenCLManager.hh:145
GGEMSPseudoRandomGenerator::GetPseudoRandomNumbers
cl::Buffer * GetPseudoRandomNumbers(GGsize const &thread_index) const
return the pointer to OpenCL buffer storing random numbers
Definition: GGEMSPseudoRandomGenerator.hh:109
GGEMSProfilerManager.hh
GGEMS class managing profiler data.
GGEMSMaterials::PrintInfos
void PrintInfos(void) const
printing labels and materials infos
Definition: GGEMSMaterials.cc:143
GGEMSNavigator::position_xyz_
GGfloat3 position_xyz_
Definition: GGEMSNavigator.hh:244
GGEMSSourceManager
GGEMS class handling the source(s)
Definition: GGEMSSourceManager.hh:49
GGEMSPseudoRandomGenerator.hh
Class managing the random number in GGEMS.
GGEMSProfilerManager::HandleEvent
void HandleEvent(cl::Event event, std::string const &profile_name)
handle an OpenCL event in profile_name type
Definition: GGEMSProfilerManager.cc:75
GGEMSOpenCLManager::GetIndexOfActivatedDevice
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
Definition: GGEMSOpenCLManager.hh:175
GGEMSNavigator::rotation_xyz_
GGfloat3 rotation_xyz_
Definition: GGEMSNavigator.hh:245
GGEMSNavigator::cross_sections_
GGEMSCrossSections * cross_sections_
Definition: GGEMSNavigator.hh:258
GGEMSNavigator::SetPosition
void SetPosition(GGfloat const &position_x, GGfloat const &position_y, GGfloat const &position_z, std::string const &unit="mm")
set the position of the global navigator in X, Y and Z
Definition: GGEMSNavigator.cc:124
GGEMSNavigator::ProjectToSolid
void ProjectToSolid(GGsize const &thread_index)
Project particle to entry of closest solid.
Definition: GGEMSNavigator.cc:277
GGEMSOpenCLManager::GetCommandQueue
cl::CommandQueue * GetCommandQueue(GGsize const &thread_index) const
Return the command queue to activated context.
Definition: GGEMSOpenCLManager.hh:222
GGEMSNavigator::StoreOutput
void StoreOutput(std::string basename)
Storing the basename and format of the output file.
Definition: GGEMSNavigator.cc:216
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
GGEMSDosimetryCalculator::ComputeDose
void ComputeDose(GGsize const &thread_index)
computing dose
Definition: GGEMSDosimetryCalculator.cc:316
DistanceUnit
T DistanceUnit(T const &value, std::string const &unit)
Choose best distance unit.
Definition: GGEMSSystemOfUnits.hh:243
GGfloat
#define GGfloat
Definition: GGEMSTypes.hh:273
GGEMSOpenCLManager::GetInstance
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSOpenCLManager.hh:72
GGEMSParticles::GetPrimaryParticles
cl::Buffer * GetPrimaryParticles(GGsize const &thread_index) const
return the pointer to OpenCL buffer storing particles
Definition: GGEMSParticles.hh:100