From 7cb12a69eb94eafce80e05efe86716772b023bcd Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sat, 17 Nov 2018 12:44:22 -0600 Subject: 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. --- src/test-path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test-path.c') 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); -- cgit