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

Fix hitlet splitting #549

Merged
merged 10 commits into from Oct 12, 2021
Merged

Fix hitlet splitting #549

merged 10 commits into from Oct 12, 2021

Conversation

WenzDaniel
Copy link
Collaborator

@WenzDaniel WenzDaniel commented Oct 11, 2021

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

ValueError: Want to add a new zero-length peak after splitting!

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.

  • b74eae4 fixes this issue
  • d3c47a4 adds some corresponding tests
  • The rest is some refactoring.

example

The impact on the data should be minor, however a reprocessing of hitlets_nv/mv will be needed.

@WenzDaniel
Copy link
Collaborator Author

See also XENONnT/straxen#690

Copy link
Member

@JoranAngevaare JoranAngevaare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel

@JoranAngevaare JoranAngevaare merged commit 796fa13 into master Oct 12, 2021
@JoranAngevaare JoranAngevaare deleted the fix_hitlet_splitting branch October 12, 2021 15:18
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.

None yet

2 participants