aboutsummaryrefslogtreecommitdiff
path: root/utils/sddm
AgeCommit message (Collapse)Author
2021-01-04update plot-dctlatorre
2021-01-04get rid of nhit_threshtlatorre
2021-01-03add a numba optimized version of interptlatorre
2021-01-03speed up read_mcpl()tlatorre
2021-01-03cache results from get_events()tlatorre
2020-12-27reduce memory usagetlatorre
2020-12-27reduce memory usagetlatorre
2020-12-27reduce memory usagetlatorre
2020-12-25merge lefttlatorre
2020-12-25don't warn about rhdr banks and 50 MHz clock jumps for MCtlatorre
2020-12-16use a hash to merge weights with MC datatlatorre
2020-12-16python 3 fixtlatorre
2020-12-15add code to reweight the tau neutrino eventstlatorre
This commit updates the code to reweight the MC data from tau neutrinos since I stupidly simulated the muon neutrino flux instead of the tau neutrino flux.
2020-12-09use nanpercentile in get_events()tlatorre
2020-12-09update logger.py to be python3 compatibletlatorre
This commite updates the Logger class to use str instead of basestring.
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-11-17update burst cuttlatorre
2020-11-16require signal events to have nhit_cal/nhit > 0.8tlatorre
2020-11-16add a new burst cuttlatorre
2020-11-16add script to plot neutron nhit and delta t distributionstlatorre
2020-11-16calculate livetime based on pulse gt and 10 MHz clocktlatorre
This commit updates get_events() to calculate the livetime based on both the number of pulse gt events and the 10 MHz clock and to return it in a dictionary stored with the dataframe. I also update dm-search so that the results are now reported as a function of events/cm^3/s. Also updated radius cut to be the AV radius.
2020-11-16don't apply retrigger cut to MCtlatorre
2020-11-16update dm-search scripttlatorre
2020-11-03forgot to commit utils.pytlatorre
2020-11-03fix bug in get_events()tlatorre
This commit fixes an unnecessary call to set the index on the ev dataframe. This was causing issues when trying to process run 11903 since it didn't have any fits to merge into the ev dataframe.
2020-11-01accidentally committed a print statementtlatorre
2020-11-01update retrigger cuttlatorre
This commit updates the retrigger cut to cut events where the previous event is missing, so that even if I forget to run the analysis with all the orphan events included, we will cut events potentially coming after an instrumental or muon that got cut by the junk cut.
2020-11-01cut orphans instead of JUNK eventstlatorre
This commit updates get_events() to only cut orphans instead of all JUNK events before calculating time differences. The reason is that some large instrumental events (or muons) can get flagged as JUNK events since they sometimes have multiple hits from the same PMT. If we remove them before calculating the time difference, the follower might not get cut. See run 10040 GTID 349491 for an example.
2020-11-01don't apply nhit trigger cut to MCtlatorre
2020-10-05major updates to the chi2 analysistlatorre
This commit fixes the chi2 analysis so that it is no longer biased. Previously, the chi2 analysis pull plots showed a consistent bias. At first, I thought this was due to the fact that the posterior wasn't gaussian, but even after switching to percentile plots based on the algorithm outlined in "Validating Bayesian Inference Algorithms with Simulation-Based Calibration", I was still seeing a bias. I finally tracked it down to the fact that I was applying the energy scale parameters to the data instead of the Monte Carlo. Therefore, in this commit I update the posterior to now apply the energy scale parameters to the Monte Carlo instead of the data. This has the slight disadvantage that the final histograms will be binned in the biased energy, but that's not really a big deal. In addition, this commit contains several other updates: - switch to plotting percentile plots based on the algorithm in "Validating Bayesian Inference Algorithms with Simulation-Based Calibration" instead of pull plots - apply both the energy scale and resolution at the individual particle level, i.e. there is no longer an energy resolution term for electron + muon fits - separate pull plots and coverage plots. Previously I was making both the p-value coverage plots and the pull plots at the same time. However, the pull plots shouldn't have anything to do with the GENIE weights whereas the p-value coverage plots should draw samples weighted by the GENIE weights. In addition, for the pull plots we draw new truth parameters on every iteration whereas for the p-value coverage plots we only draw them once. - switch to using KDEMove() for the MCMC since I think it samples multimodal distributions a lot better than the default emcee move. - I now correct for the reconstruction energy bias in plot-michel and plot-muons
2020-09-07increase maxiter to 1000tlatorre
2020-09-07update plot-muons script so it works outside the utils/ directorytlatorre
2020-08-31add GENIE weights to chi2 analysistlatorre
2020-08-31add estimate_errors to chi2 analysistlatorre
This commit updates the estimate_errors() function so that it works without a list of constraints and uses arrays of low and high bounds passed in instead of hardcoded constraints. I can now call this function from the chi2 analysis to get the stepsizes before running the MCMC.
2020-08-17simplify likelihood calculation in chi2tlatorre
2020-08-17simplify nllr() functiontlatorre
2020-08-17update function to tag atmosphericstlatorre
Previously the function to tag atmospherics was looking at the *first* event to come after a prompt event and checking to see if it was a neutron. However, this has a huge issue in that for large energy events, there is often secondary events caused by afterpulsing. I've now updated the algorithm to look for any events in which there is *any* follower event that passes the neutron criteria.
2020-08-17fix bug in get_events()tlatorre
ev.r -> ev_single_particle.r
2020-07-27identify muons in the MC by looking for 'cosmic' in the filenametlatorre
2020-07-27update how the negative log likelihood ratio is calculatedtlatorre
I found a really simple form for the log likelihood ratio of a Poisson and multinomial likelihood.
2020-07-27only merge fit info for events with at least 10 fitstlatorre
This commit updates get_events() to only merge fit info for events with at least 10 events. The reason for this is that when analyzing recent data where not all the fits have completed we don't want to plot the data for events which haven't completely finished being fit.
2020-07-27update how the p-value is calculated in get_multinomial_prob()tlatorre
2020-07-06add function to print particle probabilities in plot-muonstlatorre
2020-07-06small updates to plot-muons and plot_energy.pytlatorre
- use pd.Series.where() instead of DataFrame.loc() to speed things up in tag_michels - don't set y limits when plotting bias and resolution for stopping muons
2020-07-06update plot-muonstlatorre
- add get_multinomial_prob() function to stats.py - add plot_hist2_data_mc() function to do the normal particle id plot but also print p values - other small bug fixes
2020-07-06add sddm/stats.pytlatorre
This commit adds the new file sddm/stats.py to and adds a function to correctly sample a Monte Carlo histogram when computing p-values. In particular, I now take into account the uncertainty on the total number of expected events by drawing from a gamma distribution, which is the posterior of the Poisson likelihood function with a prior of 1/lambda.
2020-07-06add first draft of plot-muonstlatorre
This commit adds a first draft of a script to plot the michel energy distribution and particle id histograms for data and Monte Carlo and to plot the energy bias and resolution for stopping muons.
2020-06-23first draft of a script to do the chi2 analysistlatorre
This commit adds a first draft of a script called chi2. This script calculates a chi2 for the null hypothesis test if the events in the energy range 20 MeV - 10 GeV match what we expect from atmospheric neutrino events.
2020-06-22update get_events() to require at least 1 nhit trigger to firetlatorre
This commit updates get_events() to require at least 1 nhit trigger to fire. The reason for this is that after looking at a small fraction of the data I noticed a bunch of instrumental events that weren't getting tagged in run 10141. They looked sort of like neck events and were surrounded by hundreds of orphaned PMT hits. My best guess is that they really were neck events but the neck PMT hits and the hits in the lower hemisphere were erroneously not getting built into the events. Luckily, all of these events failed the psi cut, but it's not great to rely on such a high level cut to cut these events. One other thing I noticed was that these events were triggered mostly by MISS, OWLEL, and OWLEH. Therefore I thought it might be a good idea to require events to have at least 1 NHIT trigger. To test whether the NHIT triggers were reliably firing before the other triggers I looked at all muon events which *didn't* have an NHIT trigger fire. All of them appeared to be falsely tagged neck events so I'm fairly confident that the NHIT triggers do reliably fire before the other triggers for physics events.
2020-06-16update read_hdf() to open hdf5 files in read only modetlatorre