aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/likelihood.c')
-rw-r--r--src/likelihood.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index 379ac9a..d29be5e 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -210,7 +210,7 @@ void particle_free(particle *p)
static double get_expected_charge_shower(particle *p, double *pos, double *dir, double *pmt_pos, double *pmt_normal, double r, double *reflected, double n_d2o, double n_h2o, double l_d2o, double l_h2o, double *q_delta_ray, double *q_indirect_delta_ray)
{
- double pmt_dir[3], cos_theta, omega, f, f_reflec, cos_theta_pmt, theta_pmt, charge, constant, prob_abs, prob_sct;
+ double pmt_dir[3], cos_theta, omega, f, f_reflec, cos_theta_pmt, charge, constant, prob_abs, prob_sct;
SUB(pmt_dir,pmt_pos,pos);
@@ -230,9 +230,8 @@ static double get_expected_charge_shower(particle *p, double *pos, double *dir,
omega = get_solid_angle_fast(pos,pmt_pos,pmt_normal,r);
- theta_pmt = acos(-cos_theta_pmt);
- f_reflec = get_weighted_pmt_reflectivity(theta_pmt);
- f = get_weighted_pmt_response(theta_pmt);
+ f_reflec = get_weighted_pmt_reflectivity(-cos_theta_pmt);
+ f = get_weighted_pmt_response(-cos_theta_pmt);
prob_abs = 1.0 - get_fabs_d2o(l_d2o)*get_fabs_h2o(l_h2o)*get_fabs_acrylic(AV_THICKNESS);
prob_sct = 1.0 - get_fsct_d2o(l_d2o)*get_fsct_h2o(l_h2o);
@@ -261,7 +260,7 @@ static double get_expected_charge_shower(particle *p, double *pos, double *dir,
static double get_expected_charge(double x, double beta, double theta0, double *pos, double *dir, double *pmt_pos, double *pmt_normal, double r, double *reflected, double n_d2o, double n_h2o, double l_d2o, double l_h2o)
{
- double pmt_dir[3], cos_theta, n, omega, z, R, f, f_reflec, cos_theta_pmt, theta_pmt, charge, prob_abs, prob_sct;
+ double pmt_dir[3], cos_theta, n, omega, z, R, f, f_reflec, cos_theta_pmt, charge, prob_abs, prob_sct;
z = 1.0;
@@ -289,9 +288,8 @@ static double get_expected_charge(double x, double beta, double theta0, double *
omega = get_solid_angle_fast(pos,pmt_pos,pmt_normal,r);
- theta_pmt = acos(-cos_theta_pmt);
- f_reflec = get_weighted_pmt_reflectivity(theta_pmt);
- f = get_weighted_pmt_response(theta_pmt);
+ f_reflec = get_weighted_pmt_reflectivity(-cos_theta_pmt);
+ f = get_weighted_pmt_response(-cos_theta_pmt);
/* Probability that a photon is absorbed. We calculate this by computing:
*
@@ -545,7 +543,7 @@ static double get_total_charge_approx(double beta0, double *pos, double *dir, pa
*
* `smax` is currently calculated as the point where the particle velocity
* drops to 0.8 times the speed of light. */
- double pmt_dir[3], tmp[3], R, cos_theta, x, z, s, a, b, beta, E, mom, T, omega, sin_theta, f, cos_theta_pmt, theta_pmt, l_h2o, l_d2o, f_reflec, charge, prob, frac, prob_abs, prob_sct;
+ double pmt_dir[3], tmp[3], R, cos_theta, x, z, s, a, b, beta, E, mom, T, omega, sin_theta, f, cos_theta_pmt, l_h2o, l_d2o, f_reflec, charge, prob, frac, prob_abs, prob_sct;
/* First, we find the point along the track where the PMT is at the
* Cerenkov angle. */
@@ -642,9 +640,8 @@ static double get_total_charge_approx(double beta0, double *pos, double *dir, pa
frac = sqrt(2)*n_d2o*x*beta0*theta0;
- theta_pmt = acos(-cos_theta_pmt);
- f = get_weighted_pmt_response(theta_pmt);
- f_reflec = get_weighted_pmt_reflectivity(theta_pmt);
+ f = get_weighted_pmt_response(-cos_theta_pmt);
+ f_reflec = get_weighted_pmt_reflectivity(-cos_theta_pmt);
prob_abs = 1.0 - get_fabs_d2o(l_d2o)*get_fabs_h2o(l_h2o)*get_fabs_acrylic(AV_THICKNESS);
prob_sct = 1.0 - get_fsct_d2o(l_d2o)*get_fsct_h2o(l_h2o);