Implement Pyrrha functionalities in Irene#953
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
…SiPMSelectionMethod class
…for incorrect input
fb435dd to
b7f45d4
Compare
| 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) |
There was a problem hiding this comment.
Even though this is not used in the code, this is needed for 4 tests in calib_sensor_functions_test.py.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
…eshold outside of `charge_threshold_method()`
…_wfs_below_threshold()` for zeroing waveform entries
| 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 |
There was a problem hiding this comment.
This name may be misleading now after the change, however I'm reluctant to change it in case it breaks other things (maybe configs?)
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.