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
Find time difference and properties of nearest triggering peaks #1301
Conversation
argsort = np.argsort(peaks["center_time"], kind="mergesort") | ||
_peaks = np.sort(peaks, order="center_time") | ||
result = np.zeros(len(peaks), self.dtype) | ||
_quick_assign(argsort, result, self.compute_triggering(peaks, _peaks)) |
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.
Yes.
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.
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 ofEvents
into a separate functionPeakNearestTriggering
does exactly what you said in your original descriptionEventNearestTriggering
copies the information frompeak_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! |
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, assignshadow_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.