aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-09-27update the flasher cuttlatorre
This commit updates the flasher cut with the following changes: - no longer require nhit to be less than 1000 - update charge criteria to be that the flasher channel must have a QHS or QHL 1000 counts above the next highest QHS or QHL value in the PC or a QLX value 80 counts above the next highest QLX value - only check is_slot_early() for missing hits in the PC These updates were inspired by looking at how to tag flashers in runs 20062 - 20370 which didn't fail the original cut. In particular, the following flashers were previously not tagged: Run GTID Comments --- ---- -------- 20062 818162 flasher with only 3 hits in PC reconstructs at PSUP ESUMH triggered 20083 120836 high charge missing (in next couple of events) probably picked wrong flasher PMT ID 20089 454156 nhit > 1000 After this commit the last two are properly tagged.
2019-09-26update QVNHIT cuttlatorre
This commit updates the QvNHIT cut to not require PMT hits to have a good calibration to be included in the charge sum. The reason for this is that many electrical pickup events have lots of hits which are pickup and thus have small or negative charges. When the charge is low like this the PMT hits get flagged with the bad calibration bit (I'm not sure if it's because of the PMT charge walk calibration or what). Therefore, now we include all hit PMTs in the charge sum if there ECA calibrated QHL value is above -100.
2019-09-25update zdab-reprocess to be faster and run FTP and RSPtlatorre
This commit updates the zdab-reprocess script with the following changes: - don't run RAA - don't run a bunch of the other fitters like FTI, etc. - run the path and RSP fitters - add --lower-nhit and --upper-nhit command line arguments to control the primary nhit cut range
2019-09-25fix another small bug in zdab-reprocesstlatorre
2019-09-24fix bugs introduced into zdab-reprocess in commit 1e35deatlatorre
2019-09-24update zebra code to store location of MAST banktlatorre
This commit updates the zebra code to store a pointer to the first MAST bank in the zebraFile struct so that we can jump to it when iterating over the logical records. I had naively assumed based on the documenation in the SNOMAN companion that the first bank in a logical record was guaranteed to be a MAST bank, but that doesn't seem to be the case. This also explains why I was sometimes seeing RHDR and ZDAB banks as the first bank in a logical record.
2019-09-24update zdab-reprocess to be able to handle more filenamestlatorre
2019-09-24update breakdown cut to include a cut on the number of calibrated PMT hitstlatorre
This commit updates the breakdown cut to flag any event in which less than 70% of the PMT hits have a good TAC value.
2019-09-24update shower position distribution parameters for muonstlatorre
This commit updates the a and b parameters for the gamma distribution used to describe the position distribution of shower photons produced along the direction of the muon. Previously I had been assuming b was equal to the radiation length and using a formula from the PDG to calculate a from that. However, this formula doesn't seem to be valid for muons (the formula comes from a section describing the shower profile of electrons and gammas, so it's not surprising). Therefore, now we don't assume any relationship between a and b. Now, the value of a is approximated by a constant since I couldn't find any functional relationship as a function of energy to describe a very well (and it's approximately constant), and b is approximated by a single degree polynomial fit to the values I got from simulating muons in RAT-PAC as a function of energy. Note that looking at the simulation data it seems like the position distribution of shower photons from muons isn't even very well described by a gamma distribution, so in the future it might be a good idea to come up with a better parameterization. Even if I stick with the gamma distribution, it would be good to revisit this in the future and fit for a and b over a wider range of energies.
2019-09-23select prompt events before data cleaning cutstlatorre
This commit updates plot-energy to select prompt events before applying the data cleaning cuts. This fixes an issue where we might accidentally classify an event as a prompt event even if it came after an event that was flagged by data cleaning. For example, suppose there was a breakdown but for whatever reason the event immediately after the breakdown wasn't tagged (ignoring the fact that we apply a breakdown follower cut). If we apply the data cleaning first and then the prompt event selection, that event would be a part of the prompt events. There are several other small updates to plot-energy: - fix bug in 00-orphan cut - make michel event selection a separate function - make atmospheric tag into a separate function
2019-09-23add sub_run variable to the events array in the HDF5 filetlatorre
This commit adds the sub_run variable to the ev array in the HDF5 output file and updates plot-energy to order the events using the run and sub_run variables. This fixes a potential issue where I was sorting by GTID before, but the GTID can wrap around and so isn't guaranteed to put the events in the right order.
2019-09-23add the 00-orphan cut to plot-energytlatorre
2019-09-23update the ITC cut to use pt1 timetlatorre
This commit updates the ITC cut to use the pt1 time which is the ECA + PCA without charge walk calibration time. The reason is that an event which is mostly electronics noise may have all low charges which can't be calibrated with the PCA walk calibration.
2019-09-21update definition of nhittlatorre
This commit updates the ev.nhit variable to represent the total number of normal PMTs hit in the event, regardless of if the calibration failed. I added a new variable ev.nhit_cal which now stores the total number of normal PMTs hit without any flags.
2019-09-10add best_uncal_q to the pmt_hit struct and use it in the muon cuttlatorre
This commit adds a field to the pmt_hit struct called best_uncal_q which represents the best ECA calibrated charge (in units of QHS counts above pedestals). This is then used in the muon data cleaning cut.
2019-09-09add retrigger, flasher follower, and breakdown follower cuts to plot-energytlatorre
2019-09-09fix typo in is_slot_earlytlatorre
2019-09-09update muon cuttlatorre
This commit updates the muon cut to require at least 1 OWL hit which has a high charge and is early relative to nearby normal PMTs. This replaces the previous cut criteria which required 2 OWL hits to be early relative to the 10% percentile of all the normal PMT hits. This new cut should target external muons better although I still need to do some testing. In the future I'd like to optimize the distance at which PMTs are considered nearby. Currently I just use 3 meters which seemed like a good value based on some initial testing.
2019-09-09update READMEtlatorre
2019-09-09update fit to allow t0 to be negativetlatorre
2019-09-09fix a gcc warningtlatorre
2019-09-09update is_slot_early() to hopefully catch more flasherstlatorre
This commit updates is_slot_early() to do the following: - use median time when checking to see if the time of the PMT hits in the slot is early relative to nearby PMTs - return True if the number of nearby PMTs is less than or equal to the number of hit PMTs in the potential flasher slot - skip potential cross talk hits when finding the nearby hit PMTs by skipping hits in the adjacent slots with the same paddle card as the potential flasher
2019-09-09add a first draft of a data cleaning cut to detect breakdown eventstlatorre
2019-09-09add math header file to zdab_utils.c for fmin() and fmax()tlatorre
2019-09-09update get_event() to use the PMT types from the snoman.ratdb filetlatorre
This commit updates get_event() to assume the PMT type is correct in the pmt.txt file instead of assuming the SNOMAN bank is correct. The reason for this is that according to the email from Stan 3/15/9 should be a neck PMT (at least in the NCD phase) and that is what the pmt.txt file says it should be. In addition, the changes that Stan said were needed in ccc_type.for never got made.
2019-09-09use EHS instead of QHS in is_muon()tlatorre
This commit updates is_muon() to use the EHS charge for the OWL tubes since based on looking at the charges for the OWL tubes it looks like the QHS values are completely random.
2019-09-09lower QLX threshold from 4000 -> 1000 in is_flashertlatorre
2019-09-09reset the PMT_FLAG_CHARGE bit in get_event()tlatorre
2019-09-09update fit and zdab-cat to skip ZDAB recordstlatorre
2019-09-09add the --gtid command line option to zdab-cattlatorre
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-29update TODOtlatorre
2019-08-29add itc cut to plot-energytlatorre
2019-08-28update README to add zlib dependencytlatorre
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-28update cat-grid-jobstlatorre
This commit updates cat-grid-jobs to only warn once about a mismatch between the SHA1 of the current zdab-cat program and the grid results, and also cleans up some of the output.
2019-08-28update submit-grid-jobs to use my version of splitexttlatorre
This commit updates the submit-grid-jobs script to use my version of splitext() which removes the full extension from the filename. This fixes an issue where the output HDF5 files had xzdab in the name whenever the input file had the file extension .xzdab.gz.
2019-08-28unwrap the 50 MHz clock in plot-energytlatorre
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-27add a script to reprocess SNO zdabstlatorre
2019-08-26update TODOtlatorre
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.