Implement Pyrrha functionalities in Irene#953
Open
Ian0sborne wants to merge 63 commits into
Open
Conversation
Done for backwards compatibility, this function now mirrors that of `calibrate_sipms()` before thresholding was removed.
This is the main controlling function, that decides which type of cut will be applied.
This included the adjustment of the cuts, applying `select_wfs_above_time_integrated_thr()` and the zeroing integration cut before the waveform rebinning.
This is to avoid possible situations where `calibrate_sipms()` is used outwith irene. `thr` is now a keyword argument to ensure that if a threshold is applied it is done so with intent.
Initially this was done over the entire waveforms due to the reordering of the cuts when applied in `build_sipm_responses()`. As suggested by @Ian0sborne, it would be wise to move these cuts out of `compute_and_write_pmaps()`
…ection`) into `pyrrha_sipm_selection`
…iPMs and their waveforms
…eshold outside of `charge_threshold_method()`
…_wfs_below_threshold()` for zeroing waveform entries
Ian0sborne
commented
May 11, 2026
gonzaponte
requested changes
Jun 4, 2026
gonzaponte
left a comment
Collaborator
There was a problem hiding this comment.
I will take a deeper look, but here is a first go.
Comment on lines
1217
to
+1277
|
|
||
|
|
||
| def waveform_integrator(limits): | ||
| def integrate_wfs(wfs): | ||
| return cf.spaced_integrals(wfs, limits)[:, ::2] | ||
| return integrate_wfs | ||
|
|
||
|
|
||
| # Compound components | ||
| def compute_and_write_pmaps(detector_db, run_number, pmt_samp_wid, sipm_samp_wid, | ||
| s1_lmax, s1_lmin, s1_rebin_stride, s1_stride, s1_tmax, s1_tmin, | ||
| s2_lmax, s2_lmin, s2_rebin_stride, s2_stride, s2_tmax, s2_tmin, thr_sipm_s2, | ||
| h5out, sipm_rwf_to_cal=None): | ||
| h5out, apply_cut, sipm_rwf_to_cal=None): |
Collaborator
There was a problem hiding this comment.
I think we need a better name for apply_cut. Think of something along the lines of "sipm selection algorithm"
Contributor
Author
There was a problem hiding this comment.
I agree, I'll do sipm_selection_algo, but I will change it last so there's no back and forth
gonzaponte
requested changes
Jun 23, 2026
gonzaponte
left a comment
Collaborator
There was a problem hiding this comment.
A few more comments. I still need to check a few things, but at least you can make some progress while I do that.
454d3c4 to
4b108f8
Compare
50398e0 to
7c42a53
Compare
gonzaponte
reviewed
Jul 14, 2026
gonzaponte
left a comment
Collaborator
There was a problem hiding this comment.
I'm happy with this. As discussed, let's rebase and fix the problems that may arise there. After that, some cosmetics and we are done!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the data processing issues cause by the SiPM thresholds in Irene. It retains standard Irene functionalities but also implements the new Pyrrha selection methods for SiPMs, which relies on a spatial selection rather than a charge threshold.
The user is free to decide how they would rather process the raw waveforms (using the old Irene or Pyrrha), as the config file allows for either method to be selected.