diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-11-17 12:44:22 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-11-17 12:44:22 -0600 |
commit | 7cb12a69eb94eafce80e05efe86716772b023bcd (patch) | |
tree | ec7a9cd427a1435fd5aa7561a3742af9a03887b9 /src/path.h | |
parent | 5a3edcfceecdfa594bd8c5286455bdfa7fe852fb (diff) | |
download | sddm-7cb12a69eb94eafce80e05efe86716772b023bcd.tar.gz sddm-7cb12a69eb94eafce80e05efe86716772b023bcd.tar.bz2 sddm-7cb12a69eb94eafce80e05efe86716772b023bcd.zip |
speed up likelihood function and switch to using fixed dx
This commit speeds up the likelihood function by about ~20% by using the
precomputed track positions, directions, times, etc. instead of interpolating
them on the fly.
It also switches to computing the number of points to integrate along the track
by dividing the track length by a specified distance, currently set to 1 cm.
This should hopefully speed things up for lower energies and result in more
stable fits at high energies.
Diffstat (limited to 'src/path.h')
-rw-r--r-- | src/path.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -22,6 +22,7 @@ typedef struct path { double theta0; size_t n; + size_t len; double *s; double *x; @@ -35,7 +36,7 @@ typedef struct path { } path; double path_get_coefficient(unsigned int k, double *s, double *x, double theta0, size_t n); -path *path_init(double *pos, double *dir, double T0, double range, double theta0, getKineticEnergyFunc *fun, void *params, double *z1, double *z2, size_t n, double m); +path *path_init(double *pos, double *dir, double T0, double range, size_t len, double theta0, getKineticEnergyFunc *fun, void *params, double *z1, double *z2, size_t n, double m); void path_eval(path *p, double s, double *pos, double *dir, double *beta, double *t, double *theta0); void path_free(path *p); |