Skip to content

Implement Pyrrha functionalities in Irene#953

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

Implement Pyrrha functionalities in Irene#953
Ian0sborne wants to merge 49 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 on lines +145 to +150
if thr is None:
return cwfs
else:
# if you apply a threshold here, apply as usual
thr = to_col_vector(np.full(sipm_wfs.shape[0], thr))
return np.where(cwfs > thr, cwfs, 0)
Copy link
Copy Markdown
Contributor Author

@Ian0sborne Ian0sborne May 7, 2026

Choose a reason for hiding this comment

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

Even though this is not used in the code, this is needed for 4 tests in calib_sensor_functions_test.py.

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.

Add another function that does the thresholds suppression, redo those tests doing the threshold suppression outside calibrate_sipms, and finally remove the else branch here

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.

The function charge_threshold_method() in reco/wfm_functions.py does the zero suppression step. Should I make a function that does just that? If I do this, do I remove the test that rely on zero suppression from calib_sensor_functions_test.py and implement them specifically for this new function?

SiPMCalibMode.subtract_mode_calibrate : sipm_subtract_mode_and_calibrate ,# For PDF calculation
SiPMCalibMode.subtract_mean_calibrate : sipm_subtract_mean_and_calibrate ,# For PDF calculation
SiPMCalibMode.subtract_median_calibrate: sipm_subtract_median_and_calibrate,# For PDF calculation
SiPMCalibMode.subtract_mode_zs : calibrate_sipms # For data processing
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.

This name may be misleading now after the change, however I'm reluctant to change it in case it breaks other things (maybe configs?)

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