Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMT timing offsets, new hit timing method, and changes to ClusterFinder to fix charge omission seen for MC Hits #259

Merged
merged 27 commits into from
Aug 5, 2024

Conversation

S81D
Copy link
Contributor

@S81D S81D commented Apr 3, 2024

I apologize for the long commit list, but the following tools have been changed:

  • LoadGeometry: Now reads in .csv file containing the PMT timing offsets derived from the laser source calibration.
  • PhaseIIADCHitFinder: Subtracts timing offsets from hit times. New hit timing method that will take the 50% value of the maximum above threshold as the hit time, not the time tick corresponding to the maximum ADC value (which was therefore always binned to 2ns)
  • ClusterFinder: Fix MC charge omission + first photon effect
  • ClusterClassifier: Change ChargeBalance calulation from 123 active PMTs --> 121 active PMTs (new gains)
  • EventSelector: Fixed an issue where the tool tries to grab PMT channels that are no longer listed as "active" according to the new gains measurements.

In addition, some other changes/additions are included:

  • EventBuilderRaw toolchain that can be used to create processed data files with raw PMT waveforms.
  • PrintADCData toolchain that can be used to analyze PMT raw waveforms, as well as look at auxiliary channel information (BoosterRWM, BoosterRF stored signals)
  • TankPMTTimingOffsets.csv - file containing the offset values from the laser calibration.
  • EventSelectorConfig - Tank/MRD coincidence has to be altered due to the PMT offsets being ~10ns on average.
  • ClusterFinderConfig - narrower default cluster integration window
  • Added an additional PMT to the WCSim mask file to reflect the new gains
  • Added some more detail on LoadGenieEventConfig and LoadWCSimConfig files to help users load in collaboration simulation samples from James
  • Added a README for the EventBuilder toolchain

S81D added 27 commits April 3, 2024 08:18
Narrow cluster window - typical use is 5 hits in 50ns, not 5 hits in 100ns
New timing offsets moved the PMTs "back" by an average of ~10ns. When looking for PMT/MRD coincidence, we this need to adjust this offset value.
With new gains calibration we now have 121 active PMTs instead of 123. Adjust charge balance parameter to reflect the number of active PMTs that could capture light.

In the future, will alter this to read in the channel keys so that it automatically grabs the correct number of active PMTs.
Fixed issues seen with ClusterFinder and the omission of charge for MC Hits:

- Change MC hit time away from 2ns discretization, as the new data hit times are float values.
- As a result, need to change for loop to not just grab integer hit times (old), but also grab float hit times. 
- MC Hits with times < 0 were being ignored due to a variable set to 0. Tool now keeps all hit times, even if they are negative due to time smearing.
- Reduce first-photon effect by modifying how hit timing is assigned for a "pulse"/digit. Followed what the tool DigitBuilder used: median photon hit time as the "pulse" time.

Also,
- In Data, mandate hits need to be > 0 (there is a weird spike at 0 in cluster times that are from this and are likely unphysical)


TODO: Potentially expand the MC "pulse" integration window from 10ns to something larger. Average charge per hit is lower and total number of hits slightly higher in MC than data, indicating the pulse window may be too narrow and is cutting what should be one pulse into two. Need to check with calibration to see what the average pulse window length is for ~SPE pulses.
Same as data - cluster window 50ns, looking for at least 5 hits
Dropped line pointing to an external WCSim channel key ID (not really an issue cause they are the same)
Updated mask to omit additional PMT to reflect new gains data. (PMT 337, aka 6 here, no longer active in data)
Added a small description on where to find collaboration WCSim samples. Also cut down on commented lines
Updated tool config to read in new collaboration samples. Added description to each variable per doc 5230-v2 (LoadGenieEvent Tutorial)
In prep for whenever we have tank reco available
Updated new inactive PMT from the gains calibration
Updated config to include paths to latest collaboration samples
PMT timing offsets derived from Laser calibration data. These offsets should be considered precision software corrections on top of the previous firmware corrections at the ADC level to correct for the large cabling delays.
Updated header file with PMT timing offsets
Path to PMT timing offset .csv file
1. Updated default offset value (745) to 755 to account for new timing offsets of the PMTs.

2. In the new gains file, there are measurements for the 121 active PMTs. Two PMTs were deemed "inactive" and are no longer included. (Old file used to have 123 active PMTs). These PMTs were omitted as no data/hits were recorded on them during the source calibration. In principle there should only be hits in the active PMTs. However, even though there were no data/hits recorded in those tubes for the source calibration, for very energetic events occasionally one of the since "inactived" PMTs registers a hit for some reason and tries to access the map, which crashes this tool. Just added a condition that the channel must exist in the map in order to count that hit.
Adjust LoadGeometry to include new PMT Timing offsets from .csv file, derived from the laser source calibration.
- Grab new PMT timing offset values from .csv file to subtract from the hit times --> added this to all methods of hit finding

- Instead of grabbing the x tick with the maximum ADC value as the hit time (always binned to 2ns), assign float hit times based when the pulse crosses 50% of its maximum above threshold. Currently only implemented for the Pulse Finding Approach "Threshold" and Pulse Window Type "Dynamic" (the default, used configuration of the code). 

TODO: 
- Add this hit timing approach to all configurations of the code. 
- (Maybe) per Bob's recommendation, it might be better to instead assign the hit time using the following:
1. get the time at 50% between peak and threshold
2. get the time at 20% " " " "
3. Draw a straight line between these two points to extrapolate the time to zero threshold
This way it would lessen the effect of time shifts between large and small pulses.
Added offset map to header
Old tool, new toolchain: output raw waveforms of PMT and aux channels from built, processed ANNIEEvents (that contain the raw waveforms). Useful to analyze PMT waveforms, as well as look at aux channel waveforms like the BoosterRWM and BoosterRF.
In case users want to eventbuild part files with raw waveforms (useful for source analysis), this toolchain complements the official event building toolchain that is used to create our processed data. Configurations for the tools to extract raw waveforms successfully from the PMTs are taken from Gian's AmBe analysis work. Currently, the event building for this toolchain has only been tested for Tank + CTC events.
Added README for event building toolchain, with reference to the ANNIE wiki page on how to properly event build.
small syntax fix for EventBuilder README file
Missed a bracket which caused the CI build error
When using the "automatic" method for loading in GENIE files in the LoadGenieEvent, this was causing that tool to crash as it couldn't find the proper path based on the WCSim file name. Removed the to_string function
Removed the charge threshold (> 200 pe) needed to consider tank/MRD coincidence. Given the README states "PMTMRDCoincCut: Flags events that do not have a certain time offset between PMT & MRD cluster" this should include all PMT clusters, and not just some that are over a certain charge threshold. This change in reality likely won't change much, as most muon tracks in the MRD deposit enough light to leave more than 200 pe worth of charge, but per our Slack convo it's probably best to just remove this condition as its not obvious.
@marc1uk marc1uk merged commit 144875a into ANNIEsoft:Application Aug 5, 2024
1 check passed
@S81D S81D deleted the cluster_and_timing branch August 20, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants