aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/likelihood.c')
-rw-r--r--src/likelihood.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index 0855d08..ca0b2b6 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -217,15 +217,17 @@ static double get_expected_charge(double x, double beta, double theta0, double *
normalize(pmt_dir);
- cos_theta_pmt = DOT(pmt_dir,pmt_normal);
-
- *reflected = 0.0;
- if (cos_theta_pmt > 0) return 0.0;
-
/* Calculate the cosine of the angle between the track direction and the
* vector to the PMT. */
cos_theta = DOT(dir,pmt_dir);
+ *reflected = 0.0;
+ if (fabs(cos_theta-1.0/(n_d2o*beta))/theta0 > 5) return 0.0;
+
+ cos_theta_pmt = DOT(pmt_dir,pmt_normal);
+
+ if (cos_theta_pmt > 0) return 0.0;
+
omega = get_solid_angle_fast(pos,pmt_pos,pmt_normal,r);
R = NORM(pos);