aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-09-17 14:43:49 -0500
committertlatorre <tlatorre@uchicago.edu>2018-09-17 14:43:49 -0500
commit4a51642c7707d42c3072325cfe3e2b25fc182f76 (patch)
tree5405a93f3424c0adc0f529bd8ef4aecae5527152 /src
parentd65c8143d6496388ca769fd211bdedfdfda38ba2 (diff)
downloadsddm-4a51642c7707d42c3072325cfe3e2b25fc182f76.tar.gz
sddm-4a51642c7707d42c3072325cfe3e2b25fc182f76.tar.bz2
sddm-4a51642c7707d42c3072325cfe3e2b25fc182f76.zip
fix bug in fast likelihood calculation
Diffstat (limited to 'src')
-rw-r--r--src/likelihood.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index 7e1bafe..4b50e5f 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -199,11 +199,6 @@ double get_total_charge_approx(double T0, double *pos, double *dir, muon_energy
* `s`. */
a = NORM(tmp);
- get_path_length(tmp,pmts[i].pos,AV_RADIUS,&l_d2o,&l_h2o);
-
- /* Assume the particle is travelling at the speed of light. */
- *t = s/SPEED_OF_LIGHT + l_d2o*n_d2o/SPEED_OF_LIGHT + l_h2o*n_h2o/SPEED_OF_LIGHT;
-
/* `z` is the distance to the PMT projected onto the track direction. */
z = R*cos_theta;
@@ -252,6 +247,11 @@ double get_total_charge_approx(double T0, double *pos, double *dir, muon_energy
absorption_length_d2o = get_absorption_length_snoman_d2o(wavelength0);
absorption_length_h2o = get_absorption_length_snoman_h2o(wavelength0);
+ get_path_length(tmp,pmts[i].pos,AV_RADIUS,&l_d2o,&l_h2o);
+
+ /* Assume the particle is travelling at the speed of light. */
+ *t = s/SPEED_OF_LIGHT + l_d2o*n_d2o/SPEED_OF_LIGHT + l_h2o*n_h2o/SPEED_OF_LIGHT;
+
return f*exp(-l_d2o/absorption_length_d2o)*exp(-l_h2o/absorption_length_h2o)*n_d2o*x*beta0*prob*(1/sin_theta)*omega*(erf((a+b*(smax-s)+n_d2o*(smax-z)*beta0)/frac) + erf((-a+b*s+n_d2o*z*beta0)/frac))/(b+n_d2o*beta0)/(4*M_PI);
}