From d1ce12ce69604c6979f4ffa45e4908eb71b19c60 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 13 Apr 2020 11:40:13 -0500 Subject: update find_peaks algorithm This commit updates the find peaks algorithm with several improvements which together drastically improve its ability to find Cerenkov rings: - when computing the Hough transform, instead of charge we weight each PMT hit by the probability that it is a multi-photon PMT hit - we don't subtract off previously found rings (this makes the code simpler and I don't think it previously had a huge effect) - ignore PMT hits who are within approximately 5 degrees of any previously found ring (previously we ignored all hits within the center of previously found rings) - ignore PMT hits which have a time residual of more than 10 nanoseconds to hopefully ignore more reflected and/or scattered light - switch from weighting the Hough transform by exp(-fabs(cos(theta)-1/n)/0.1) -> exp(-pow(cos(theta)-1/n,2)/0.01). I'm still not sure if this has a huge effect, but the reason I switched is that the PDF for Cerenkov light looks closer to the second form. - switch to calling quad with f = 1.0 in test-find-peaks (I still need to add this update to fit.c but will do that in a later commit). --- src/find_peaks.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/find_peaks.h') diff --git a/src/find_peaks.h b/src/find_peaks.h index 0219561..584774a 100644 --- a/src/find_peaks.h +++ b/src/find_peaks.h @@ -20,8 +20,11 @@ #include "event.h" #include /* for size_t */ +/* Maximum number of PE to consider when calculating P(> 1 hit|q) */ +#define FIND_PEAKS_MAX_PE 10 + void find_peaks_array(double *x, size_t n, size_t m, size_t *imax, size_t *jmax, size_t *npeaks, size_t max_peaks, double threshold); -void get_hough_transform(event *ev, double *pos, double *x, double *y, size_t n, size_t m, double *result, double *last, size_t len); -void find_peaks(event *ev, double *pos, size_t n, size_t m, double *peak_theta, double *peak_phi, size_t *npeaks, size_t max_peaks, double delta); +void get_hough_transform(event *ev, double *pos, double t0, double *x, double *y, size_t n, size_t m, double *result, double *last, size_t len); +void find_peaks(event *ev, double *pos, double t0, size_t n, size_t m, double *peak_theta, double *peak_phi, size_t *npeaks, size_t max_peaks, double delta); #endif -- cgit