From 08fbc2ad54efc5bc57339b730ad1688804209665 Mon Sep 17 00:00:00 2001
From: Jiri Masik <jiri.masik@cern.ch>
Date: Fri, 24 May 2024 15:05:25 +0200
Subject: [PATCH] pass flags to getTrigEgammaKeys

pass flags to getTrigEgammaKeys
---
 .../TrigCaloRec/python/TrigCaloRecConfig.py   | 11 +++---
 .../HLT/Egamma/TrigEgammaFactoriesCfg.py      | 10 +++---
 .../python/HLT/Egamma/TrigEgammaKeys.py       | 34 ++++++++++---------
 .../HLT/Electron/FastElectronMenuSequences.py |  2 +-
 .../HLT/Electron/FastElectronRecoSequences.py |  2 +-
 .../HLT/Electron/FastTrackingMenuSequences.py |  2 +-
 .../Electron/PrecisionCaloMenuSequences.py    |  2 +-
 .../Electron/PrecisionCaloRecoSequences.py    |  8 ++---
 .../PrecisionElectronMenuSequences.py         |  2 +-
 .../PrecisionElectronMenuSequences_GSF.py     |  2 +-
 .../PrecisionElectronRecoSequences.py         |  6 ++--
 .../PrecisionTracks_GSFRefittedSequence.py    |  2 +-
 .../HLT/HeavyIon/HeavyIonMenuSequences.py     |  2 +-
 .../HLT/Photon/FastPhotonMenuSequences.py     |  2 +-
 .../HLT/Photon/FastPhotonRecoSequences.py     |  2 +-
 .../python/HLT/Photon/HipTRTMenuSequences.py  |  2 +-
 .../HLT/Photon/PrecisionCaloMenuSequences.py  |  2 +-
 .../HLT/Photon/PrecisionCaloRecoSequences.py  |  8 ++---
 .../PrecisionPhotonCaloIsoMenuSequences.py    |  2 +-
 .../PrecisionPhotonCaloIsoRecoSequences.py    |  6 ++--
 .../Photon/PrecisionPhotonMenuSequences.py    |  2 +-
 .../Photon/PrecisionPhotonRecoSequences.py    |  6 ++--
 .../HLT/Photon/TrigPhotonFactoriesCfg.py      | 12 +++----
 23 files changed, 64 insertions(+), 65 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
