From e9c763e3227f69d4b7d35d6afce3abf3a747823c Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 16 Jun 2019 13:50:31 -0500 Subject: assume the particle produces no light if it's outside the PSUP --- src/likelihood.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/likelihood.c') 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; } -- cgit