aboutsummaryrefslogtreecommitdiff
path: root/src/optics.c
AgeCommit message (Collapse)Author
2020-11-16update fit to fit events from the salt phasetlatorre
This commit updates both the PMT response and optics code to be able to load constants from the salt phase.
2019-05-29add get_avg_index_{d2o,h2o} functionstlatorre
2019-03-25update rayleigh scattering calculationtlatorre
This commit updates the optics code to calculate the rayleigh scattering length using the Einstein-Smoluchowski formula instead of using the effective rayleigh scattering lengths from the RSPR bank.
2019-03-25speed up likelihood function by not calling trapz()tlatorre
This commit speeds up the likelihood function by integrating the charge along the track inline instead of creating an array and then calling trapz(). It also introduces two global variables avg_index_d2o and avg_index_h2o which are the average indices of refraction for D2O and H2O weighted by the PMT quantum efficiency and the Cerenkov spectrum.
2019-03-23fix a bug in the absorption and scattering probabilitiestlatorre
Previously I was computing the fraction of light absorbed and scattered by calculating an average absorption and scattering length weighted by the Cerenkov spectrum and the PMT quantum efficiency, which isn't correct since we should be averaging the absorption and scattering probabilities, not the absorption and scattering lengths. This commit fixes this by instead computing the average probability that a photon is absorbed or scattered as a function of the distance travelled by integrating the absorption and scattering probabilities over all wavelengths weighted by the PMT quantum efficiency and the Cerenkov spectrum.
2019-03-16add GPLv3 licensetlatorre
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-10-19update path integral to use a fixed number of pointstlatorre
I noticed when fitting electrons that the cquad integration routine was not very stable, i.e. it would return different results for *very* small changes in the fit parameters which would cause the fit to stall. Since it's very important for the minimizer that the likelihood function not jump around, I am switching to integrating over the path by just using a fixed number of points and using the trapezoidal rule. This seems to be a lot more stable, and as a bonus I was able to combine the three integrals (direct charge, indirect charge, and time) so that we only have to do a single loop. This should hopefully make the speed comparable since the cquad routine was fairly effective at only using as many function evaluations as needed. Another benefit to this approach is that if needed, it will be easier to port to a GPU.
2018-10-03update absorption coefficients from media_qoca_d2o_20060110.cmdtlatorre
2018-10-02update optics to use LETA constants for the D2O phasetlatorre
This commit updates the PMT response bank and absorption lengths for H2O and D2O based on the values in mcprod which were used for the LETA analysis.
2018-10-01add absorption length for acrylictlatorre
2018-10-01fix a bug when computing the absorption length in H2O and D2Otlatorre
Previously I was interpolating the absorption lengths using interp1d() but that only works when the x array is uniform. Since the wavelengths are not spaced uniformly, we have to use the GSL interpolation routines.
2018-09-20add absorption lengths for D2O and H2O weighted by the Cerenkov spectrum and ↵tlatorre
the quantum efficiency
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-17update likelihood to calculate absorption length correctlytlatorre
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-08-14add refractive index for heavy and light water from snomantlatorre
2018-08-14move everything to src directorytlatorre