aboutsummaryrefslogtreecommitdiff
path: root/src/sno_charge.c
AgeCommit message (Collapse)Author
2019-11-06add a couple of improvements to the quad fitter and fix a bug in ↵tlatorre
get_hough_transform() This commit adds two improvements to the quad fitter: 1. I updated quad to weight the random PMT hit selection by the probability that the PMT hit is a multiphoton hit. The idea here is that we really only want to sample direct light and for high energy events the reflected and scattered light is usually single photon. 2. I added an option to quad to only use points in the quad cloud which are below a given quantile of t0. The idea here is that for particles like muons which travel more than a few centimeters in the detector the quad cloud usually looks like the whole track. Since we want the QUAD fitter to find the position of the *start* of the track we select only those quad cloud points with an early time so the position is closer to the position of the start of the track. Also, I fixed a major bug in get_hough_transform() in which I was using the wrong index variable when checking if a PMT was not flagged, a normal PMT, and was hit. This was causing the algorithm to completely miss finding more than one ring while I was testing it.
2019-08-05update sno_charge to prevent nan when charge is negativetlatorre
This commit updates the charge spectrum initialization to convolve the charge distribution over a wider range to make sure that we have a nonzero probability of observing charges all the way down to qlo. The reason for this is that previously for some negative charges the probability of observing that charge was zero, which was causing the likelihood to return nan.
2019-07-29flag PMT charges below qlotlatorre
This commit updates get_event() to flag PMT charges below qlo, which is the minimum charge value that we compute the charge PDFs for. This is to prevent the likelihood from returning nan.
2019-06-14add a function to compute the most likely number of PE given an observed chargetlatorre
Also, call this function when computing the psi parameter in nll_best().
2019-03-26small update to the charge likelihood calculationtlatorre
This commit updates the charge likelihood calculation to calculate: P(hit,q|n) = P(q|hit,n)*P(hit|n) This has almost no effect on the fit results, but is technically correct.
2019-03-16add GPLv3 licensetlatorre
2019-03-04log(norm(...)) -> log_norm(...)tlatorre
2018-11-28update sno_charge.ctlatorre
This commit adds lots of comments to sno_charge.c and makes a couple of other changes: - use interp1d() instead of the GSL interpolation routines - increase MAX_PE to 100 I increased MAX_PE because I determined that it had a rather large impact on the likelihood function for 500 MeV electrons. This unfortunately slows down the initialization by a lot. I think I could speed this up by convolving the single PE charge distribution with a gaussian *before* convolving the charge distributions to compute the charge distributions for multiple PE.
2018-11-27a bunch of small changes to speed things uptlatorre
2018-09-18add free_charge() to free memory used to interpolate the charge distributionstlatorre
2018-09-17fix bug in single PE chargetlatorre
This commit makes sure that when we conolve the single PE charge distribution with a gaussian we integrate starting at zero since the PDF is zero for q < 0.
2018-09-10add a fast likelihood functiontlatorre
This commit adds a fast function to calculate the expected number of PE at a PMT without numerically integrating over the track. This calculation is *much* faster than integrating over the track (~30 ms compared to several seconds) and so we use it during the "quick" minimization phase of the fit to quickly find the best position.
2018-09-09fix bug in charge PDF calculationtlatorre
This commit fixes a bug in the charge PDF calculation for n > MAX_PE. The standard deviation should scale like sqrt(n)*qstd where qstd is the standard deviation of the single PE charge distribution.
2018-08-14move everything to src directorytlatorre