aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-09-09uncalibrate MC times and charges in get_event()tlatorre
This commit updates get_event() to fill in the uncalibrated charge and time info from the calibrated charge and time. The ECA calibrated time and ECA + PCA without walk correction times (ept and pt1) are just set to the calibrated time. The uncalibrated charges are set by multiplying the calibrated charge by the mean high-half point and adding a constant offset, and the ECA calibrated charges are set by taking the uncalibrated charges and subtracting the offset. The reason for filling these in is so that we can test the data cleaning cuts on MC. Although it would be better if these were filled in by the MC, this is better than nothing.
2019-09-09switch to using ept instead of pt1 in is_flasher() and is_slot_early()tlatorre
2019-09-09only loop over normal PMTs in is_slot_early()tlatorre
2019-09-09fix a typo in is_slot_early()tlatorre
2019-08-28fix some error handling in zebra.ctlatorre
This commit updates the zebra code to properly handle all the errors from get_bytes(). I also updated fit and cat-zdab to not display the errors about the FTX banks by default unless you run them with the -v command line option.
2019-08-27fix the fts cuttlatorre
This commit fixes the FTS cut so that it returns 1 when the event is flagged as failing the cut. Previously, the function returned the following: not enough PMT pairs: 0 (fail) median time > 6.8 ns: 0 (fail) otherwise: 1 (pass) This had two issues: the return value wasn't consistent with the rest of the data cleaning cuts and it should pass if there aren't enough PMT pairs. Now, I fixed the not enough PMT pairs case and made the return value consistent with the rest of the data cleaning cuts: not enough PMT pairs: 0 (pass) median time > 6.8 ns: 1 (fail) otherwise: 0 (pass)
2019-08-27add the in time channel data cleaning cut from SNOtlatorre
2019-08-27update neck cuttlatorre
This commit updates the second requirement of the neck event tag to flag events in which either 50% of the normal PMT hits are at the bottom of the detector *or* 50% of the ECA calibrated charge is at the bottom of the detector. This update was added after testing the cut out on run 10058 which is not in the golden run list and noticing that there were 4 events which were very clearly neck events but which didn't get tagged.
2019-08-26fix a bug in get_{shower,delta_ray}_weights() causing crashtlatorre
This commit fixes a bug in get_shower_weights() and get_delta_ray_weights() which was causing an inf value to propagate and cause the fitter to crash. The problem came because due to floating point roundoff the cdf value at the end of the loop was slightly greater than the last cdf value we wanted which was causing it to get mapped to cos(theta) = -1 (I think?) and then subsequently get interpolated to an infinite value for xcdf. The fix is just to make sure that the x coordinate is always between x1 and x2.
2019-08-26sort particle combo arraytlatorre
2019-08-05update sno_charge to prevent nan when charge is negativetlatorre
This commit updates the charge spectrum initialization to convolve the charge distribution over a wider range to make sure that we have a nonzero probability of observing charges all the way down to qlo. The reason for this is that previously for some negative charges the probability of observing that charge was zero, which was causing the likelihood to return nan.
2019-08-05add ability to specify a particle combo on the command linetlatorre
This commit updates the fit program to accept a particle combo from the command line so you can fit for a single particle combination hypothesis. For example running: $ ./fit ~/zdabs/mu_minus_700_1000.hdf5 -p 2020 would just fit for the 2 electron hypothesis. The reason for adding this ability is that my grid jobs were getting evicted when fitting muons in run 10,000 since it takes 10s of hours to fit for all the particle hypothesis. With this change, and a small update to the submit-grid-jobs script we now submit a single grid job per particle combination hypothesis which should make each grid job run approximately 4 times faster.
2019-07-29use standard PCA time for MCtlatorre
2019-07-29update run-fit to write output files with suffix hdf5tlatorre
2019-07-29write out the hdf5 file after every fittlatorre
2019-07-29flag PMT charges below qlotlatorre
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.
2019-07-29don't need N_ACOS anymoretlatorre
2019-07-29add a faster version of fast_acos()tlatorre
This commit updates fast_acos() to use an algorithm I found here: https://web.archive.org/web/20161223122122/http://http.developer.nvidia.com:80/Cg/acos.html which is faster than using a lookup table.
2019-07-29avoid a division in get_expected_charge()tlatorre
2019-07-29fast_sqrt -> sqrttlatorre
After some testing, I realized that the fast_sqrt() function wasn't really faster than the native sqrt function.
2019-07-29switch to using the multiphoton PCA timetlatorre
This commit updates the likelihood to use the multiphoton PCA time instead of the usual pt time. When looking at the reconstruction of muons in run 10,000 I noticed that the PMT hit times for the PMTs which had really high charge was all over the place. There were PMTs that were very close to each other with hit times differing by ~ 20 ns. I'm still not entirely sure what causes this (is it some hardware issue with the discriminator or is it a problem with the charge walk correction which always assumes a single PE?), but the multiphoton PCA times looked a lot more reasonable. Eventually I need to look into the ptms variable which is the multiphoton PCA transit time RMS.
2019-07-29fix a bug in theta0 min calculationtlatorre
Previously I was accidentally passing the absolute position of the particle instead of the distance to the PMT to get_theta0_min().
2019-07-29ev.gtid -> bev.gtr_idtlatorre
2019-07-16fix bug introduced in ebe2799tlatorre
This commit fixes a bug introduced in a previous commit when I moved all the code to add the run, gtid, etc. to the event object to get_event(). We actually need the run number before then to load the DQXX file for the right run.
2019-07-16don't double count PMT pairs in fts cuttlatorre
2019-07-16update neck tube cut to include time difference changes due to cable changestlatorre
2019-07-16delete some unused #defines and add a comment to the PSUP radiustlatorre
2019-07-16use QLX if QHS is railedtlatorre
2019-07-16multiply rayleigh scattering by 2 to account for the 50% PMT coveragetlatorre
2019-07-12don't load DQXX file for run 10000 by defaulttlatorre
2019-07-12don't flag PMT hits based on the uncalibrated QHS for MCtlatorre
2019-07-11switch from YAML output to HDF5 to speed things uptlatorre
2019-07-08add vertex time field to zdab-cattlatorre
2019-07-05add MCVX time to the YAML filetlatorre
2019-06-25add ability to read gzipped zdab filestlatorre
2019-06-23update how neck events are flaggedtlatorre
This commit updates the is_neck_event() function to include the requirement that 50% of the normal PMTs in the event must have z <= -425.0.
2019-06-23update flasher cuttlatorre
This commit updates the flasher cut to use the median hit time for all hits in the paddle card instead of just the time of the channel with the highest charge.
2019-06-20update zdab-cat to output 50 MHz clock time and trigger typetlatorre
2019-06-20fix cat-grid-jobs againtlatorre
2019-06-20update zdab-cat to emit multiple YAML documentstlatorre
This commit updates zdab-cat to output each event as an individual YAML document. The advantage of this is that we can then iterate over these without loading the entire YAML document in submit-grid-jobs which means that we won't use GB of memory on the grid submission node.
2019-06-20fix empty list at top of YAML output in zdab-cattlatorre
2019-06-19add data cleaning word and ftp, ftk, and rsp info to zdab-cat outputtlatorre
2019-06-19add FTP, RSP, and FTK results to the output filetlatorre
2019-06-16fix type of nph in ev banktlatorre
2019-06-16check the KPF_NO_CAL and KPF_BAD_CAL bits in get_event()tlatorre
2019-06-16assume the particle produces no light if it's outside the PSUPtlatorre
2019-06-15update test-find-peaks to work with SNOCR filestlatorre
2019-06-15add a bunch more data cleaning cuts from SNOtlatorre
This commit adds the following data cleaning cuts: - FTS - OWL trigger - OWL - ESUM
2019-06-15update nll_best() so that we don't get negative psi valuestlatorre
This commit updates the time estimate in nll_best() to take into account the fact that for PMTs which get hit by a lot of photons the time distribution we expect is the first order statistic of the overall photon hit time distribution.
2019-06-14fix empty list item at top of YAML filetlatorre
The first logical record in the SNOCR files don't have an EV bank which was causing the output file to have an emtpy list element. This commit fixes the issue by checking for an empty EV bank before printing the list delimiter.