From 9afe61dafd579a0631bf4088f2382e2043caa5bd Mon Sep 17 00:00:00 2001 From: Daniel Guderian <dguderian@km3net.de> Date: Thu, 8 Apr 2021 12:49:45 +0200 Subject: [PATCH] that should only apply to the case when there is actually a std reco^^ --- orcasong/extractors.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/orcasong/extractors.py b/orcasong/extractors.py index f992996..ca163e1 100644 --- a/orcasong/extractors.py +++ b/orcasong/extractors.py @@ -127,9 +127,10 @@ def get_real_data_info_extr(input_file): f = File(input_file, "r") has_std_reco = "reco" in f.keys() - #also check, which rec types are present - rec_types,rec_parameters_names = get_rec_types_in_file(f) - + if has_std_reco: + #also check, which rec types are present + rec_types,rec_parameters_names = get_rec_types_in_file(f) + def mc_info_extr(blob): """ @@ -195,8 +196,9 @@ def get_random_noise_mc_info_extr(input_file): f = File(input_file, "r") has_std_reco = "reco" in f.keys() - #also check, which rec types are present - rec_types,rec_parameters_names = get_rec_types_in_file(f) + if has_std_reco: + #also check, which rec types are present + rec_types,rec_parameters_names = get_rec_types_in_file(f) def mc_info_extr(blob): @@ -259,8 +261,9 @@ def get_neutrino_mc_info_extr(input_file): f = File(input_file, "r") has_std_reco = "reco" in f.keys() - #also check, which rec types are present - rec_types,rec_parameters_names = get_rec_types_in_file(f) + if has_std_reco: + #also check, which rec types are present + rec_types,rec_parameters_names = get_rec_types_in_file(f) # get the n_gen header = HDF5Header.from_hdf5(input_file) @@ -407,8 +410,9 @@ def get_muon_mc_info_extr(input_file,prod_identifier=2,inactive_du=None): f = File(input_file, "r") has_std_reco = "reco" in f.keys() - #also check, which rec types are present - rec_types,rec_parameters_names = get_rec_types_in_file(f) + if has_std_reco: + #also check, which rec types are present + rec_types,rec_parameters_names = get_rec_types_in_file(f) # no n_gen here, but needed for concatenation n_gen = 1 -- GitLab