XENONnT / straxen

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

Som plugin #1269

Closed LuisSanchez25 closed 11 months ago

LuisSanchez25 commented 11 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?

Creates a new peaklet classification plugin that uses SOM to refine our current peaklet classification algorithm.

Can you briefly describe how it works?

We first classify the data using out traditional peaklet classification algorithm, then all the data that gets classified as either an S1 or an S2 are passed to the SOM where the new data can be reclassified as type 0, 1 or 2, corresponding to the typical designation of junk, S1 and S2.

We also create a new context xenonnt_som which uses this pluggin instead of the usual peaklet classification plugin.

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.

coveralls commented 11 months ago

Coverage Status

coverage: 92.659% (-1.0%) from 93.643% when pulling d5cf03f7f8bc6a3467e93f5608f2628c9ee8826b on SOM_plugin into 8c70f8f80e20c1bc5c005c784289ad4baf3550f4 on master.

LuisSanchez25 commented 11 months ago

The problem with changing the structure with how you suggested (just importing straxen and using straxen.PeakletClassification for the plugin) is that it creates a circular import error since straxen cant initialize it. This is also part of the reason I removed it from the init.py file since it can just be initialized later by the context, the other reason is that in contexts if you look at line 88, it will register all plugins and since the SOM pluggin also provides peaklet classification I think it will cause problems. I could explicitly state not to fetch that config in the context where its registering everything but I think we probably do not want to hardcode that.

LuisSanchez25 commented 11 months ago

@jmosbacher all test have passed so I think this is ready to merge now

LuisSanchez25 commented 11 months ago

I cant merge the pull request so if you could merge it that would be great!