From b7d61bdcdc6954dc55cca2a400f59392db57f33b Mon Sep 17 00:00:00 2001 From: sesen Date: Wed, 14 Sep 2022 23:35:32 +0200 Subject: [PATCH 1/2] fix relation unpacking --- .../python/DaVinciMCTools/MCReconstructed.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py b/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py index 0d7f61357..8f5da3640 100644 --- a/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py +++ b/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py @@ -65,13 +65,17 @@ class MCReconstructed: f"The specified 'process' {process} is not recognised. Can only be 'Hlt2' or 'Spruce' or 'Turbo'. Please check!" ) - if root_in_tes: - relations_locs = [ - f'{root_in_tes}/{table_loc}' for table_loc in relations_locs - ] - ChargedPP2MCP = force_location(relations_locs[0]) - NeutralPP2MCP = force_location(relations_locs[1]) - + if isinstance(relations_locs[0], str): + if root_in_tes: + relations_locs = [ + f'{root_in_tes}/{table_loc}' for table_loc in relations_locs + ] + ChargedPP2MCP = force_location(relations_locs[0]) + NeutralPP2MCP = force_location(relations_locs[1]) + else: + ChargedPP2MCP = relations_locs[0] + NeutralPP2MCP = relations_locs[1] + # Save setup self.use_best_mcmatch = use_best_mcmatch -- GitLab From 4dced71885495f9a715f5936ad5f3b751c102bc5 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Fri, 16 Sep 2022 13:22:46 +0000 Subject: [PATCH 2/2] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Analysis/-/jobs/24594525 --- .../python/DaVinciMCTools/MCReconstructed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py b/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py index 8f5da3640..0bcc30afb 100644 --- a/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py +++ b/Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py @@ -68,14 +68,15 @@ class MCReconstructed: if isinstance(relations_locs[0], str): if root_in_tes: relations_locs = [ - f'{root_in_tes}/{table_loc}' for table_loc in relations_locs - ] + f'{root_in_tes}/{table_loc}' + for table_loc in relations_locs + ] ChargedPP2MCP = force_location(relations_locs[0]) NeutralPP2MCP = force_location(relations_locs[1]) else: ChargedPP2MCP = relations_locs[0] NeutralPP2MCP = relations_locs[1] - + # Save setup self.use_best_mcmatch = use_best_mcmatch -- GitLab