XENONnT / straxen

Streaming analysis for XENON
BSD 3-Clause "New" or "Revised" License
20 stars 32 forks source link

Debug for `EventwBayesClass` because peaks overlapping #1417

Closed dachengx closed 2 months ago

dachengx commented 2 months ago

Before you submit this PR: make sure to put all operations-related information in a wiki-note, a PR should be about code and is publicly accessible

What does the code in this PR do / what does it improve?

Debug EventwBayesClass. In very rare cases the peaks' "time" can be the same, so simply use the matching between time https://github.com/XENONnT/straxen/blob/c61848018f2fd49504e6d3b50de1343ecfb056b0/straxen/plugins/events/event_w_bayes_class.py#L29-L30 can cause error like:

CRITICAL:ThreadedMailboxProcessor:Target Mailbox (event_w_bayes_class_paired) killed, exception <class 'strax.mailbox.MailboxKilled'>, message (<class 'ValueError'>, ValueError('NumPy boolean array indexing assignment cannot assign 48003 input values to the 47986 output values where the mask is true'), <traceback object at 0x7f62537a4e00>)

Can you briefly describe how it works?

Mimicking what EventAmbience does, split the peaks for each event and assign the fields based on indices: https://github.com/XENONnT/straxen/blob/c61848018f2fd49504e6d3b50de1343ecfb056b0/straxen/plugins/events/event_ambience.py#L42-L57.

The results are not changed so I will not update the __version__.

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

Notes on testing

All italic comments can be removed from this template.

dachengx commented 2 months ago

However, this plugin is not widely used.

WenzDaniel commented 2 months ago

I am wondering whether we should not remove this plugin. Is it still being maintained? I do not think so.

dachengx commented 2 months ago

I am wondering whether we should not remove this plugin. Is it still being maintained? I do not think so.

For the reproducibility of old results, we still need it. I think we can keep it for a while.

WenzDaniel commented 2 months ago

Old results use old container no? Otherwise it is not reproducible anyhow?

dachengx commented 2 months ago

Old results use old container no? Otherwise it is not reproducible anyhow?

Yes. You are right. I mean the reproducibility of the codes in other repo which still uses this plugin.

coveralls commented 2 months ago

Coverage Status

Changes unknown when pulling 166c64c8fdc903fa6aef4c1897653b0fdd943413 on debug_event_w_bayes_class into on master.