WIP: Add noise to list-mode data #64
Open
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 adds new features:
I am not entirely happy about the current solution because I think
pctpairprotonsis now doing too many things at once. However, I had to put the code here to access the intermediate values (energy or TOF) before converting them to WEPL. I suggest the following future solution: splitpctpairprotonsinto three applications, one that would pair the protons, one that would add noise to the data and one that would convert the energy-loss or the TOF to WEPL. This would lead to cleaner and shorter application code, and more flexibility when defining data processing pipelines using PCT. However, for the time being, I think we can keep adding features topctpairprotonsand split it later on.I also have a question: how to deal with values that obviously don't make sense after noise is applied? I am thinking about i.e. protons that have more energy in the downstream detector than in the upstream (which could happen with a real detector with poor energy resolution), or positions that are outside of the detector. The current code leaves all responsibility to the user, but perhaps there is a better way?
If you agree with the current state of the code, I'll add some documentation before merging (hence the WIP).
(Sorry for the long message!)