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/test-path.c | |
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/test-path.c')
-rw-r--r-- | src/test-path.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test-path.c b/src/test-path.c index 62994d6..f403c37 100644 --- a/src/test-path.c +++ b/src/test-path.c @@ -101,7 +101,7 @@ sim *simulate_path(double *pos0, double *dir0, double range, double theta0, size simvalue->z2[i] = path_get_coefficient(i+1,s,theta2,theta0,N); } - simvalue->p = path_init(pos0,dir0,1.0,range,theta0,getKineticEnergy,NULL,simvalue->z1,simvalue->z2,n,1.0); + simvalue->p = path_init(pos0,dir0,1.0,range,1000,theta0,getKineticEnergy,NULL,simvalue->z1,simvalue->z2,n,1.0); free(s); free(theta1); |