From 27e8944245ee6596da18bedfa0219098c579a052 Mon Sep 17 00:00:00 2001 From: nshadskiy Date: Sun, 11 Aug 2024 22:03:00 +0200 Subject: [PATCH] fix the unwanted rerun of friend dependencies --- processor/tasks/CROWNMultiFriends.py | 4 +++- processor/tasks/FriendQuantitiesMap.py | 10 +++++++--- processor/tasks/ProduceFriends.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/processor/tasks/CROWNMultiFriends.py b/processor/tasks/CROWNMultiFriends.py index 21e36ad0..8d52766d 100644 --- a/processor/tasks/CROWNMultiFriends.py +++ b/processor/tasks/CROWNMultiFriends.py @@ -74,7 +74,9 @@ def create_branch_map(self): if inputfile.path.endswith(".root") ] friend_inputs = [ - self.input()[f"CROWNFriends_{self.nick}_{friend}"]["collection"] + self.input()[f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}"][ + "collection" + ] for friend in self.friend_dependencies # type: ignore ] friend_branches = [ diff --git a/processor/tasks/FriendQuantitiesMap.py b/processor/tasks/FriendQuantitiesMap.py index 8188a466..bee0e09b 100644 --- a/processor/tasks/FriendQuantitiesMap.py +++ b/processor/tasks/FriendQuantitiesMap.py @@ -65,7 +65,9 @@ def requires(self): scopes=self.scopes, ) for friend in self.friend_dependencies: - requirements[f"CROWNFriends_{friend}"] = CROWNFriends( + requirements[ + f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}" + ] = CROWNFriends( nick=self.nick, analysis=self.analysis, config=self.config, @@ -75,7 +77,7 @@ def requires(self): era=self.era, sample_type=self.sample_type, scopes=self.scopes, - friend_name=friend, + friend_name=self.friend_mapping[friend], friend_config=friend, ) return requirements @@ -117,7 +119,9 @@ def run(self): # add all friend files to the inputfiles list for friend in self.friend_dependencies: inputfiles.extend( - self.input()[f"CROWNFriends_{friend}"][sample]._flat_target_list + self.input()[ + f"CROWNFriends_{self.nick}_{self.friend_mapping[friend]}" + ][sample]._flat_target_list ) for inputfile in inputfiles: if inputfile.path.endswith("quantities_map.json"): diff --git a/processor/tasks/ProduceFriends.py b/processor/tasks/ProduceFriends.py index 95bb2894..df2593d0 100644 --- a/processor/tasks/ProduceFriends.py +++ b/processor/tasks/ProduceFriends.py @@ -25,7 +25,7 @@ def requires(self): console.log(f"Config: {self.config}") console.log(f"Shifts: {self.shifts}") console.log(f"Scopes: {self.scopes}") - console.log(f"Slient: {self.silent}") + console.log(f"Silent: {self.silent}") console.rule("") data = self.set_sample_data(self.parse_samplelist(self.sample_list))