Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|