aboutsummaryrefslogtreecommitdiff
path: root/src/misc.h
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-09-10 11:16:41 -0500
committertlatorre <tlatorre@uchicago.edu>2018-09-10 11:16:41 -0500
commitc8bff440e7848a33f369dff1ce11f726cecbbe20 (patch)
tree193f0c1ee91ad3fdf154f4917836b22534b1c840 /src/misc.h
parent3228ad9f5a57b8e6b1e3c4cdcefce0536c012b92 (diff)
downloadsddm-c8bff440e7848a33f369dff1ce11f726cecbbe20.tar.gz
sddm-c8bff440e7848a33f369dff1ce11f726cecbbe20.tar.bz2
sddm-c8bff440e7848a33f369dff1ce11f726cecbbe20.zip
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.
Diffstat (limited to 'src/misc.h')
-rw-r--r--src/misc.h3
1 files changed, 3 insertions, 0 deletions
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 <stdlib.h> /* 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);