diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-08-28 10:39:36 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-08-28 10:39:36 -0500 |
commit | ebc95aa65925b06ce06c9db2791d8143448f2643 (patch) | |
tree | c1f602a360e8d770500241b3848a6e1a494317b2 /src/path.c | |
parent | ac721f37eb1b14ec91dbb14450752cb240a721cf (diff) | |
download | sddm-ebc95aa65925b06ce06c9db2791d8143448f2643.tar.gz sddm-ebc95aa65925b06ce06c9db2791d8143448f2643.tar.bz2 sddm-ebc95aa65925b06ce06c9db2791d8143448f2643.zip |
add path to the likelihood fit
This commit updates the likelihood fit to use the KL path expansion. Currently,
I'm just using one coefficient for the path in both x and y.
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -36,6 +36,8 @@ path *path_init(double *pos, double *dir, double T0, double range, double theta0 path *p = malloc(sizeof(path)); + p->theta0 = theta0; + p->pos[0] = pos[0]; p->pos[1] = pos[1]; p->pos[2] = pos[2]; @@ -114,10 +116,13 @@ path *path_init(double *pos, double *dir, double T0, double range, double theta0 return p; } -void path_eval(path *p, double s, double *pos, double *dir, double *T, double *t) +void path_eval(path *p, double s, double *pos, double *dir, double *T, double *t, double *theta0) { double normal[3], k[3], tmp[3], phi; + if (s > p->spline[0]->x[p->spline[0]->size-1]) + s = p->spline[0]->x[p->spline[0]->size-1]; + tmp[0] = gsl_spline_eval(p->spline[0],s,p->acc[0]); tmp[1] = gsl_spline_eval(p->spline[1],s,p->acc[1]); tmp[2] = gsl_spline_eval(p->spline[2],s,p->acc[2]); @@ -146,6 +151,9 @@ void path_eval(path *p, double s, double *pos, double *dir, double *T, double *t normalize(tmp); rotate(dir,tmp,normal,phi); + + /* FIXME: This should be the *residual* scattering RMS. */ + *theta0 = p->theta0*sqrt(s); } void path_free(path *p) |