aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-10-19 13:45:55 -0500
committertlatorre <tlatorre@uchicago.edu>2018-10-19 13:45:55 -0500
commit2a6911cfe04e59fe5157cbb2005629a3a3d635fe (patch)
tree94a4f298b145a6de80f73612d3261b6d09fab2a0 /src
parent33e2b0e4fa292fc6978b1d49b8d9d3a66dc3e9da (diff)
downloadsddm-2a6911cfe04e59fe5157cbb2005629a3a3d635fe.tar.gz
sddm-2a6911cfe04e59fe5157cbb2005629a3a3d635fe.tar.bz2
sddm-2a6911cfe04e59fe5157cbb2005629a3a3d635fe.zip
epsrel -> npoints
Diffstat (limited to 'src')
-rw-r--r--src/fit.c8
-rw-r--r--src/likelihood.c4
-rw-r--r--src/likelihood.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/fit.c b/src/fit.c
index dc4f88b..ba285c9 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -37,7 +37,7 @@ static size_t iter;
typedef struct fitParams {
event *ev;
- double epsrel;
+ int n;
int fast;
int print;
} fitParams;
@@ -4996,7 +4996,7 @@ double nll(unsigned int n, const double *x, double *grad, void *params)
z2[0] = x[8];
gettimeofday(&tv_start, NULL);
- fval = nll_muon(fpars->ev, IDP_MU_MINUS, T, pos, dir, t0, z1, z2, 1, fpars->epsrel, fpars->fast);
+ fval = nll_muon(fpars->ev, IDP_MU_MINUS, T, pos, dir, t0, z1, z2, 1, fpars->n, fpars->fast);
gettimeofday(&tv_stop, NULL);
long long elapsed = (tv_stop.tv_sec - tv_start.tv_sec)*1000 + (tv_stop.tv_usec - tv_start.tv_usec)/1000;
@@ -5186,7 +5186,7 @@ int fit_event(event *ev, double *xopt, double *fmin)
* faster, we set the absolute tolerance on the likelihood to 1.0, the
* maximum number of function evaluations to 100, and the relative
* tolerance on the numerical integration to 10%. */
- fpars.epsrel = 1e-1;
+ fpars.n = 100;
fpars.fast = 1;
fpars.print = 0;
nlopt_set_ftol_abs(opt, 1.0);
@@ -5279,7 +5279,7 @@ int fit_event(event *ev, double *xopt, double *fmin)
nlopt_set_upper_bounds(opt, ub);
/* Now, we do the "real" minimization. */
- fpars.epsrel = 1e-2;
+ fpars.n = 100;
fpars.fast = 0;
fpars.print = 1;
nlopt_set_ftol_abs(opt, 1e-5);
diff --git a/src/likelihood.c b/src/likelihood.c
index ec58d11..8e3f983 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -520,7 +520,7 @@ static double getKineticEnergy(double x, void *p)
return particle_get_energy(x, (particle *) p);
}
-double nll_muon(event *ev, int id, double T0, double *pos, double *dir, double t0, double *z1, double *z2, size_t n, double epsrel, int fast)
+double nll_muon(event *ev, int id, double T0, double *pos, double *dir, double t0, double *z1, double *z2, size_t n, size_t npoints, int fast)
{
size_t i, j, nhit;
double logp[MAX_PE], nll[MAX_PMTS], range, theta0, E0, p0, beta0, smax, log_mu, max_logp;
@@ -624,7 +624,7 @@ double nll_muon(event *ev, int id, double T0, double *pos, double *dir, double t
if (b > range) b = range;
double q_indirect;
- integrate_path(path, i, a, b, 100, mu_direct+i, &q_indirect, &result);
+ integrate_path(path, i, a, b, npoints, mu_direct+i, &q_indirect, &result);
mu_indirect += q_indirect;
if (mu_direct[i] > 1e-9) {
diff --git a/src/likelihood.h b/src/likelihood.h
index 8328322..406c7ea 100644
--- a/src/likelihood.h
+++ b/src/likelihood.h
@@ -44,6 +44,6 @@ typedef struct particle {
particle *particle_init(int id, double T0, size_t n);
double particle_get_energy(double x, particle *p);
void particle_free(particle *p);
-double nll_muon(event *ev, int id, double T0, double *pos, double *dir, double t0, double *z1, double *z2, size_t n, double epsrel, int fast);
+double nll_muon(event *ev, int id, double T0, double *pos, double *dir, double t0, double *z1, double *z2, size_t n, size_t npoints, int fast);
#endif