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

Replace z from z_naive to z_dv_corr #1239

Merged
merged 4 commits into from Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions straxen/plugins/events/event_positions.py
Expand Up @@ -19,7 +19,7 @@ class EventPositions(strax.Plugin):

depends_on = ('event_basics',)

__version__ = '0.2.0'
__version__ = '0.2.1'

default_reconstruction_algorithm = straxen.URLConfig(
default=DEFAULT_POSREC_ALGO,
Expand Down Expand Up @@ -57,21 +57,21 @@ def infer_dtype(self):
comment = f'Main interaction {j}-position, field-distortion corrected (cm)'
dtype += [(j, np.float32, comment)]
for s_i in [1, 2]:
comment = f'Alternative S{s_i} interaction (rel. main S{int(2 * (1.5 - s_i) + s_i)}) {j}-position, field-distortion corrected (cm)'
comment = f'Alternative S{s_i} interaction (rel. main S{3 - s_i}) {j}-position, field-distortion corrected (cm)'
field = f'alt_s{s_i}_{j}_fdc'
dtype += [(field, np.float32, comment)]

for j in ['z']:
comment = 'Interaction z-position, using mean drift velocity only (cm)'
comment = 'Interaction z-position, corrected to non-uniform drift velocity (cm)'
dtype += [(j, np.float32, comment)]
comment = 'Interaction z-position corrected to non-uniform drift velocity (cm)'
comment = 'Interaction z-position, corrected to non-uniform drift velocity, duplicated (cm)'
dtype += [(j + "_dv_corr", np.float32, comment)]
for s_i in [1, 2]:
comment = f'Alternative S{s_i} z-position (rel. main S{int(2 * (1.5 - s_i) + s_i)}), using mean drift velocity only (cm)'
comment = f'Alternative S{s_i} z-position (rel. main S{3 - s_i}), corrected to non-uniform drift velocity (cm)'
field = f'alt_s{s_i}_z'
dtype += [(field, np.float32, comment)]
# values for corrected Z position
comment = f'Alternative S{s_i} z-position (rel. main S{[1 if s_i==2 else 2]}), corrected for non-uniform field (cm)'
comment = f'Alternative S{s_i} z-position (rel. main S{3 - s_i}), corrected to non-uniform drift velocity, duplicated (cm)'
field = f'alt_s{s_i}_z_dv_corr'
dtype += [(field, np.float32, comment)]

Expand All @@ -89,15 +89,15 @@ def infer_dtype(self):
naive_pos += [(
f'alt_s{s_i}_{j}_naive',
np.float32,
f'Alternative S{s_i} interaction (rel. main S{int(2 * (1.5 - s_i) + s_i)}) {j}-position with observed position (cm)')]
f'Alternative S{s_i} interaction (rel. main S{3 - s_i}) {j}-position with observed position (cm)')]
fdc_pos += [(f'alt_s{s_i}_{j}_field_distortion_correction',
np.float32,
f'Correction added to alt_s{s_i}_{j}_naive for field distortion (cm)')]
dtype += naive_pos + fdc_pos
for s_i in [1, 2]:
dtype += [(f'alt_s{s_i}_theta',
np.float32,
f'Alternative S{s_i} (rel. main S{int(2 * (1.5 - s_i) + s_i)}) interaction angular position (radians)')]
f'Alternative S{s_i} (rel. main S{3 - s_i}) interaction angular position (radians)')]

dtype += [('theta', np.float32, f'Main interaction angular position (radians)')]
return dtype + strax.time_fields
Expand Down Expand Up @@ -153,9 +153,9 @@ def compute(self, events):
f'{pre_field}r_field_distortion_correction': delta_r,
f'{pre_field}theta': np.arctan2(orig_pos[:, 1], orig_pos[:, 0]),
f'{pre_field}z_naive': z_obs,
# using z_obs in agreement with the dtype description
# using z_dv_corr (z_obs - z_dv_delta) in agreement with the dtype description
dachengx marked this conversation as resolved.
Show resolved Hide resolved
# the FDC for z (z_cor) is found to be not reliable (see #527)
f'{pre_field}z': z_obs,
f'{pre_field}z': z_obs - z_dv_delta,
f'{pre_field}z_field_distortion_correction': delta_z,
f'{pre_field}z_dv_corr': z_obs - z_dv_delta,
})
Expand Down