aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
AgeCommit message (Collapse)Author
2020-11-30update code to work with python3tlatorre
This commit updates the python code to work with python 3 and with a newer version of matplotlib. - zip_longest -> izip_longest - fix tick marks for log plots - scipy.misc -> scipy.special
2020-04-14extend electron range tables up to 1 TeVtlatorre
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-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-07-11switch from YAML output to HDF5 to speed things uptlatorre
2019-06-25add ability to read gzipped zdab filestlatorre
2019-05-24add a script to submit jobs to the gridtlatorre
2019-05-23add zdab-cattlatorre
This commit adds a new program called zdab-cat which is kind of like fit, but just produces the YAML output without actually fitting anything.
2019-03-31update test-find-peaks to plot cerenkov ringstlatorre
This commit updates the test-find-peaks script to plot Cerenkov rings for each of the peaks. It also updates the script to use quad to find the position instead of using the MC information. Finally, I added a -n argument to the script to specify how many peaks to draw.
2019-03-31update Makefiletlatorre
2019-03-08remove -fsanitize=address from Makefiletlatorre
2019-03-07update code to allow you to run the fit outside of the src directorytlatorre
To enable the fitter to run outside of the src directory, I created a new function open_file() which works exactly like fopen() except that it searches for the file in both the current working directory and the path specified by an environment variable.
2019-03-04add a function to tag flasher eventstlatorre
2018-12-13add -fdiagnostics-color to Makefiletlatorre
2018-12-13update fit.c to fit multiple verticestlatorre
This commit adds a new function fit_event2() to fit multiple vertices. To seed the fit, fit_event2() does the following: - use the QUAD fitter to find the position and initial time of the event - call find_peaks() to find possible directions for the particles - loop over all possible unique combinations of the particles and direction vectors and do a "fast" minimization The best minimum found from the "fast" minimizations is then used to start the fit. This commit has a few other updates: - adds a hit_only parameter to the nll() function. This was necessary since previously PMTs which weren't hit were always skipped for the fast minimization, but when fitting for multiple vertices we need to include PMTs which aren't hit since we float the energy. - add the function guess_energy() to guess the energy of a particle given a position and direction. This function estimates the energy by summing up the QHS for all PMTs hit within the Cerenkov cone and dividing by 6. - fixed a bug which caused the fit to freeze when hitting ctrl-c during the fast minimization phase.
2018-12-11add a function to find peaks using a Hough transformtlatorre
2018-12-07add the QUAD fittertlatorre
2018-12-03fix test-zebratlatorre
2018-11-27add rayleigh scatteringtlatorre
This commit adds Rayleigh scattering to the likelihood function. The Rayleigh scattering lengths come from rsp_rayleigh.dat from SNOMAN which only includes photons which scattered +/- 10 ns around the prompt peak. The fraction of light which scatters is treated the same in the likelihood as reflected light, i.e. it is uniform across all the PMTs in the detector and the time PDF is assumed to be a constant for a fixed amount of time after the prompt peak.
2018-11-26update electron range tablestlatorre
This commit also adds a script to calculate the CSDA range for electrons from a table of the stopping power as a function of energy. We need this script since the NIST ESTAR website will only output the stopping power above a certain energy threshold (1 GeV for electrons). See https://physics.nist.gov/PhysRefData/Star/Text/ESTAR.html.
2018-10-18update fit to fit for electrons and protonstlatorre
2018-09-20add git SHA1 hash to output filetlatorre
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-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-08-31compile with -O2 to speed things uptlatorre
2018-08-31rotate and translate the path in path_init to speed things uptlatorre
2018-08-28add path to the likelihood fittlatorre
This commit updates the likelihood fit to use the KL path expansion. Currently, I'm just using one coefficient for the path in both x and y.
2018-08-27add code to expand the track of a particle using a KL expansiontlatorre
To fit the path of muons and electrons I use the Karhunen-Loeve expansion of a random 2D walk in the polar angle in x and y. This allows you to decompose the path into a sum over sine functions whose coefficients become random variables. The nice thing about fitting the path in this way is that you can capture *most* of the variation in the path using a small number of variables by only summing over the first N terms in the expansion and it is easy to calculate the probability of the coefficients since they are all uncorrelated.
2018-08-14update fit to use nlopt for minimizationtlatorre
The GSL library only has the Nelder Mead Simplex algorithm for doing multidimensional minimization without gradient information. The nlopt library has lots of different minimization algorithms so it's easier to switch between them to see which one works best.
2018-08-14move everything to src directorytlatorre