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

Simplify shadow_reference_selection #72

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions axidence/plugins/pairing/peaks_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class PeaksPaired(ExhaustPlugin, DownChunkingPlugin):
"isolated_s2",
"peaks_salted",
"peak_shadow_salted",
"event_basics_salted",
"event_shadow_salted",
"cut_main_s2_trigger_salted",
)
provides = ("peaks_paired", "truth_paired")
data_kind = immutabledict(zip(provides, provides))
Expand Down Expand Up @@ -240,7 +237,7 @@ def get_paring_rate_correction(self, peaks_salted):
# main S1 of event-level salting might be contaminated
return 1

def shadow_reference_selection(self, peaks_salted, events_salted, s2):
def shadow_reference_selection(self, peaks_salted):
"""Select the reference events for shadow matching, also return
weights."""

Expand Down Expand Up @@ -587,7 +584,7 @@ def build_arrays(

return peaks_arrays, truth_arrays

def compute(self, run_meta, isolated_s1, isolated_s2, peaks_salted, events_salted, start, end):
def compute(self, run_meta, isolated_s1, isolated_s2, peaks_salted, start, end):
isolated_s1 = self.update_group_number(isolated_s1, run_meta)
isolated_s2 = self.update_group_number(isolated_s2, run_meta)
for i, s in enumerate([isolated_s1, isolated_s2]):
Expand Down Expand Up @@ -617,9 +614,7 @@ def compute(self, run_meta, isolated_s1, isolated_s2, peaks_salted, events_salte
if mask.sum() != 0:
if self.apply_shadow_matching:
# simulate drift time bin by bin
shadow_reference, prefix = self.shadow_reference_selection(
peaks_salted, events_salted, main_isolated_s2
)
shadow_reference, prefix = self.shadow_reference_selection(peaks_salted)
truth = self.shadow_matching(
isolated_s1[mask],
main_isolated_s2,
Expand Down
Loading