aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.c
AgeCommit message (Collapse)Author
2018-08-31switch back to calling cquad just once to speed things uptlatorre
I found when simulating high energy muons that the expected charge for some PMTs which should be getting hit was zero. The reason for this is that the integrand was very sharply peaked at the Cerenkov angle which makes it difficult to integrate for numerical integration routines like cquad. To solve this I split up the integral at the point when the track was at the Cerenkov angle from the PMT to make sure that cquad didn't miss the peak. However, calling cquad twice takes a lot of time so it's not necessarily good to do this for all fits. Also, it's not obvious if it is necessary any more now that the angular distribution calculation was fixed. I think the real reason that cquad was missing those integrals was that for a high energy muon the range is going to be very large (approximately 40 meters for a 10 GeV muon). In this case, I should really only integrate up to the edge of the cavity or PSUP and hopefully cquad picks enough points in there to get a non zero value. I also added a check to only compute tmean when at least one PMT has a valid time. This prevents a divide by zero which causes the likelihood function to return nan.
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-27update code to use get_index_snoman* functions to calculate the index of ↵tlatorre
refraction
2018-08-14fix how the RMS scattering angle is calculatedtlatorre
The RMS scattering angle calculation comes from Equation 33.15 in the PDG article on the passage of particles through matter. It's not entirely obvious if this equation is correct for a long track. It seems like it should be integrated along the track to add up the contributions at different energies, but it's not obvious how to do that with the log term. In any case, the way I was previously calculating it (by using the momentum and velocity at each point along the track) was definitely wrong. I will try this out and perhaps try to integrate it later.
2018-08-14move everything to src directorytlatorre