index cbccf597626c..04f23616c1de 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
@@ -345,10 +345,7 @@ def hltCaloTopoClusterCalibratorCfg(flags, name, clustersin, clustersout, **kwar
     return acc
 
 ##################### Unifying all cluster reco algs together ##################
-from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys	  import getTrigEgammaKeys
-TrigEgammaKeys = getTrigEgammaKeys()
-TrigEgammaKeys_LRT = getTrigEgammaKeys(name = '_LRT')
-TrigEgammaKeys_HI = getTrigEgammaKeys(ion = True)
+from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import  getTrigEgammaKeys
 
 def prepareFlagsGPUHLT(flags):
     flags.LAr.doHVCorr=True
@@ -364,7 +361,9 @@ def hltCaloTopoClusteringCfg(
     elif nameSuffix == "FS":
         clustersKeyFromName = em_clusters
     else:
+        TrigEgammaKeys = getTrigEgammaKeys(flags)
         clustersKeyFromName = TrigEgammaKeys.precisionTopoClusterContainer
+        
     clusters = clustersKeyFromName if clustersKey is None else clustersKey
     acc = ComponentAccumulator()
     acc.merge(
@@ -398,6 +397,7 @@ def egammaTopoClusteringCfg(flags, RoIs):
 
 @AccumulatorCache
 def egammaTopoClusteringCfg_LRT(flags, RoIs):
+  TrigEgammaKeys_LRT = getTrigEgammaKeys(flags, name = '_LRT')
   cfg = hltCaloTopoClusteringCfg(flags, namePrefix="", nameSuffix="RoI_LRT", CellsName="CaloCells",  monitorCells=True, roisKey=RoIs, clustersKey= TrigEgammaKeys_LRT.precisionTopoClusterContainer)
   return cfg
 
@@ -422,8 +422,7 @@ def tauTopoClusteringCfg(flags, RoIs):
 @AccumulatorCache
 def hltCaloTopoClusteringHICfg(
     flags, CellsName=None, roisKey="UNSPECIFIED", doLC=False,algSuffix='HIRoI', ion=True):
-    from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import  getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     eventShape = TrigEgammaKeys.egEventShape
     clustersKey = TrigEgammaKeys.precisionTopoClusterContainer
     acc = ComponentAccumulator()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaFactoriesCfg.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaFactoriesCfg.py
index e57b10f42754..a27a36bc9dc1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaFactoriesCfg.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaFactoriesCfg.py
@@ -6,7 +6,7 @@ from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
 
 def TrigEgammaRecCfg(flags, name= "trigEgammaRec"):
     acc = ComponentAccumulator()
-    TrigEgammaKeys = getTrigEgammaKeys()
+    TrigEgammaKeys = getTrigEgammaKeys(flags)
     egammaRec = CompFactory.egammaRecBuilder( name = name,
                                                   InputClusterContainerName = TrigEgammaKeys.precisionCaloTopoCollection, # input,
                                                   egammaRecContainer        = TrigEgammaKeys.precisionCaloEgammaRecCollection, # output,
@@ -20,7 +20,7 @@ def TrigEgammaRecCfg(flags, name= "trigEgammaRec"):
 
 def TrigEgammaSuperClusterBuilderCfg(flags, name, calibrationType, superClusterCollectionName, superegammaRecCollectionName):
         acc = ComponentAccumulator()
-        TrigEgammaKeys = getTrigEgammaKeys()
+        TrigEgammaKeys = getTrigEgammaKeys(flags)
         from egammaTools.egammaSwToolConfig import egammaSwToolCfg
         from egammaMVACalib.egammaMVACalibConfig import egammaMVASvcCfg
         trigMVAfolder = flags.Trigger.egamma.Calib.precCaloMVAVersion
@@ -39,11 +39,10 @@ def TrigEgammaSuperClusterBuilderCfg(flags, name, calibrationType, superClusterC
 
 def TrigCaloClustersInConeToolCfg(flags, ion):
         acc = ComponentAccumulator()
+        TrigEgammaKeys = getTrigEgammaKeys(flags, ion =ion)
         if ion:
-            TrigEgammaKeys = getTrigEgammaKeys(ion =ion)
             name = "TrigCaloClustersInConeToolHI"
         else:
-            TrigEgammaKeys = getTrigEgammaKeys()
             name = "TrigCaloClustersInConeTool"
         tool = CompFactory.xAOD.CaloClustersInConeTool(name = name,
                                                        CaloClusterLocation = TrigEgammaKeys.precisionTopoClusterContainer)
@@ -109,13 +108,12 @@ def TrigCaloIsolationToolCfg(flags):
 
 def TrigPhotonIsoBuilderCfg(flags, ion = False):
         acc = ComponentAccumulator()
+        TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
         if ion:
             name = 'TrigPhotonIsolationBuilderHI'
-            TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
             TrigCaloIsolationTool = TrigCaloIsolationToolCfg_HI(flags)
         else:
             name = 'TrigPhotonIsolationBuilder'
-            TrigEgammaKeys = getTrigEgammaKeys()
             TrigCaloIsolationTool = TrigCaloIsolationToolCfg(flags)
 
         from xAODPrimitives.xAODIso import xAODIso as isoPar
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaKeys.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaKeys.py
index 542ec8d36578..e3d65d203bf9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaKeys.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Egamma/TrigEgammaKeys.py
@@ -10,13 +10,12 @@ __all__    = [ "getTrigEgammaKeys" ]
 
 
 from TrigEDMConfig.TriggerEDM import recordable
-from AthenaConfiguration.AllConfigFlags import initConfigFlags
-
+from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 
 class TrigEgammaKeysBase(object):
 
       """Base clas to configure TrigEgamma Container names. Containers will be record, collections not"""
-      def __init__(self, ion=False):
+      def __init__(self, flags: AthConfigFlags, ion=False):
 
 
         """Static class to collect all string manipulation in fast electron sequences """
@@ -56,7 +55,7 @@ class TrigEgammaKeysBase(object):
         #
         self.TrigTRTHTCountsContainer                   = recordable("HLT_TrigTRTHTCounts")
         self.egEventShape                               = recordable('HLT_HIEventShapeEG')
-        self._flags = initConfigFlags()
+        self._flags = flags       
 
 
 
@@ -72,8 +71,8 @@ class TrigEgammaKeysBase(object):
 
 class TrigEgammaKeys_LRT(TrigEgammaKeysBase):
     # This class contians modified base configuration class for LRT electron trigger chains
-    def __init__(self,ion):
-        TrigEgammaKeysBase.__init__(self,ion)
+    def __init__(self, flags: AthConfigFlags, ion):
+        TrigEgammaKeysBase.__init__(self, flags, ion)
         
         self.fastTrackingRoIContainer               = recordable("HLT_Roi_FastElectron_LRT")
         self.fastElectronContainer                  = recordable('HLT_FastElectrons_LRT')
@@ -93,8 +92,8 @@ class TrigEgammaKeys_LRT(TrigEgammaKeysBase):
 
 class TrigEgammaKeys_GSF(TrigEgammaKeysBase):
     # This class contians modified base configuration class for GSF electron trigger chains
-    def __init__(self, ion):
-        TrigEgammaKeysBase.__init__(self, ion)
+    def __init__(self, flags: AthConfigFlags, ion):
+        TrigEgammaKeysBase.__init__(self, flags, ion)
         self.precisionElectronEMClusterContainer    = recordable('HLT_TrigEMClusters_Electrons_GSF')
         
         # from HLT_IDTrack_Electron to HLT_IDTrack_Electron by refit alg
@@ -112,8 +111,8 @@ class TrigEgammaKeys_GSF(TrigEgammaKeysBase):
 
 class TrigEgammaKeys_LRTGSF(TrigEgammaKeysBase):
     # This class contians modified base configuration class for LRT_GSF electron trigger chains
-    def __init__(self, ion):
-        TrigEgammaKeysBase.__init__(self, ion)
+    def __init__(self, flags: AthConfigFlags, ion):
+        TrigEgammaKeysBase.__init__(self, flags, ion)
         self.precisionElectronEMClusterContainer    = recordable('HLT_TrigEMClusters_Electrons_LRTGSF')
         
         # from HLT_IDTrack_Electron to HLT_IDTrack_Electron by refit alg
@@ -133,15 +132,18 @@ class TrigEgammaKeys_LRTGSF(TrigEgammaKeysBase):
 #
 # Get keys from variant name
 #
-def getTrigEgammaKeys(name='', ion=False):
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
+
+@AccumulatorCache
+def getTrigEgammaKeys(flags: AthConfigFlags, name='', ion=False):
 
     _d = {
         # Dictionary that maps a string to a configuration setting for electron and photon chains
-        ''         : TrigEgammaKeysBase(ion),
-        '_noGSF'   : TrigEgammaKeysBase(ion),
-        '_LRT'     : TrigEgammaKeys_LRT(ion),
-        '_GSF'     : TrigEgammaKeys_GSF(ion),
-        '_LRTGSF'  : TrigEgammaKeys_LRTGSF(ion),
+        ''         : TrigEgammaKeysBase(flags, ion),
+        '_noGSF'   : TrigEgammaKeysBase(flags, ion),
+        '_LRT'     : TrigEgammaKeys_LRT(flags, ion),
+        '_GSF'     : TrigEgammaKeys_GSF(flags, ion),
+        '_LRTGSF'  : TrigEgammaKeys_LRTGSF(flags, ion),
         }
 
     if name in _d.keys():
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronMenuSequences.py
index 6a820ea88c17..9745f869b958 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronMenuSequences.py
@@ -28,7 +28,7 @@ def fastElectronSequenceGenCfg(flags, name='FastElectron', variant='', is_probe_
     reco.mergeReco(fastElectronRecoSequence(flags, name, InViewRoIs, variant))
     
     theFastElectronHypo = CompFactory.TrigEgammaFastElectronHypoAlg("TrigEgammaFastElectronHypoAlg"+variant)
-    TrigEgammaKeys = getTrigEgammaKeys(variant)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant)
     theFastElectronHypo.Electrons = TrigEgammaKeys.fastElectronContainer
     theFastElectronHypo.RunInView = True
     from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronRecoSequences.py
index 8fbef0970ecd..60a71b3f31cf 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastElectronRecoSequences.py
@@ -14,7 +14,7 @@ def fastElectronRecoSequence(flags, name, RoIs, variant=''):
     
     acc = ComponentAccumulator()
 
-    TrigEgammaKeys = getTrigEgammaKeys(variant)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant)
     trackParticlesName = TrigEgammaKeys.fastTrackParticleContainer  
 
     # A simple algorithm to confirm that data has been inherited from parent view
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastTrackingMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastTrackingMenuSequences.py
index 8b9ff0268906..050907e997b6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastTrackingMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/FastTrackingMenuSequences.py
@@ -12,7 +12,7 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 def fastTrackingSequenceGenCfg(flags, variant='', is_probe_leg = False):
     """ second step:  tracking....."""
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(variant)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant)
     inViewRoIs = "EMIDRoIs"+variant
     
     # calling the fastTracking Reco algo
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloMenuSequences.py
index 69cc3ba9c3aa..3383b1ace42e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloMenuSequences.py
@@ -14,7 +14,7 @@ def tag(ion):
 @AccumulatorCache
 def precisionCaloSequenceGenCfg(flags, ion=False, is_probe_leg=False, variant=''):
     """ Creates PrecisionCalo sequence """
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
     hiInfo = 'HI' if ion else ''
     # EV creator
     InViewRoIs="PrecisionCaloRoIs"+ variant
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloRecoSequences.py
index e83eff96feb1..81935826d8b9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionCaloRecoSequences.py
@@ -11,9 +11,9 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 log = logging.getLogger(__name__)
 
-def precisionCaloElectronVDVCfg(name, InViewRoIs, ion=False, variant=''):
+def precisionCaloElectronVDVCfg(flags, name, InViewRoIs, ion=False, variant=''):
     acc = ComponentAccumulator()
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
    
     dataObjects= [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+%s'%InViewRoIs ),
                   ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
@@ -31,12 +31,12 @@ def precisionCaloElectronVDVCfg(name, InViewRoIs, ion=False, variant=''):
 def precisionCaloRecoSequence(flags, RoIs, name = None, ion=False, variant=''):
     acc = ComponentAccumulator()
 
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion = ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion = ion)
 
     log.debug('flags = %s',flags)
     log.debug('RoIs = %s',RoIs)
     
-    acc.merge(precisionCaloElectronVDVCfg(name+'VDV'+variant,RoIs,ion,variant=variant))
+    acc.merge(precisionCaloElectronVDVCfg(flags, name+'VDV'+variant,RoIs,ion,variant=variant))
 
     from TrigCaloRec.TrigCaloRecConfig import egammaTopoClusteringCfg, egammaTopoClusteringCfg_LRT, hltCaloTopoClusteringHICfg
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences.py
index 586e4618a9ae..03d6ddd83b24 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences.py
@@ -24,7 +24,7 @@ def precisionElectronSequenceGenCfg(flags, ion=False, variant='',is_probe_leg =
     # Configure the reconstruction algorithm sequence
     from TriggerMenuMT.HLT.Electron.PrecisionElectronRecoSequences import precisionElectronRecoSequence
     reco.mergeReco(precisionElectronRecoSequence(flags, inViewRoIs, ion, doGSF=False, doLRT = 'LRT' in variant))
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
     selAcc = SelectionCA('PrecisionElectronMenuSequence'+variant,isProbe=is_probe_leg)
     
     from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool import TrigEgammaPrecisionElectronHypoToolFromDict, TrigEgammaPrecisionElectronHypoAlgCfg
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences_GSF.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences_GSF.py
index 5ec7971c2e68..d9b80b10b29e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences_GSF.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronMenuSequences_GSF.py
@@ -25,7 +25,7 @@ def precisionElectron_GSFSequenceGenCfg(flags, ion=False, variant='_GSF', is_pro
     # Configure the reconstruction algorithm sequence
     from TriggerMenuMT.HLT.Electron.PrecisionElectronRecoSequences import precisionElectronRecoSequence
     reco.mergeReco(precisionElectronRecoSequence(flags, inViewRoIs, ion, doGSF='GSF' in variant, doLRT = 'LRT' in variant))
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
     selAcc = SelectionCA('PrecisionElectronMenuSequence'+variant,isProbe=is_probe_leg)
 
     from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool import TrigEgammaPrecisionElectronHypoToolFromDict, TrigEgammaPrecisionElectronHypoAlgCfg
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronRecoSequences.py
index f41252264ead..1186b17cb62d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionElectronRecoSequences.py
@@ -41,13 +41,13 @@ def precisionElectronRecoSequence(flags, RoIs, ion=False, doGSF=True, doLRT=Fals
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import  getTrigEgammaKeys
 
     # makes datakeys based on LRT, GSF, noGSF, LRTGSF            
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
     
     # taking care of VDV before GSF related data comes in
     if doLRT:
-        TrigEgammaKeys_noGSF = getTrigEgammaKeys('_LRT')
+        TrigEgammaKeys_noGSF = getTrigEgammaKeys(flags, '_LRT')
     else:
-        TrigEgammaKeys_noGSF = getTrigEgammaKeys() 
+        TrigEgammaKeys_noGSF = getTrigEgammaKeys(flags) 
     
     # following reduces if-else checking for later implementations
     if doGSF:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionTracks_GSFRefittedSequence.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionTracks_GSFRefittedSequence.py
index c770b749f42d..cfd489f4fda1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionTracks_GSFRefittedSequence.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/PrecisionTracks_GSFRefittedSequence.py
@@ -20,7 +20,7 @@ def precisionTracks_GSFRefitted(flags, RoIs, ion=False, variant=''):
     tag+=variant
 
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import  getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(variant, ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, variant, ion=ion)
 
     precisionGsfVDV = CompFactory.AthViews.ViewDataVerifier("PrecisionTrackViewDataVerifier_forGSFRefit"+tag+'VDV')
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/HeavyIon/HeavyIonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/HeavyIon/HeavyIonMenuSequences.py
index b39bb3adfc0b..a57c80f3a9ad 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/HeavyIon/HeavyIonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/HeavyIon/HeavyIonMenuSequences.py
@@ -23,7 +23,7 @@ def egammaFSHIEventShapeMakerCfg(flags):
         InputCellKey=cellMakerAcc.getPrimary().CellsName,
         NaviTowerKey="",
         InputTowerKey="",
-        OutputContainerKey=getTrigEgammaKeys(ion=True).egEventShape) 
+        OutputContainerKey=getTrigEgammaKeys(flags, ion=True).egEventShape) 
 
     acc.addEventAlgo(eventShapeMakerAlg)
     return acc
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonMenuSequences.py
index d076de589486..22bf8bd0ea1e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonMenuSequences.py
@@ -10,7 +10,7 @@ from AthenaConfiguration.AccumulatorCache import AccumulatorCache
 def fastPhotonSequenceGenCfg(flags,is_probe_leg=False):
     """Creates secpond step photon sequence"""
     
-    TrigEgammaKeys = getTrigEgammaKeys()
+    TrigEgammaKeys = getTrigEgammaKeys(flags)
 
     InViewRoIs = "EMIDRoIs"
     # Spawn View on SuperRoI encompassing all clusters found within the L1 RoI
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonRecoSequences.py
index 339df8920e92..efe2b527d69d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/FastPhotonRecoSequences.py
@@ -26,7 +26,7 @@ def fastPhotonRecoSequence(flags, RoIs, name = None):
     
     acc.merge(fastPhotonVDVCfg(name+'VDV',RoIs))
 
-    TrigEgammaKeys = getTrigEgammaKeys()
+    TrigEgammaKeys = getTrigEgammaKeys(flags)
 
     thePhotonFex =  CompFactory.TrigEgammaFastPhotonReAlgo("EgammaFastPhotonFex_1")
     thePhotonFex.TrigEMClusterName = CaloMenuDefs.L2CaloClusters # From commom staff
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/HipTRTMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/HipTRTMenuSequences.py
index 3a5369317339..ccbe06acd825 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/HipTRTMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/HipTRTMenuSequences.py
@@ -13,7 +13,7 @@ def TRTHitGeneratorSequenceGenCfg(flags, is_probe_leg = False):
     recAcc = ComponentAccumulator()
 
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys()
+    TrigEgammaKeys = getTrigEgammaKeys(flags)
 
     """ hipTRT step ....."""
     inViewRoIs = "TRTHitGenerator"
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloMenuSequences.py
index 299fcfe2a5a4..1308bf780be6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloMenuSequences.py
@@ -14,7 +14,7 @@ def tag(ion):
 @AccumulatorCache
 def precisionCaloSequenceGenCfg(flags, ion=False, is_probe_leg=False):
     """ Creates PrecisionCalo sequence """
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     
     hiInfo = 'HI' if ion else ''
     # EV creator
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloRecoSequences.py
index ae677de48f24..739efeb3e44e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionCaloRecoSequences.py
@@ -11,9 +11,9 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 log = logging.getLogger(__name__)
 
 
-def precisionCaloPhotonVDVCfg(name, InViewRoIs, ion=False):
+def precisionCaloPhotonVDVCfg(flags, name, InViewRoIs, ion=False):
     acc = ComponentAccumulator()
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     dataObjects= [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+%s'%InViewRoIs ),
                   ( 'CaloBCIDAverage' , 'StoreGateSvc+CaloBCIDAverage' ),
                   ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing' )]
@@ -31,11 +31,11 @@ def precisionCaloRecoSequence(flags, RoIs, name = None, ion=False):
 
     acc = ComponentAccumulator()
 
-    TrigEgammaKeys = getTrigEgammaKeys(ion = ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)
     log.debug('flags = %s',flags)
     log.debug('RoIs = %s',RoIs)
 
-    acc.merge(precisionCaloPhotonVDVCfg(name+'VDV',RoIs,ion))
+    acc.merge(precisionCaloPhotonVDVCfg(flags,name+'VDV',RoIs,ion))
 
     from TrigCaloRec.TrigCaloRecConfig import egammaTopoClusteringCfg, hltCaloTopoClusteringHICfg
     
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoMenuSequences.py
index cc5388c53108..6537dc16bd77 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoMenuSequences.py
@@ -18,7 +18,7 @@ def precisionPhotonCaloIsoSequenceGenCfg(flags, name, ion=False, is_probe_leg=Fa
     
     InViewRoIs = "PrecisionPhotonCaloIsoRoIs"
     hiInfo = 'HI' if ion is True else ''
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
 
     roiTool = CompFactory.ViewCreatorPreviousROITool()
     recoAcc = InViewRecoCA(tag(ion),InViewRoIs=InViewRoIs, RoITool = roiTool, RequireParentView = True, isProbe=is_probe_leg)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoRecoSequences.py
index 92c46b824ec3..5875ecfc9f74 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonCaloIsoRecoSequences.py
@@ -7,9 +7,9 @@ from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
-def precisionPhotonCaloIsoVDVCfg(name, InViewRoIs, ion=False):
+def precisionPhotonCaloIsoVDVCfg(flags, name, InViewRoIs, ion=False):
     acc = ComponentAccumulator()
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     caloClusters = TrigEgammaKeys.precisionPhotonCaloClusterContainer
     dataObjects = [( 'xAOD::CaloClusterContainer' , 'StoreGateSvc+%s' % caloClusters ),
                    ( 'xAOD::CaloClusterContainer' , 'StoreGateSvc+%s' % TrigEgammaKeys.precisionTopoClusterContainer), # this is for the calo isolation tool
@@ -38,7 +38,7 @@ def precisionPhotonCaloIsoRecoSequence(flags, RoIs,  name = None, ion=False):
 
     log.debug('retrieve(precisionPhotonCaloIsoRecoSequence,None,RoIs = %s)',RoIs)
 
-    acc.merge(precisionPhotonCaloIsoVDVCfg(name+'VDV',RoIs,ion))
+    acc.merge(precisionPhotonCaloIsoVDVCfg(flags, name+'VDV',RoIs,ion))
 
     # Add CaloIsolationTool
     from TriggerMenuMT.HLT.Egamma.TrigEgammaFactoriesCfg import TrigPhotonIsoBuilderCfg
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonMenuSequences.py
index 8fa96740ebaf..45fcb1b39ec1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonMenuSequences.py
@@ -21,7 +21,7 @@ def precisionPhotonSequenceGenCfg(flags, ion=False, is_probe_leg=False):
     InViewRoIs="PrecisionPhotonRoIs"                                          
 
     # Configure the reconstruction algorithm sequence
-    TrigEgammaKeys = getTrigEgammaKeys(ion = ion)   
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)   
 
     hiInfo = 'HI' if ion is True else ''
     probeInfo = '_probe' if  is_probe_leg is True else ''
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonRecoSequences.py
index 61169e3b96d2..fdbc348e97c3 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/PrecisionPhotonRecoSequences.py
@@ -7,9 +7,9 @@ from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
-def precisionPhotonVDVCfg(name, InViewRoIs, ion=False):
+def precisionPhotonVDVCfg(flags, name, InViewRoIs, ion=False):
     acc = ComponentAccumulator()
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     caloClusters = TrigEgammaKeys.precisionPhotonCaloClusterContainer
     dataObjects = [( 'xAOD::CaloClusterContainer' , 'StoreGateSvc+%s' % caloClusters ),
                               ( 'EgammaRecContainer', 'StoreGateSvc+%s' % TrigEgammaKeys.precisionPhotonSuperClusterCollection),
@@ -45,7 +45,7 @@ def precisionPhotonRecoSequence(flags, RoIs, name = None, ion=False):
 
     log.debug('retrieve(precisionPhotonRecoSequence,None,RoIs = %s)',RoIs)
     
-    acc.merge(precisionPhotonVDVCfg(name+'VDV',RoIs,ion))
+    acc.merge(precisionPhotonVDVCfg(flags, name+'VDV',RoIs,ion))
 
     if ion:
         TrigTopoEgammaPhoton = TrigTopoEgammaPhotonCfg_HI(flags)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/TrigPhotonFactoriesCfg.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/TrigPhotonFactoriesCfg.py
index 82005245bcec..e738594a4aba 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/TrigPhotonFactoriesCfg.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Photon/TrigPhotonFactoriesCfg.py
@@ -12,7 +12,7 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 def PrecisionPhotonCaloIsoMonitorCfg(flags, name = 'PrecisionPhotonCaloIsoEgammaBuilderMon', ion=False):
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion = ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)
     from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg
     monTool = egammaMonitorPrecisionCfg(flags, name)
     collectionIn = TrigEgammaKeys.precisionPhotonContainer
@@ -27,7 +27,7 @@ def PrecisionPhotonCaloIsoMonitorCfg(flags, name = 'PrecisionPhotonCaloIsoEgamma
 def TrigEMClusterToolCfg(flags, ion=False):
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion = ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion = ion)
     from egammaMVACalib.egammaMVACalibConfig import egammaMVASvcCfg
     tool = CompFactory.EMClusterTool('TrigEMClusterTool_photon',
                                       OutputClusterContainerName = TrigEgammaKeys.precisionPhotonEMClusterContainer,
@@ -38,7 +38,7 @@ def TrigEMClusterToolCfg(flags, ion=False):
 def TrigTopoEgammaPhotonCfg(flags):
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys()
+    TrigEgammaKeys = getTrigEgammaKeys(flags)
     from egammaTools.EMShowerBuilderConfig import EMShowerBuilderCfg
     from egammaTools.EMPIDBuilderConfig import EMPIDBuilderPhotonCfg
     TrigTopoEgammaPhotons = CompFactory.xAODEgammaBuilder( name = 'TrigTopoEgammaPhotons',
@@ -59,7 +59,7 @@ def TrigTopoEgammaPhotonCfg(flags):
 def TrigTopoEgammaPhotonCfg_HI(flags):
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion=True)
+    TrigEgammaKeys = getTrigEgammaKeys(flags,ion=True)
     from egammaTools.EMShowerBuilderConfig import EMShowerBuilderCfg
     from egammaTools.EMPIDBuilderConfig import EMPIDBuilderPhotonCfg
     TrigTopoEgammaPhotons = CompFactory.xAODEgammaBuilder( name = 'TrigTopoEgammaPhotons_HI',
@@ -81,7 +81,7 @@ def PrecisionPhotonTopoMonitorCfg(flags, ion=False,name = 'PrecisionPhotonTopoMo
 
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags,ion=ion)
     from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg
     monTool = egammaMonitorPrecisionCfg(flags, name+('HI' if ion is True else ''))
 
@@ -98,7 +98,7 @@ def PrecisionPhotonSuperClusterMonitorCfg(flags, ion = False, name ='PrecisionPh
 
     acc = ComponentAccumulator()
     from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
-    TrigEgammaKeys = getTrigEgammaKeys(ion=ion)
+    TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
     from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorSuperClusterCfg
     monTool = egammaMonitorSuperClusterCfg(flags, name+('HI' if ion is True else ''))
 
-- 
GitLab