summaryrefslogtreecommitdiff
path: root/src/daq.cu
diff options
context:
space:
mode:
Diffstat (limited to 'src/daq.cu')
-rw-r--r--src/daq.cu9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/daq.cu b/src/daq.cu
index 2b5f9b4..7c5e6a5 100644
--- a/src/daq.cu
+++ b/src/daq.cu
@@ -30,6 +30,7 @@ __global__ void reset_earliest_time_int(float maxtime, int ntime_ints, unsigned
__global__ void run_daq(curandState *s, unsigned int detection_state,
float time_rms,
+ int first_photon,
int nphotons, float *photon_times,
unsigned int *photon_histories,
int *last_hit_triangles, int *solid_map,
@@ -41,17 +42,17 @@ __global__ void run_daq(curandState *s, unsigned int detection_state,
if (id < nphotons)
{
curandState rng = s[id];
-
- int triangle_id = last_hit_triangles[id];
+ int photon_id = id + first_photon;
+ int triangle_id = last_hit_triangles[photon_id];
if (triangle_id > -1)
{
int solid_id = solid_map[triangle_id];
- int history = photon_histories[id];
+ int history = photon_histories[photon_id];
if (solid_id < nsolids && (history & detection_state))
{
- float time = photon_times[id] + curand_normal(&rng) * time_rms;
+ float time = photon_times[photon_id] + curand_normal(&rng) * time_rms;
unsigned int time_int = float_to_sortable_int(time);
atomicMin(earliest_time_int + solid_id, time_int);