Skip to content

Commit 19b240f

Browse files
authored
[EventFiltering] Add protection for input data (#2753)
* Add protection for input data
1 parent a853a5f commit 19b240f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

EventFiltering/PWGHF/Macros/train_hf_triggers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_list_input_files(indirs, channel):
6666

6767
if channel not in ["D0ToKPi", "DplusToPiKPi", "DsToKKPi", "LcToPKPi", "XicToPKPi"]:
6868
print(f"ERROR: channel {channel} not implemented, return None")
69-
return None, None, None
69+
return {"Prompt": None, "Nonprompt": None, "Bkg": None}
7070

7171
file_lists = {}
7272
for cand_type in indirs: # pylint: disable=too-many-nested-blocks
@@ -115,6 +115,9 @@ def data_prep(config):
115115
os.mkdir(out_dir)
116116

117117
file_lists = get_list_input_files(input_dirs, channel)
118+
for file_list in file_lists:
119+
if file_list is None:
120+
sys.exit()
118121

119122
hdl_prompt = TreeHandler(file_lists["Prompt"])
120123
hdl_nonprompt = TreeHandler(file_lists["Nonprompt"])

0 commit comments

Comments
 (0)