From c8bff440e7848a33f369dff1ce11f726cecbbe20 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 10 Sep 2018 11:16:41 -0500 Subject: add a fast likelihood function This commit adds a fast function to calculate the expected number of PE at a PMT without numerically integrating over the track. This calculation is *much* faster than integrating over the track (~30 ms compared to several seconds) and so we use it during the "quick" minimization phase of the fit to quickly find the best position. --- src/misc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/misc.h') diff --git a/src/misc.h b/src/misc.h index c93afba..eb62e46 100644 --- a/src/misc.h +++ b/src/misc.h @@ -3,6 +3,9 @@ #include /* for size_t */ +#define LNFACT_MAX 100 + +double lnfact(unsigned int n); double kahan_sum(double *x, size_t n); double interp1d(double x, double *xp, double *yp, size_t n); int isclose(double a, double b, double rel_tol, double abs_tol); -- cgit