aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-18update PMT TTS and dark rate from pmt_response.dattlatorre
2018-09-18fix typotlatorre
2018-09-18fix PMTR bank offsetstlatorre
2018-09-18fix offsettlatorre
2018-09-18add functions to get the PMT reflectivity from the PMTR banktlatorre
2018-09-18add free_charge() to free memory used to interpolate the charge distributionstlatorre
2018-09-18add a ctrl-c handlertlatorre
2018-09-18update CHARGE_FRACTIONtlatorre
This commit updates the CHARGE_FRACTION value to now represent approximately the fraction of light reflected from each PMT. It also updates the value to be closer to the true value based on a couple of fits.
2018-09-18free memory from muon_energy structtlatorre
2018-09-17add absorption length data from SNOMANtlatorre
This commit updates get_absorption_length_snoman_d2o() and get_absorption_length_h2o() to use absorption lengths from SNOMAN. Currently I'm just using the values from prod/media.dat but there are other media files in that directory that have values that seem to be actually measured using in-situ measurements (for example media_qoca_*.dat). I'm not 100% sure which ones to use so I am adding the default ones for now.
2018-09-17fix bug in fast likelihood calculationtlatorre
2018-09-17update likelihood function to calculate time of flight of photons using ↵tlatorre
get_path_length()
2018-09-17update likelihood to calculate absorption length correctlytlatorre
2018-09-17add get_path_length()tlatorre
This commit adds a function called get_path_length() which computes the path length inside and outside a sphere for a line segment between two points. This will be useful for calculating the photon absorption for paths which cross the AV and for computing the time of flight of photons from a track to a PMT.
2018-09-17test_muon_get_T -> test_muon_get_energytlatorre
2018-09-17update muon kinetic energy calculationtlatorre
This commit updates the calculation of the muon kinetic energy as a function of distance along the track. Previously I was using an approximation from the PDG, but it doesn't seem to be very accurate and won't generalize to the case of electrons. The kinetic energy is now calculated using the tabulated values of dE/dx as a function of energy.
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-17fix a bug in get_dEdx()tlatorre
2018-09-17fix a bug in interp1d()tlatorre
This commit fixes a bug in interp1d() which would cause the function to read past the end of the arrays if the interpolation point was equal to the last point in the xp array.
2018-09-17add a header file with the SNOMAN particle and target ID codestlatorre
2018-09-17add bitmasks for the mc track status wordtlatorre
2018-09-17add MC Track bank to zdab_utilstlatorre
2018-09-17add top level Makefiletlatorre
2018-09-13fix width formatting for t0tlatorre
2018-09-13add a function to compute log(n) for integer ntlatorre
This commit adds the function ln() to compute log(n) for integer n. It uses a lookup table for n < 100 to speed things up.
2018-09-13speed things up by introducing a minimum ratio between probabilitiestlatorre
Previously to avoid computing P(q,t|n)*P(n|mu) for large n when they were very unlikely I was using a precomputed maximum n value based only on the expected number of PE. However, this didn't take into account P(q|n). This commit updates the likelihood function to dynamically decide when to quit computing these probabilities when the probability for a given n divided by the most likely probability is less than some threshold. This threshold is currently set to 10**(-10) which means we quit calculating these probabilities when the probability is 10 million times less likely than the most probable value.
2018-09-12small updates to speed things uptlatorre
2018-09-12update the starting parameterstlatorre
2018-09-11only print the likelihood value once for each iteration during the "quick" ↵tlatorre
minimization phase
2018-09-11fix the energy and position when doing the "quick" minimizationstlatorre
2018-09-11switch order of expressions to avoid a valgrind warningtlatorre
2018-09-11update fast likelihood function to include the pmt response and absorptiontlatorre
2018-09-11add absorption lengthtlatorre
This commit adds the absorption length to the likelihood calculation. For now I'm just using a single number independent of wavelength. I should update this in the future to actually use the absorption lengths as measured by SNO and then calculate an overall absorption length weighted by the Cerenkov spectrum and the PMT quantum efficiency.
2018-09-11update PMT_RADIUS to be the radius of the PMT concentratortlatorre
2018-09-11add PMT responsetlatorre
This commit adds code to read in the PMT response from the PMTR bank from SNOMAN. This file was used for the grey disk model in SNOMAN and was created using a full 3D simulation of the PMT and concentrator. Since the PMT response in SNOMAN included the quantum efficiency of the PMT, we have to divide that out to get just the PMT response independent of the quantum efficiency. I also updated the likelihood calculation to use the pmt response. Currently the energy is being fit too high which I think will improve when we update the solid angle calculation to use the radius of the concentrator instead of the PMT.
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-09-06compute theta0 in path_init() to speed things uptlatorre
2018-09-06update theta0 calculationtlatorre
This commit updates path_eval() to calculate theta0 using the residual scattering RMS for a truncated KL expansion. Since there isn't a nice closed form solution for this, we instead compute a rough approximation by evaluating the residual scattering RMS at the center of the track.
2018-09-06introduce a minimum value for the scattering RMS theta0tlatorre
2018-09-04update kinetic energy step size to 2% of initial kinetic energy guesstlatorre
2018-09-04add a function to return the kahan sum of an arraytlatorre
For some reason the fit seems to have trouble with the kinetic energy. Basically, it seems to "converge" even though when you run the minimization again it finds a better minimum with a lower energy. I think this is likely due to the fact that for muons the kinetic energy only really affects the range of the muon and this is subject to error in the numerical integration. I also thought that maybe it could be due to roundoff error in the likelihood calculation, so I implemented the Kahan summation to try and reduce that. No idea if it's actually improving things, but I should benchmark it later to see.
2018-09-04update fit to guess energy, direction, and t0tlatorre
This commit updates the initial guess for the energy using a simple heuristic of ~6 hits/MeV. I also updated the initial phase where we do a bunch of "quick" minimizations to loop over a series of starting positions and automatically calculate the approximate direction and t0 for the event.
2018-08-31add muon critical energy for D2Otlatorre
2018-08-31start by doing a series of "quick" minimizationstlatorre
This commit updates the fit_event function to first do a series of "quick" minimizations to try and find a good set of starting parameters for the "real" fit. I also updated the bounds on theta and phi since having hard bounds on these angle coordinates could prevent the fitter from finding the minimum.
2018-08-31add epsrel argument to likelihood functiontlatorre
2018-08-31update the lower bound for the energy in the fittlatorre
2018-08-31update the criterion for the fit convergencetlatorre
2018-08-31update likelihood check to 1e-5 since that's what we pass to nlopttlatorre
2018-08-31fit in a do while loop until the fit converges to the same likelihood valuetlatorre