Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add record amplitude bit shift #260

Merged
merged 1 commit into from Apr 28, 2020
Merged

Add record amplitude bit shift #260

merged 1 commit into from Apr 28, 2020

Conversation

JelleAalbers
Copy link
Member

This adds the field amplitude_bit_shift to records, as introduced by @zhut19 in XENONnT/straxen#38. This will help make desaturation corrections possible, e.g. based on pulse shape as in XENON1T or using the attenuated / high-energy channels (@ariannarocchetti @petergaemers).

Setting this field means the amplitude the data should be multiplied by 2**amplitude_bit_shift before it is used. Currently, desaturation corrections cannot store amplitudes above 2**15 -1, since strax uses signed 16-bit integers (np.int16) to represent waveforms. After this, a correction function could set amplitude_bit_shift = 1 (or 2, 3, etc) and divide the whole waveform by 2 (or 4, 8, etc), so it can store higher amplitudes while staying within the allowed integer range. Of course this loses some precision, but for a giant waveform that seems acceptable.

I went through the pulse processing / integration routines to change them were needed, but it would be great if someone could check if I did it correctly or missed some function. Even better would be to test this of course.

The baseline field is assumed to be left unaffected by the multiplier. Thus, we do not use the multiplier when correcting integrals for the non-integer part of the baseline (see #2).

This also implements Tianyu's proposed fix in #256 for the saturated channel counting. The saturation check takes into account the multiplier, so a channel will still be flagged as saturated even after a desaturation correction is run on it.

@JelleAalbers JelleAalbers merged commit 70da1c5 into master Apr 28, 2020
@JelleAalbers JelleAalbers deleted the record_multiplier branch April 28, 2020 11:49
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.

None yet

1 participant