Don't include inactive PMTs in S1 pattern fit #663
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The S1 pattern fit calculation currently doesn't account for inactive PMTs when comparing the observed pattern to the MC map. This means the pattern fit values are unnecessarily bad, and the power of S1 pattern fit cut is much reduced.
This fixes the bug. I checked using a simulated 1400 PE S1 from an interaction at (x=0, y=0, z=-50):
At low-energy the effects might be a bit less dramatic, since the S1 hitpatterns are far more stochastic.
As an 'interesting' side effect, this currently changes @sanderbreur's hitpattern-based "saturation" correction (which is unused at the moment) to also fill in the area of dead PMTs using the MC LCE map. Thus the S1 light yield map should be more uniform after applying the correction: would be interesting to check if this is true once we remake the S1 LCE map. Still, we probably don't want this: it means you can't use the saturation correction alongside the current S1 spatial correction. This can be easily fixed, but my mind has stopped working and just fixing this bug is more important.
Thanks to @coderdj for spotting the problem.