diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-09-12 10:28:23 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-09-12 10:28:23 -0500 |
commit | fad85fa60a3b6b0e015ad070431f249f87cf77be (patch) | |
tree | d5e8ed592795007a5a490b2914e872ee4ae20e87 | |
parent | 717441a5a0b06538cbf91050b5ff58b600dc1e97 (diff) | |
download | sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.tar.gz sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.tar.bz2 sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.zip |
small updates to speed things up
-rw-r--r-- | src/fit.c | 2 | ||||
-rw-r--r-- | src/likelihood.c | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -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); } |