diff options
| author | Stan Seibert <stan@mtrr.org> | 2011-12-21 11:41:32 -0500 |
|---|---|---|
| committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:38 -0700 |
| commit | 2477de305109badab69f1de225776fdcc8a09bd1 (patch) | |
| tree | f989804f18f1ab0c22d1eea326649f18cfd8e899 /chroma/cuda | |
| parent | 127dda0bae74829eed4b274797db26e6741ffdb5 (diff) | |
| download | chroma-2477de305109badab69f1de225776fdcc8a09bd1.tar.gz chroma-2477de305109badab69f1de225776fdcc8a09bd1.tar.bz2 chroma-2477de305109badab69f1de225776fdcc8a09bd1.zip | |
Split photon propagation in the likelihood calculation into a "forced
scatter" and a "forced no-scatter" pass.
Since we want to include contributions from two populations of weighted
photons, we have to break up the DAQ simulation into three functions:
* begin_acquire()
* acquire()
* end_acquire()
The first function resets the channel states, the second function
accumulates photoelectrons (and can be called multiple times), and the
last function returns the hit information. A global weight has also
been added to the DAQ simulation if a particular set of weighted
photons need to have an overall penalty.
The forced scattering pass can be repeated many times on the same
photons (with the photons individually deweighted to compensate).
This reduces the variance on the final likelihoods quite a bit.
Diffstat (limited to 'chroma/cuda')
| -rw-r--r-- | chroma/cuda/daq.cu | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chroma/cuda/daq.cu b/chroma/cuda/daq.cu index 719d928..e1ab10d 100644 --- a/chroma/cuda/daq.cu +++ b/chroma/cuda/daq.cu @@ -40,7 +40,8 @@ run_daq(curandState *s, unsigned int detection_state, int *solid_map, Detector *detector, unsigned int *earliest_time_int, - unsigned int *channel_q_int, unsigned int *channel_histories) + unsigned int *channel_q_int, unsigned int *channel_histories, + float global_weight) { int id = threadIdx.x + blockDim.x * blockIdx.x; @@ -57,7 +58,7 @@ run_daq(curandState *s, unsigned int detection_state, if (channel_index >= 0 && (history & detection_state)) { - float weight = weights[photon_id]; + float weight = weights[photon_id] * global_weight; if (curand_uniform(&rng) < weight) { float time = photon_times[photon_id] + sample_cdf(&rng, detector->time_cdf_len, @@ -93,7 +94,8 @@ run_daq_many(curandState *s, unsigned int detection_state, Detector *detector, unsigned int *earliest_time_int, unsigned int *channel_q_int, unsigned int *channel_histories, - int ndaq, int channel_stride) + int ndaq, int channel_stride, + float global_weight) { __shared__ int photon_id; __shared__ int triangle_id; @@ -112,7 +114,7 @@ run_daq_many(curandState *s, unsigned int detection_state, history = photon_histories[photon_id]; channel_index = detector->solid_id_to_channel_index[solid_id]; photon_time = photon_times[photon_id]; - weight = weights[photon_id]; + weight = weights[photon_id] * global_weight; } } |
