From 2f2cd1797190335468e956f4c286c6e4de27518e Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 2 Jun 2019 13:21:30 -0400 Subject: update find_peaks() to only return unique peaks This commit updates find_peaks() to only return peaks which are at least a certain number of degrees apart from each other. This is because I found that for many events the first few peaks would all be essentially the same direction and so the fit was taking a lot of time fitting essentially the same seed points. Since I now have to only try 3 peaks in order to get my grid jobs to run for less than a few hours it's necessary to make sure we aren't just fitting the same three directions for the "quick" minimization. I also updated the fit to only use a maximum of 3 seed directions. --- src/fit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/fit.c') diff --git a/src/fit.c b/src/fit.c index b1882d8..ac385e3 100644 --- a/src/fit.c +++ b/src/fit.c @@ -47,7 +47,7 @@ /* Maximum number of fit parameters. Should be at least 4 + 3*MAX_VERTICES. */ #define MAX_PARS 100 /* Maximum number of peaks to search for in Hough transform. */ -#define MAX_NPEAKS 5 +#define MAX_NPEAKS 10 /* Maximum kinetic energy for any particle. */ #define MAX_ENERGY 10000 @@ -5316,7 +5316,10 @@ int fit_event2(event *ev, double *xopt, double *fmin, int *id, size_t n, double ub[3] = GTVALID; /* Find the peaks in the Hough transform of the event. */ - find_peaks(ev, pos, 100, 100, peak_theta, peak_phi, &npeaks, LEN(peak_theta)); + find_peaks(ev, pos, 100, 100, peak_theta, peak_phi, &npeaks, LEN(peak_theta),0.1); + + /* Don't fit more than 3 peaks for now. */ + if (npeaks > 3) npeaks = 3; result = malloc(sizeof(size_t)*n*ipow(npeaks,n)); -- cgit