diff options
-rw-r--r-- | src/fit.c | 6 | ||||
-rw-r--r-- | src/likelihood.c | 2 | ||||
-rw-r--r-- | src/likelihood.h | 2 |
3 files changed, 5 insertions, 5 deletions
@@ -4975,7 +4975,7 @@ static struct startingParameters { { 800.0, 800.0, 800.0}, }; -double nll(unsigned int n, const double *x, double *grad, void *params) +static double nopt_nll(unsigned int n, const double *x, double *grad, void *params) { fitParams *fpars = (fitParams *) params; double theta, phi; @@ -5007,7 +5007,7 @@ double nll(unsigned int n, const double *x, double *grad, void *params) v.n = 1; gettimeofday(&tv_start, NULL); - fval = nll_muon(fpars->ev, &v, 1, fpars->dx, fpars->dx_shower, fpars->fast); + fval = nll(fpars->ev, &v, 1, fpars->dx, fpars->dx_shower, 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; @@ -5118,7 +5118,7 @@ int fit_event(event *ev, double *xopt, double *fmin, int id) struct timeval tv_start, tv_stop; opt = nlopt_create(NLOPT_LN_BOBYQA, 9); - nlopt_set_min_objective(opt,nll,&fpars); + nlopt_set_min_objective(opt,nopt_nll,&fpars); /* Make a guess as to the energy. Right now we just use a simple * approximation that the muon produces approximately 6 photons/MeV. diff --git a/src/likelihood.c b/src/likelihood.c index 4e766b6..0e78800 100644 --- a/src/likelihood.c +++ b/src/likelihood.c @@ -720,7 +720,7 @@ static double getKineticEnergy(double x, void *p) return particle_get_energy(x, (particle *) p); } -double nll_muon(event *ev, vertex *v, size_t n, double dx, double dx_shower, int fast) +double nll(event *ev, vertex *v, size_t n, double dx, double dx_shower, int fast) { /* Returns the negative log likelihood for event `ev` given a particle with * id `id`, initial kinetic energy `T0`, position `pos`, direction `dir` and diff --git a/src/likelihood.h b/src/likelihood.h index 921a97d..69d6896 100644 --- a/src/likelihood.h +++ b/src/likelihood.h @@ -83,6 +83,6 @@ double particle_get_energy(double x, particle *p); void particle_free(particle *p); double time_pdf(double t, double mu_noise, double mu_indirect, double *mu_direct, double *mu_shower, size_t n, double *ts, double *ts_shower, double tmean, double sigma, double *ts_sigma); double time_cdf(double t, double mu_noise, double mu_indirect, double *mu_direct, double *mu_shower, size_t n, double *ts, double *ts_shower, double tmean, double sigma, double *ts_sigma); -double nll_muon(event *ev, vertex *v, size_t n, double dx, double dx_shower, int fast); +double nll(event *ev, vertex *v, size_t n, double dx, double dx_shower, int fast); #endif |