XENONnT / straxen

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

Find time difference and properties of nearest triggering peaks #1301

Closed dachengx closed 8 months ago

dachengx commented 9 months ago

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

Add a plugin to find the nearest triggering peaks. "triggering" is defined the same as the Events plugin.

The plugin is required by study https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:xenonnt:ar37_l_shell_sensi:ac_validation, which is further required by https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:xenonnt:ar37_l_shell_sensi.

Can you briefly describe how it works?

First look for all triggering peaks, then find the groups of triggering peaks for each peak within a two-side window defined by shadow_time_window_backward. Then calculate the time difference of the nearest triggering peak to the left and right the each peak. If not found, assign shadow_time_window_backward to the time difference.

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 9 months ago

Coverage Status

coverage: 92.841% (+0.09%) from 92.753% when pulling 64704b42c7ad867589bf92b2adf1c03c7c280cf2 on nearest_triggering into 4c00a9a319983ec0f5e3dba03cf6a43a8fb1db4a on master.

dachengx commented 8 months ago

Hi Dacheng, everything looks good to me! Would you like me to simulate some waveforms to test these plugins? If you think it's necessary, I can do that.

Just to summarize these plugins to make sure we're on the same page:

  • _is_triggering is moved from some statements in the compute function of Events into a separate function
  • PeakNearestTriggering does exactly what you said in your original description
  • EventNearestTriggering copies the information from peak_nearest_triggering over for the main S1 and S2 for each event

If I am understanding this correctly then I will approve.

Thank you @JYangQi00 ! The plugin is validated in the study linked above so not need to WFSim. And yes your understandings are all correct.

JYangQi00 commented 8 months ago

Hi Dacheng, everything looks good to me! Would you like me to simulate some waveforms to test these plugins? If you think it's necessary, I can do that. Just to summarize these plugins to make sure we're on the same page:

  • _is_triggering is moved from some statements in the compute function of Events into a separate function
  • PeakNearestTriggering does exactly what you said in your original description
  • EventNearestTriggering copies the information from peak_nearest_triggering over for the main S1 and S2 for each event

If I am understanding this correctly then I will approve.

Thank you @JYangQi00 ! The plugin is validated in the study linked above so not need to WFSim. And yes your understandings are all correct.

Great!