Skip to content

Implement Pyrrha functionalities in Irene#953

Open
Ian0sborne wants to merge 63 commits into
next-exp:masterfrom
Ian0sborne:implement_pyrrha
Open

Implement Pyrrha functionalities in Irene#953
Ian0sborne wants to merge 63 commits into
next-exp:masterfrom
Ian0sborne:implement_pyrrha

Conversation

@Ian0sborne

Copy link
Copy Markdown
Contributor

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.

Ian0sborne and others added 30 commits February 25, 2026 16:27
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()`
Comment thread invisible_cities/calib/calib_sensors_functions.py Outdated

@gonzaponte gonzaponte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I will take a deeper look, but here is a first go.

Comment thread invisible_cities/calib/calib_sensors_functions.py Outdated
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):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we need a better name for apply_cut. Think of something along the lines of "sipm selection algorithm"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, I'll do sipm_selection_algo, but I will change it last so there's no back and forth

Comment thread invisible_cities/reco/peak_functions.py Outdated
Comment thread invisible_cities/reco/peak_functions_test.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py

@gonzaponte gonzaponte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few more comments. I still need to check a few things, but at least you can make some progress while I do that.

Comment thread invisible_cities/cities/components.py Outdated
Comment thread invisible_cities/cities/components.py Outdated
Comment thread invisible_cities/cities/components.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py Outdated
Comment thread invisible_cities/reco/wfm_functions.py

@gonzaponte gonzaponte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

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