aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-09-25update likelihood calculation to use PMT_TTS macrotlatorre
I accidentally hardcoded the single PE TTS to 1.5 ns in the likelihood calculation.
2018-09-25update integration bounds in likelihood calculationtlatorre
This commit updates the bounds of the track integration in the likelihood function to integrate up to 1 meter around the point at which the PMT is at the Cerenkov angle from the track. This fixes an issue I was seeing where a *very* small change in the fit paramters would cause the likelihood to jump by a large amount. I eventually tracked it down to the same issue I was seeing before which I solved by splitting up the integration into two intervals. However that fix did not seem to completely fix the issue. Based on initial tests with 500 MeV muons, this fix seems to do a much better job.
2018-09-25increase maxeval to 20 for the "quick" minimization phasetlatorre
When testing out the fitter on 500 MeV muons, there was at least one event which started out at a position very far from the true position. This event had a secondary electron like ring which is what I suspect caused the fit to start out in a position far from the true position. This fix correctly starts the minimization close to the true position. In the future I should look at updating get_direction() so that it finds the largest ring direction instead of just doing a weighted average of all the vectors from the position to the PMTs.
2018-09-21update likelihood function to include the probability of the path coefficientstlatorre
2018-09-21split up the track integral into two intervalstlatorre
This commit updates the likelihood calculation to split up the track integral into two intervals in some cases. I noticed when fitting some events that the likelihood value would change drastically for a very small change in the fit parameters. I eventually tracked it down to the fact that the track integral was occasionally returning a very small charge for a PMT which should have a very high charge. This was happening because the region of the track which was hitting the PMT was very small and the cquad integration routine was completely skipping it. The solution to this problem is a bit of a hack, but it seems to work. I first calculate where along the track (for a straight track) the PMT would be at the Cerenkov angle from the track. If this point is somewhere along the track then we split up the integral into two intervals: one going from the start of the track to this point and the other from the point to the end of the track. Since the cquad routine always samples points near the end of the intervals this should prevent it from completely skipping over the point in the track where the integrand is non-zero.
2018-09-21increase MAX_PE to 10000tlatorre
2018-09-20delete unused variable distancetlatorre
2018-09-20don't include the OWL PMTs in the likelihood calculationtlatorre
For some reason the OWL tubes have 9999.00 for the x, y, and z coordinates of the normal vector in the PMT file. For now, I'm just going to remove them from the likelihood calculation.
2018-09-20make sure direction vector is normalized in path_eval()tlatorre
2018-09-20add particle id code to output filetlatorre
2018-09-20add git SHA1 hash to output filetlatorre
2018-09-20add time elapsed to the output filetlatorre
2018-09-20add a command line option to only fit the first eventtlatorre
This commit adds the ability to run the fit program with the --skip-second-event flag to only fit the first event after a MAST bank. This way we avoid fitting secondaries like Michel electrons when fitting MC events.
2018-09-20add absorption lengths for D2O and H2O weighted by the Cerenkov spectrum and ↵tlatorre
the quantum efficiency
2018-09-19change output file format to YAMLtlatorre
2018-09-18stop fitting when the likelihood difference is less than 1e-2tlatorre
2018-09-18speed likelihood calculation up a bittlatorre
2018-09-18free muon_energy struct in test_muon_get_energy()tlatorre
2018-09-18fix heap overflow in interp1d()tlatorre
This commit fixes a potential heap overflow in interp1d() which could occur if x was very close to the last value in the xp array. The bounds check is now performed on the index rather than the x values.
2018-09-18fix typotlatorre
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-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