aboutsummaryrefslogtreecommitdiff
path: root/src/fit.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-10-12 10:20:28 -0500
committertlatorre <tlatorre@uchicago.edu>2018-10-12 10:20:28 -0500
commit09f7f3ec8bbff5102d0447ee664df3f3a404c9bc (patch)
tree1349e40cfb6debc57b536ec25fdec23d01005d66 /src/fit.c
parent26535b2e40ea8c031bb850a594a815d4a3435ebb (diff)
downloadsddm-09f7f3ec8bbff5102d0447ee664df3f3a404c9bc.tar.gz
sddm-09f7f3ec8bbff5102d0447ee664df3f3a404c9bc.tar.bz2
sddm-09f7f3ec8bbff5102d0447ee664df3f3a404c9bc.zip
skip PMTs which weren't hit for the fast likelihood calculation
Diffstat (limited to 'src/fit.c')
-rw-r--r--src/fit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fit.c b/src/fit.c
index 4d8d389..3ab0ffe 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -5253,8 +5253,6 @@ int fit_event(event *ev, double *xopt, double *fmin)
}
}
- memcpy(x,xopt,sizeof(x));
-
/* Reset the lower and upper bounds. */
lb[0] = Tmin;
lb[1] = -1000.0;
@@ -5286,6 +5284,12 @@ int fit_event(event *ev, double *xopt, double *fmin)
nlopt_set_ftol_abs(opt, 1e-5);
nlopt_set_maxeval(opt, 1000);
+ memcpy(x,xopt,sizeof(x));
+
+ nlopt_optimize(opt,x,&fval);
+
+ if (stop) goto end;
+
do {
*fmin = fval;
memcpy(xopt,x,sizeof(x));