From 5db7d44fad69a2bda0bd6e14e2169e9e13d6701b Mon Sep 17 00:00:00 2001 From: Tadej Novak <tadej.novak@cern.ch> Date: Fri, 12 Apr 2024 08:33:32 +0200 Subject: [PATCH] CP algs: Make mapUserName a static method of ContainerConfig --- .../python/ConfigAccumulator.py | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/ConfigAccumulator.py b/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/ConfigAccumulator.py index b547976c6727..f10770db9aea 100644 --- a/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/ConfigAccumulator.py +++ b/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/ConfigAccumulator.py @@ -4,17 +4,6 @@ import AnaAlgorithm.DualUseConfig as DualUseConfig from AthenaConfiguration.Enums import LHCPeriod, FlagEnum import re - -def mapUserName (name, *, noSysSuffix) : - """map an internal name to a name for systematics data handles - - Right now this just means appending a _%SYS% to the name.""" - if not noSysSuffix : - return name + "_%SYS%" - else : - return name - - class DataType(FlagEnum): """holds the various data types as an enum""" Data = 'data' @@ -79,9 +68,18 @@ class ContainerConfig : raise Exception ("should not get here, reading container name before created: " + self.name) return self.sourceName if self.maxIndex and self.index == self.maxIndex : - return mapUserName(self.name, noSysSuffix = self.noSysSuffix) - return mapUserName(self.name + "_STEP" + str(self.index), noSysSuffix = self.noSysSuffix) + return self.systematicsName(self.name, noSysSuffix=self.noSysSuffix) + return self.systematicsName(f"{self.name}_STEP{self.index}", noSysSuffix=self.noSysSuffix) + + @staticmethod + def systematicsName (name, *, noSysSuffix) : + """map an internal name to a name for systematics data handles + Right now this just means appending a _%SYS% to the name.""" + if not noSysSuffix : + return name + "_%SYS%" + else : + return name def nextPass (self) : self.maxIndex = self.index -- GitLab