XENONnT / straxen

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

Dynamic led window #1401

Closed tflehmke closed 2 months ago

tflehmke commented 3 months ago

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

This PR implements a dnyamic window for the LED pulse integration in the afterpulse_processing and led_calibration plugins.

Can you briefly describe how it works?

It uses the straxen hit finder to find the first hit inside a fixed, wider window in the record. In the afterpulse plugin, all hits around this hit inside the LED_window_width are then integrated to give the full LED hit. In led calibration plugin, the samples around the first hit given by led_hit_extension are integrated and the maximum is taken from this area.

Please include the following if applicable:

coveralls commented 3 months ago

Coverage Status

coverage: 90.865% (-0.3%) from 91.138% when pulling 0e2cd92c1951ab844ae33c91836ace14a0850419 on dynamic_led_window into 1dd8e3eed13e4b62bbc030df5d800f216e7ef83b on master.

yuema137 commented 2 months ago

Hi @tflehmke Many thanks to this very low-level PR! I went through the two updated files and think they are mostly good. The only possible functional problem that I found is that:

I also have some other minor suggestions for naming/comments/changing hard-coded numbers to URLConfigs, please see the single comments for details.

For the speed and memory I'm not really worried, as the calculation of dynamic windows is still O(N), and the size of the dynamic window is much smaller than the hits themselves. But it will still be great if you could provide me an example dataset so that I can test the performance.