1 #ifndef GUARD_GGEMS_NAVIGATORS_GGEMSDOSERECORDING_HH
2 #define GUARD_GGEMS_NAVIGATORS_GGEMSDOSERECORDING_HH
34 #ifndef __OPENCL_C_VERSION__
54 #ifdef __OPENCL_C_VERSION__
66 if (position->x < dose_params->border_min_xyz_.x +
EPSILON6 || position->x > dose_params->border_max_xyz_.x -
EPSILON6)
return;
67 if (position->y < dose_params->border_min_xyz_.y +
EPSILON6 || position->y > dose_params->border_max_xyz_.y -
EPSILON6)
return;
68 if (position->z < dose_params->border_min_xyz_.z +
EPSILON6 || position->z > dose_params->border_max_xyz_.z -
EPSILON6)
return;
71 GGint3 dosel_id = convert_int3((*position - dose_params->border_min_xyz_) * dose_params->inv_size_of_dosels_);
73 GGint global_dosel_id = dosel_id.x + dosel_id.y * dose_params->number_of_dosels_.x + dosel_id.z * dose_params->number_of_dosels_.x * dose_params->number_of_dosels_.y;
75 if (dosel_id.x < 0 || dosel_id.x >= dose_params->number_of_dosels_.x)
return;
76 if (dosel_id.y < 0 || dosel_id.y >= dose_params->number_of_dosels_.y)
return;
77 if (dosel_id.z < 0 || dosel_id.z >= dose_params->number_of_dosels_.z)
return;
79 atomic_add(&photon_tracking[global_dosel_id], 1);
95 if (position->x < dose_params->border_min_xyz_.x +
EPSILON6 || position->x > dose_params->border_max_xyz_.x -
EPSILON6)
return;
96 if (position->y < dose_params->border_min_xyz_.y +
EPSILON6 || position->y > dose_params->border_max_xyz_.y -
EPSILON6)
return;
97 if (position->z < dose_params->border_min_xyz_.z +
EPSILON6 || position->z > dose_params->border_max_xyz_.z -
EPSILON6)
return;
100 GGint3 dosel_id = convert_int3((*position - dose_params->border_min_xyz_) * dose_params->inv_size_of_dosels_);
102 GGint global_dosel_id = dosel_id.x + dosel_id.y * dose_params->number_of_dosels_.x + dosel_id.z * dose_params->number_of_dosels_.x * dose_params->number_of_dosels_.y;
104 if (dosel_id.x < 0 || dosel_id.x >= dose_params->number_of_dosels_.x)
return;
105 if (dosel_id.y < 0 || dosel_id.y >= dose_params->number_of_dosels_.y)
return;
106 if (dosel_id.z < 0 || dosel_id.z >= dose_params->number_of_dosels_.z)
return;
108 if (hit_tracking) atomic_add(&hit_tracking[global_dosel_id], 1);
109 #ifdef DOSIMETRY_DOUBLE_PRECISION
110 AtomicAddDouble(&edep_tracking[global_dosel_id], (
GGDosiType)edep);
111 if (edep_squared_tracking) AtomicAddDouble(&edep_squared_tracking[global_dosel_id], (
GGDosiType)edep*(
GGDosiType)edep);
113 AtomicAddFloat(&edep_tracking[global_dosel_id], (
GGDosiType)edep);
114 if (edep_squared_tracking) AtomicAddFloat(&edep_squared_tracking[global_dosel_id], (
GGDosiType)edep*(
GGDosiType)edep);
120 #endif // End of GUARD_GGEMS_NAVIGATORS_GGEMSDOSERECORDING_HH