Skip to content

Commit a4327f7

Browse files
committed
3-tel
1 parent 46098e2 commit a4327f7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

python/applyXGBoostforDirection.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,21 @@ def filter_by_telescope_selection(df, selected_indices):
8080
_logger.info(f"Filtering events for telescope selection: {selected_indices}")
8181

8282
def has_selected_telescopes(tel_list):
83-
"""Check if event has all selected telescopes or has 4 telescopes."""
83+
"""
84+
Allow events that:
85+
- have 4 telescopes (always allowed), OR
86+
- contain at least two of the user-selected telescopes.
87+
88+
This enables subsets of the selected telescopes, e.g., for
89+
selected_indices [1,2,4], events with [1,2], [1,4], [2,4], or [1,2,4]
90+
are all accepted.
91+
"""
8492
tel_set = set(tel_list)
85-
has_all_selected = all(idx in tel_set for idx in selected_indices)
8693
has_four_telescopes = len(tel_list) == 4
87-
return has_all_selected or has_four_telescopes
94+
# Count how many of the selected telescopes are present in this event
95+
n_selected_present = sum(1 for idx in selected_indices if idx in tel_set)
96+
allow_subset = n_selected_present >= 2
97+
return has_four_telescopes or allow_subset
8898

8999
mask = df["DispTelList_T"].apply(has_selected_telescopes)
90100

0 commit comments

Comments
 (0)