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
Fix hitlet splitting #549
Merged
Merged
Fix hitlet splitting #549
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See also XENONnT/straxen#690 |
JoranAngevaare
approved these changes
Oct 11, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Daniel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the problem / what does the code in this PR do
In this PR we are adding a small fix and test for a bug found during processing.
The bug itself manifested itself as
while the actual problem was within
strax.get_hitlet_data()
. So here is what happened, lets start with how the algorithm is suppose to work:During the building of hitlets we join overlapping hits into hitlets and extend those according to the left/right hit extension. This hit rextension may reach into none-recorded regions outside of our recorded data. Therefore, in the next step
get_hitlet_data
loops over all records and hitlets and chops all hitlets according to the recorded regions before adding the data information to hitlets.Here is why things went south:
In chunk 57 of run 029728 we had a hitlet for which the chopping of the none recorded regions did not work (purple hitlet in channel 1. Paired with a 4 sigma downward fluctuation of the baseline lead to a hitlet which was complete outside of any recorded region which led to a zero-length hitlet during splitting (purple dashed part).
The chopping failed because before chopping, get_hitlet_data searchs channel independent for all records which overlap with the corresponding hitlet. In a second step all records which channel does not match the one of the hitlet are discared. However, it was not considered that this may also lead to the case shown below for which the first record of the hitlets channel does not overlap with the hitlet. This leads to a wrong chopping.
The impact on the data should be minor, however a reprocessing of hitlets_nv/mv will be needed.