Skip to content
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

Replace scintillation time clipping by truncation #220

Merged
merged 6 commits into from
May 24, 2024

Conversation

HenningSE
Copy link
Collaborator

@HenningSE HenningSE commented May 15, 2024

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

This PR will replace the s1 photon timing clipping by truncation.

Can you briefly describe how it works?

Right now we are clipping the sampled S1 photon scintillation times in the S1PhotonPropagation plugin to the maximum value of maximum_recombination_time. To minimize the effect on the S1 waveform, this PR replaces the clipping by a truncation of the timing distribution at he same maximum_recombination_time. Two safety measures are added to make sure that we always have enough photon times to sample from. As a bonus the S1PhotonPropagation.photon_timings function was cleaned up and the scintillation timing part moved to a dedicated function.

Please include the following if applicable:

  • Bump plugin version(s)
  • Tests to check the (new) code is working as desired.

@coveralls
Copy link

coveralls commented May 16, 2024

Pull Request Test Coverage Report for Build 9193566598

Details

  • 20 of 21 (95.24%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 78.07%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/detector_physics/s1_photon_propagation.py 20 21 95.24%
Totals Coverage Status
Change from base Build 9139577908: 0.06%
Covered Lines: 2314
Relevant Lines: 2964

💛 - Coveralls

@HenningSE HenningSE marked this pull request as ready for review May 16, 2024 06:30
@HenningSE HenningSE requested a review from ramirezdiego May 16, 2024 06:30
@HenningSE HenningSE marked this pull request as draft May 16, 2024 13:01
@HenningSE
Copy link
Collaborator Author

A note discussing the proposed changes can be found here.

@HenningSE HenningSE marked this pull request as ready for review May 17, 2024 12:55
Copy link
Collaborator

@ramirezdiego ramirezdiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Like previously discussed, I prefer this re-iterative loop than assigning times for many more photons than needed, based on a safety factor. Is there a speed improvement this way?

@ramirezdiego ramirezdiego changed the title Replace clipping by truncation and refactor function Replace scintillation time clipping by truncation May 17, 2024
@HenningSE
Copy link
Collaborator Author

Hi @ramirezdiego, I think there is a slight performance increase using the code in this PR compared to the main branch. I did not run detailed performance tests but for the simulations done in the note above the raw records simulation time decreased by about 10%. Maybe this is not relevant to the overall simulation time when S2s are also included.

@ramirezdiego
Copy link
Collaborator

Thanks, I was actually just curious about the improved speed with respect to the previous approach in this PR.

@ramirezdiego ramirezdiego merged commit e987093 into main May 24, 2024
4 checks passed
@ramirezdiego ramirezdiego deleted the no_s1_photon_time_clipping branch May 24, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants