From fcc2db5f81608e7ad052190d6b24d7990d133e13 Mon Sep 17 00:00:00 2001
From: Oliver Majersky <oliver.majersky@cern.ch>
Date: Thu, 2 May 2024 17:18:53 +0200
Subject: [PATCH] Fix issues when running multiple overlap removal
 configurations in CP algorithms

Fix issues when running multiple overlap removal configurations in CP algorithms
---
 .../python/OverlapAnalysisConfig.py           | 147 ++++++++++--------
 1 file changed, 84 insertions(+), 63 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/OverlapAnalysisConfig.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/OverlapAnalysisConfig.py
index 54c0686b64a4..25cf8ee55054 100644
--- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/OverlapAnalysisConfig.py
+++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/OverlapAnalysisConfig.py
@@ -25,8 +25,6 @@ class OverlapAnalysisConfig (ConfigBlock):
             info="flag to select b-jets with. If left empty, no b-jets are used in the overlap removal. The default is '' (empty string).")
         self.addOption ('boostedLeptons', False, type=bool,
             info="whether to enable boosted lepton overlap removal (toggles on the property UseSlidingDR of the ORUtils::EleJetOverlapTool and ORUtils::MuJetOverlapTool tools). The default is False.")
-        self.addOption ('postfix', '', type=str,
-            info="a postfix to apply to decorations and algorithm names. Typically not needed here.")
         # TODO: add info string
         self.addOption ('nominalOnly', False, type=bool,
             info="")
@@ -111,18 +109,24 @@ class OverlapAnalysisConfig (ConfigBlock):
 
     def makeAlgs (self, config) :
 
-        postfix = self.postfix
-
         if self.addToAllSelections and self.selectionName is not None:
             raise Exception('When addToAllSelections=True, you cannot configure selectionName!')
 
         if self.selectionName is not None:
             selectionName = self.selectionName
+            outputLabel = self.outputLabel + '_' + selectionName
+            inputLabel = self.inputLabel + '_' + selectionName
+            select_or_decoration = 'select_or_' + self.selectionName
+            postfix = '_' + self.selectionName
         else:
             if self.addToAllSelections:
                 selectionName = ""
             else:
                 selectionName = self.outputLabel
+            outputLabel = self.outputLabel
+            inputLabel = self.inputLabel
+            select_or_decoration = 'select_or'
+            postfix = ''
 
         if self.jetsSelectionName is not None:
             jetsSelectionName = self.jetsSelectionName
@@ -166,10 +170,13 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORElectronsSelectAlg' + postfix )
             electrons, alg.preselection = config.readNameAndSelection (self.electrons)
             alg.particles = electrons
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             # if  OR added to all selections, don't need standalone selection flag
             if self.selectionName != '':
-                config.addOutputVar (self.electrons.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.electrons.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
@@ -180,9 +187,12 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORPhotonsSelectAlg' + postfix )
             photons, alg.preselection = config.readNameAndSelection (self.photons)
             alg.particles = photons
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             if self.selectionName != '':
-                config.addOutputVar (self.photons.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.photons.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
@@ -193,9 +203,12 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORMuonsSelectAlg' + postfix )
             muons, alg.preselection = config.readNameAndSelection (self.muons)
             alg.particles = muons
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             if self.selectionName != '':
-                config.addOutputVar (self.muons.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.muons.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
@@ -206,9 +219,12 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORTausSelectAlg' + postfix )
             taus, alg.preselection = config.readNameAndSelection (self.taus)
             alg.particles = taus
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             if self.selectionName != '':
-                config.addOutputVar (self.taus.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.taus.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
@@ -219,9 +235,12 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORJetsSelectAlg' + postfix )
             jets, alg.preselection = config.readNameAndSelection (self.jets)
             alg.particles = jets
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             if self.selectionName != '':
-                config.addOutputVar (self.jets.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.jets.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
@@ -232,47 +251,50 @@ class OverlapAnalysisConfig (ConfigBlock):
             alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORFatJetsSelectAlg' + postfix )
             fatJets, alg.preselection = config.readNameAndSelection (self.fatJets)
             alg.particles = fatJets
-            alg.selectionDecoration = self.inputLabel + ',as_char'
+            alg.selectionDecoration = inputLabel + ',as_char'
             if self.selectionName != '':
-                config.addOutputVar (self.fatJets.split('.')[0], self.outputLabel + '_%SYS%', 'select_or', noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
+                config.addOutputVar (self.fatJets.split('.')[0],
+                                     outputLabel + '_%SYS%',
+                                     select_or_decoration,
+                                     noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
             if self.nominalOnlyUnifiedSelection:
                 alg.preselection = 'unifiedSelectForOR'
 
 
         # Create the overlap removal algorithm:
         alg = config.createAlgorithm( 'CP::OverlapRemovalAlg', 'OverlapRemovalAlg' + postfix )
-        alg.OutputLabel = self.outputLabel
+        alg.OutputLabel = outputLabel
         if self.nominalOnly or self.nominalOnlyUnifiedSelection :
             alg.affectingSystematicsFilter = '.*'
         if electrons :
             alg.electrons = electrons
-            alg.electronsDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.electronsDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.electrons.split('.')[0], electronsSelectionName, alg.electronsDecoration, preselection=False, comesFrom='or')
         if muons :
             alg.muons = muons
-            alg.muonsDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.muonsDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.muons.split('.')[0], muonsSelectionName, alg.muonsDecoration, preselection=False, comesFrom='or')
         if taus :
             alg.taus = taus
-            alg.tausDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.tausDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.taus.split('.')[0], tausSelectionName, alg.tausDecoration, preselection=False, comesFrom='or')
         if jets :
             alg.jets = jets
-            alg.jetsDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.jetsDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.jets.split('.')[0], jetsSelectionName, alg.jetsDecoration, preselection=False, comesFrom='or')
         if photons :
             alg.photons = photons
-            alg.photonsDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.photonsDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.photons.split('.')[0], photonsSelectionName, alg.photonsDecoration, preselection=False, comesFrom='or')
         if fatJets :
             alg.fatJets = fatJets
-            alg.fatJetsDecoration = self.outputLabel + '_%SYS%,as_char'
+            alg.fatJetsDecoration = outputLabel + '_%SYS%,as_char'
             config.addSelection (self.fatJets.split('.')[0], fatJetsSelectionName, alg.fatJetsDecoration, preselection=False, comesFrom='or')
 
         # Create its main tool, and set its basic properties:
         config.addPrivateTool( 'overlapTool', 'ORUtils::OverlapRemovalTool' )
-        alg.overlapTool.InputLabel = self.inputLabel
-        alg.overlapTool.OutputLabel = self.outputLabel
+        alg.overlapTool.InputLabel = inputLabel
+        alg.overlapTool.OutputLabel = outputLabel
 
         # By default the OverlapRemovalTool would flag objects that need to be
         # suppressed, with a "true" value. But since the analysis algorithms expect
@@ -285,8 +307,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if electrons and self.doEleEleOR:
             config.addPrivateTool( 'overlapTool.EleEleORT',
                                    'ORUtils::EleEleOverlapTool' )
-            alg.overlapTool.EleEleORT.InputLabel = self.inputLabel
-            alg.overlapTool.EleEleORT.OutputLabel = self.outputLabel
+            alg.overlapTool.EleEleORT.InputLabel = inputLabel
+            alg.overlapTool.EleEleORT.OutputLabel = outputLabel
             alg.overlapTool.EleEleORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.EleEleORT.OutputPassValue = True
 
@@ -294,8 +316,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if electrons and muons and self.doEleMuOR:
             config.addPrivateTool( 'overlapTool.EleMuORT',
                                    'ORUtils::EleMuSharedTrkOverlapTool' )
-            alg.overlapTool.EleMuORT.InputLabel = self.inputLabel
-            alg.overlapTool.EleMuORT.OutputLabel = self.outputLabel
+            alg.overlapTool.EleMuORT.InputLabel = inputLabel
+            alg.overlapTool.EleMuORT.OutputLabel = outputLabel
             alg.overlapTool.EleMuORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.EleMuORT.OutputPassValue = True
 
@@ -303,8 +325,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if electrons and jets and self.doEleJetOR:
             config.addPrivateTool( 'overlapTool.EleJetORT',
                                    'ORUtils::EleJetOverlapTool' )
-            alg.overlapTool.EleJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.EleJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.EleJetORT.InputLabel = inputLabel
+            alg.overlapTool.EleJetORT.OutputLabel = outputLabel
             alg.overlapTool.EleJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.EleJetORT.BJetLabel = self.bJetLabel
             alg.overlapTool.EleJetORT.UseSlidingDR = self.boostedLeptons
@@ -315,8 +337,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if muons and jets and self.doMuJetOR:
             config.addPrivateTool( 'overlapTool.MuJetORT',
                                    'ORUtils::MuJetOverlapTool' )
-            alg.overlapTool.MuJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.MuJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.MuJetORT.InputLabel = inputLabel
+            alg.overlapTool.MuJetORT.OutputLabel = outputLabel
             alg.overlapTool.MuJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.MuJetORT.BJetLabel = self.bJetLabel
             alg.overlapTool.MuJetORT.UseSlidingDR = self.boostedLeptons
@@ -327,8 +349,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if taus and electrons and self.doTauEleOR:
             config.addPrivateTool( 'overlapTool.TauEleORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.TauEleORT.InputLabel = self.inputLabel
-            alg.overlapTool.TauEleORT.OutputLabel = self.outputLabel
+            alg.overlapTool.TauEleORT.InputLabel = inputLabel
+            alg.overlapTool.TauEleORT.OutputLabel = outputLabel
             alg.overlapTool.TauEleORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.TauEleORT.DR = 0.2
             alg.overlapTool.TauEleORT.OutputPassValue = True
@@ -337,8 +359,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if taus and muons and self.doTauMuOR:
             config.addPrivateTool( 'overlapTool.TauMuORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.TauMuORT.InputLabel = self.inputLabel
-            alg.overlapTool.TauMuORT.OutputLabel = self.outputLabel
+            alg.overlapTool.TauMuORT.InputLabel = inputLabel
+            alg.overlapTool.TauMuORT.OutputLabel = outputLabel
             alg.overlapTool.TauMuORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.TauMuORT.DR = 0.2
             alg.overlapTool.TauMuORT.OutputPassValue = True
@@ -355,8 +377,8 @@ class OverlapAnalysisConfig (ConfigBlock):
                 config.addPrivateTool( 'overlapTool.TauJetORT',
                                        'ORUtils::DeltaROverlapTool' )
 
-            alg.overlapTool.TauJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.TauJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.TauJetORT.InputLabel = inputLabel
+            alg.overlapTool.TauJetORT.OutputLabel = outputLabel
             alg.overlapTool.TauJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.TauJetORT.DR = 0.2
             alg.overlapTool.TauJetORT.EnableUserPriority = self.enableUserPriority
@@ -366,8 +388,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if photons and electrons and self.doPhEleOR:
             config.addPrivateTool( 'overlapTool.PhoEleORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.PhoEleORT.InputLabel = self.inputLabel
-            alg.overlapTool.PhoEleORT.OutputLabel = self.outputLabel
+            alg.overlapTool.PhoEleORT.InputLabel = inputLabel
+            alg.overlapTool.PhoEleORT.OutputLabel = outputLabel
             alg.overlapTool.PhoEleORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.PhoEleORT.OutputPassValue = True
 
@@ -375,8 +397,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if photons and muons and self.doPhMuOR:
             config.addPrivateTool( 'overlapTool.PhoMuORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.PhoMuORT.InputLabel = self.inputLabel
-            alg.overlapTool.PhoMuORT.OutputLabel = self.outputLabel
+            alg.overlapTool.PhoMuORT.InputLabel = inputLabel
+            alg.overlapTool.PhoMuORT.OutputLabel = outputLabel
             alg.overlapTool.PhoMuORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.PhoMuORT.OutputPassValue = True
 
@@ -384,8 +406,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if photons and jets and self.doPhJetOR:
             config.addPrivateTool( 'overlapTool.PhoJetORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.PhoJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.PhoJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.PhoJetORT.InputLabel = inputLabel
+            alg.overlapTool.PhoJetORT.OutputLabel = outputLabel
             alg.overlapTool.PhoJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.PhoJetORT.EnableUserPriority = self.enableUserPriority
             alg.overlapTool.PhoJetORT.OutputPassValue = True
@@ -394,8 +416,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if electrons and fatJets and self.doEleFatJetOR:
             config.addPrivateTool( 'overlapTool.EleFatJetORT',
                             'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.EleFatJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.EleFatJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.EleFatJetORT.InputLabel = inputLabel
+            alg.overlapTool.EleFatJetORT.OutputLabel = outputLabel
             alg.overlapTool.EleFatJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.EleFatJetORT.DR = 1.0
             alg.overlapTool.EleFatJetORT.OutputPassValue = True
@@ -404,8 +426,8 @@ class OverlapAnalysisConfig (ConfigBlock):
         if jets and fatJets and self.doJetFatJetOR:
             config.addPrivateTool( 'overlapTool.JetFatJetORT',
                                    'ORUtils::DeltaROverlapTool' )
-            alg.overlapTool.JetFatJetORT.InputLabel = self.inputLabel
-            alg.overlapTool.JetFatJetORT.OutputLabel = self.outputLabel
+            alg.overlapTool.JetFatJetORT.InputLabel = inputLabel
+            alg.overlapTool.JetFatJetORT.OutputLabel = outputLabel
             alg.overlapTool.JetFatJetORT.LinkOverlapObjects = self.linkOverlapObjects
             alg.overlapTool.JetFatJetORT.DR = 1.0
             alg.overlapTool.JetFatJetORT.OutputPassValue = True
@@ -414,75 +436,75 @@ class OverlapAnalysisConfig (ConfigBlock):
             if electrons :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORElectronsCopyAlg' + postfix)
                 alg.particles = electrons
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
             if muons :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORMuonsCopyAlg' + postfix)
                 alg.particles = muons
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
             if taus :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORTausCopyAlg' + postfix)
                 alg.particles = taus
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
             if jets :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORJetsCopyAlg' + postfix)
                 alg.particles = jets
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
             if photons :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORPhotonsCopyAlg' + postfix)
                 alg.particles = photons
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
             if fatJets :
                 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORFatJetsCopyAlg' + postfix)
                 alg.particles = fatJets
-                alg.selectionDecoration = self.outputLabel + '_%SYS%,as_char'
+                alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
 
         # provide a preselection if requested
         if self.addPreselection:
             if self.preselectLabel is not None :
                 preselectLabel = self.preselectLabel
             else :
-                preselectLabel = self.outputLabel
+                preselectLabel = outputLabel
 
             if electrons :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORElectronsPreselectionAlg' + postfix )
                 alg.particles = electrons
                 alg.preselection = '&&'.join (config.getPreselection (self.electrons.split('.')[0], electronsSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.electrons.split('.')[0], electronsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
             if muons :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORMuonsPreselectionAlg' + postfix )
                 alg.particles = muons
                 alg.preselection = '&&'.join (config.getPreselection (self.muons.split('.')[0], muonsSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.muons.split('.')[0], muonsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
             if taus :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORTausPreselectionAlg' + postfix )
                 alg.particles = taus
                 alg.preselection = '&&'.join (config.getPreselection (self.taus.split('.')[0], tausSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.taus.split('.')[0], tausSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
             if jets :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORJetsPreselectionAlg' + postfix )
                 alg.particles = jets
                 alg.preselection = '&&'.join (config.getPreselection (self.jets.split('.')[0], jetsSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.jets.split('.')[0], jetsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
             if photons :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORPhotonsPreselectionAlg' + postfix )
                 alg.particles = photons
                 alg.preselection = '&&'.join (config.getPreselection (self.photons.split('.')[0], photonsSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.photons.split('.')[0], photonsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
             if fatJets :
                 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORFatJetsPreselectionAlg' + postfix )
                 alg.particles = fatJets
                 alg.preselection = '&&'.join (config.getPreselection (self.fatJets.split('.')[0], fatJetsSelectionName, asList=True)
-                        + [self.outputLabel + '_%SYS%,as_char'])
+                        + [outputLabel + '_%SYS%,as_char'])
                 alg.selectionDecoration = preselectLabel
                 config.addSelection (self.fatJets.split('.')[0], fatJetsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or')
 
@@ -545,5 +567,4 @@ def makeOverlapAnalysisConfig( seq,
     config.setOptionValue ('antiTauLabel', antiTauLabel)
     config.setOptionValue ('antiTauBJetLabel', antiTauBJetLabel)
     config.setOptionValue ('boostedLeptons', boostedLeptons)
-    config.setOptionValue ('postfix', postfix)
     seq.append (config)
-- 
GitLab