aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-06-16 13:50:31 -0500
committertlatorre <tlatorre@uchicago.edu>2019-06-16 13:50:31 -0500
commite9c763e3227f69d4b7d35d6afce3abf3a747823c (patch)
tree816eeb3dbe0186eab3b88e457c72e0155e6c48d6 /src/likelihood.c
parent2e2deb7b1fe83c81555d4cdbabfd65229931c0de (diff)
downloadsddm-e9c763e3227f69d4b7d35d6afce3abf3a747823c.tar.gz
sddm-e9c763e3227f69d4b7d35d6afce3abf3a747823c.tar.bz2
sddm-e9c763e3227f69d4b7d35d6afce3abf3a747823c.zip
assume the particle produces no light if it's outside the PSUP
Diffstat (limited to 'src/likelihood.c')
-rw-r--r--src/likelihood.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index b02aeef..90fdd82 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -1247,9 +1247,9 @@ double nll(event *ev, vertex *v, size_t n, double dx, int ns, const int fast, in
* We calculate this here to make sure that we don't integrate outside
* of the PSUP because otherwise there is no code to model the fact
* that the PSUP is optically separated from the water outside. */
- if (!intersect_sphere(v[j].pos,v[j].dir,PSUP_RADIUS,&distance_to_psup)) {
- /* If the particle is outside the PSUP we just assume it produces
- * no light. */
+ if (NORM(v[j].pos) > PSUP_RADIUS || !intersect_sphere(v[j].pos,v[j].dir,PSUP_RADIUS,&distance_to_psup)) {
+ /* If the particle is outside the PSUP or it doesn't intersect the
+ * PSUP we just assume it produces no light. */
fprintf(stderr, "particle doesn't intersect PSUP!\n");
continue;
}