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 /src/likelihood.c | |
| parent | 717441a5a0b06538cbf91050b5ff58b600dc1e97 (diff) | |
| download | sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.tar.gz sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.tar.bz2 sddm-fad85fa60a3b6b0e015ad070431f249f87cf77be.zip | |
small updates to speed things up
Diffstat (limited to 'src/likelihood.c')
| -rw-r--r-- | src/likelihood.c | 6 | 
1 files changed, 5 insertions, 1 deletions
| 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);              } | 
