aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fit.c2
-rw-r--r--src/likelihood.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/fit.c b/src/fit.c
index e0b0cc2..4670fd5 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -5219,7 +5219,7 @@ int fit_event(event *ev, double *xopt, double *fmin)
long long elapsed = (tv_stop.tv_sec - tv_start.tv_sec)*1000 + (tv_stop.tv_usec - tv_start.tv_usec)/1000;
- printf("%5zu/%5zu %10.2f %7.2f %7.2f %7.2f %5.2f %5.2f %5.2f %5.2f %5.2f f() = %7.3e took %lld ms\n",
+ printf("%4zu/%4zu %7.2f %7.2f %7.2f %7.2f %5.2f %5.2f %5.2f %5.2f %5.2f f() = %7.3e took %lld ms\n",
i+1,
sizeof(startingParameters)/sizeof(startingParameters[0]),
x[0],
diff --git a/src/likelihood.c b/src/likelihood.c
index 92c8306..2e0f135 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -212,7 +212,7 @@ double get_total_charge_approx(double T0, double *pos, double *dir, int i, doubl
z = R*cos_theta;
/* `x` is the perpendicular distance from the PMT position to the track. */
- x = R*fabs(sin(acos(cos_theta)));
+ x = R*fabs(sin(theta));
/* `b` is the second coefficient in the Taylor expansion. */
b = (s-z)/a;
@@ -421,6 +421,10 @@ double nll_muon(event *ev, double T0, double *pos, double *dir, double t0, doubl
nll[nhit++] = -logsumexp(logp+1, jmax-1);
} else {
logp[0] = -mu[i];
+ if (fast) {
+ nll[nhit++] = -logp[0];
+ continue;
+ }
for (j = 1; j < MAX_PE_NO_HIT; j++) {
logp[j] = get_log_pmiss(j) - mu[i] + j*log_mu - lnfact(j);
}