diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
index 5bd4ab1813e0a08ce7646da6c3180ec8ffc4cd0a..7642aa7434719da5fad4faae6f631351b2a5a6f3 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigBjetMonitorAlgorithm.py
@@ -603,37 +603,31 @@ if __name__=='__main__':
     log.setLevel(DEBUG)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
 
     # Input files
-
-    # Original data input file from P.Onyisi and C.Burton:
-    #nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
-    #file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    #ConfigFlags.Input.Files = [nightly+file]
-    #ConfigFlags.Input.isMC = False
-
     # AOD file to be run w/ MT access and Mon Groups implemented
     file = '/eos/user/e/enagy/ARTfiles/MCtest171022.AOD.pool.root'
 
-    ConfigFlags.Input.Files = [file]
-    ConfigFlags.Input.isMC = True
+    flags.Input.Files = [file]
+    flags.Input.isMC = True
 
     # Output file (root)
 
-    ConfigFlags.Output.HISTFileName = 'TrigBjetMonitorOutput.root'
+    flags.Output.HISTFileName = 'TrigBjetMonitorOutput.root'
 
-    # ConfigFlags.Trigger.triggerMenuSetup="Physics_pp_v7_primaries"
+    # flags.Trigger.triggerMenuSetup="Physics_pp_v7_primaries"
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigBjetMonitorAcc = TrigBjetMonConfig(ConfigFlags)
+    trigBjetMonitorAcc = TrigBjetMonConfig(flags)
     cfg.merge(trigBjetMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py
deleted file mode 100644
index 42d363cc272f31b9c1a2b9ef067e4287ea6c6f34..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm_2alg.py
+++ /dev/null
@@ -1,244 +0,0 @@
-#
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
-#
-
-'''@file TrigBjetMonitorAlgorithm.py
-@author E. Nagy
-@author T. Bold
-@date 2019-04-16
-@brief Example trigger python configuration for the Run III AthenaMonitoring package, based on the example by C Burton and P Onyisi
-'''
-
-def TrigBjetMonConfig(inputFlags):
-    '''Function to configures some algorithms in the monitoring system.'''
-
-    ### STEP 1 ###
-    # Define one top-level monitoring algorithm. The new configuration 
-    # framework uses a component accumulator.
-    # EN: not needed here now
-    # from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    # result = ComponentAccumulator()
-
-    # The following class will make a sequence, configure algorithms, and link
-    # them to GenericMonitoringTools
-    from AthenaMonitoring import AthMonitorCfgHelper
-    helper = AthMonitorCfgHelper(inputFlags,'TrigBjetAthMonitorCfg')
-
-
-    ### STEP 2 ###
-    # Adding an algorithm to the helper. Here, we will use the example 
-    # algorithm in the AthenaMonitoring package. Just pass the type to the 
-    # helper. Then, the helper will instantiate an instance and set up the 
-    # base class configuration following the inputFlags. The returned object 
-    # is the algorithm.
-    #The added algorithm must exist as a .h file 
-
-    from TrigBjetMonitoring.TrigBjetMonitoringConf import TrigBjetMonitorAlgorithm
-    trigBjetMonAlg = helper.addAlgorithm(TrigBjetMonitorAlgorithm,'TrigBjetMonAlg')
-
-    # You can actually make multiple instances of the same algorithm and give 
-    # them different configurations
-    shifterTrigBjetMonAlg = helper.addAlgorithm(TrigBjetMonitorAlgorithm,'ShifterTrigBjetMonAlg')
-
-    # # If for some really obscure reason you need to instantiate an algorithm
-    # # yourself, the AddAlgorithm method will still configure the base 
-    # # properties and add the algorithm to the monitoring sequence.
-    # helper.AddAlgorithm(myExistingAlg)
-
-
-    ### STEP 3 ###
-    # Edit properties of a algorithm
-    # some generic property
-    # trigBjetMonAlg.RandomHist = True
-    # to enable a trigger filter, for example:
-    #trigBjetMonAlg.TriggerChain = 'HLT_mu26_ivarmedium'
-    #trigBjetMonAlg.TriggerChain = 'HLT_e24_lhtight_nod0'
-    trigBjetMonAlg.TriggerChain = ''
-
-    ### STEP 4 ###
-    # Read in the Bjet trigger chain names
-
-    # Directly from TrigBjetMonitCategory
-    #from TrigBjetMonitoring import TrigBjetMonitCategory
-    #bjet_triglist = TrigBjetMonitCategory.monitoring_bjet
-
-    # From the hltmonList where TrigHLTMonitoring filtered the run type
-    from TrigHLTMonitoring.HLTMonTriggerList import hltmonList
-    bjet_triglist = hltmonList.monitoring_bjet
-    bjet_triglist += hltmonList.monitoring_mujet
-    # print " ==> bjet_triglist: ", bjet_triglist
-
-    # Add some tools. N.B. Do not use your own trigger decion tool. Use the
-    # standard one that is included with AthMonitorAlgorithm.
-
-    # # Add a tool that doesn't have its own configuration function. In
-    # # this example, no accumulator is returned, so no merge is necessary.
-    # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
-    # trigBjetMonAlg.MyDomainTool = MyDomainTool()
-
-    # Add a generic monitoring tool (a "group" in old language). The returned 
-    # object here is the standard GenericMonitoringTool.
-    myGroup = helper.addGroup(
-        trigBjetMonAlg,
-        'TrigBjetMonitor',
-        'HLT/BjetMon/Expert/'
-    )
-
-    # Add a GMT for the other example monitor algorithm
-    shifterGroup = helper.addGroup(shifterTrigBjetMonAlg,'TrigBjetMonitor','HLT/BjetMon/Shifter/')
-
-    ### STEP 5 ###
-    # Configure histograms
-    #NB! The histograms defined here must match the ones in the cxx file exactly
-
-    # Offline PV histograms - common for all trigger chains
-
-    shifterGroup.defineHistogram('Off_NVtx', title='Number of Offline Vertices;NVtx;Events',
-                                 path='Offline',xbins=100,xmin=0.0,xmax=100.)
-    shifterGroup.defineHistogram('Off_xVtx', title='Offline xVtx;xVtx;Events',
-                                 path='Offline',xbins=200,xmin=-1.5,xmax=+1.5)
-    shifterGroup.defineHistogram('Off_yVtx', title='Offline yVtx;yVtx;Events',
-                                 path='Offline',xbins=200,xmin=-1.5,xmax=+1.5)
-    shifterGroup.defineHistogram('Off_zVtx', title='Offline zVtx;zVtx;Events',
-                                 path='Offline',xbins=200,xmin=-200.0,xmax=+200.0)
-
-    # Histograms which depend on the trigger chain
-
-
-    AllChains = []
-    for chain in bjet_triglist :
-        AllChains.append(chain[2:])
-        # print " inside bjet_triglist chain[2:8] : " , chain[2:8]
-        if chain[2:8] == 'HLT_mu' : # mu-jets
-            # print "        mu-jet histogram is defined for ", chain[2:]
-
-            HistName = 'jetPt_' + chain[2:]
-            if chain[0:1] == "E" :
-                myGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
-                                        path=chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
-                # print " ==> histogam ",HistName," is defined for myGroup"
-            if chain[0:1] == "S" :
-                shifterGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
-                                             path=chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
-                # print " ==> histogam ",HistName," is defined for shifterGroup"
-
-            continue
-        else :                      # b-jets
-            # print "        b-jet histogram is defined for ", chain[2:]
-
-            HistName = 'PVz_tr_' + chain[2:]
-            if chain[0:1] == "E" :
-                myGroup.defineHistogram(HistName, title='Distribution of online zPV;zPV;Events',
-                                        path=chain[2:],xbins=200,xmin=-200.0,xmax=200.0)
-                # print " ==> histogam ",HistName," is defined for myGroup"
-            if chain[0:1] == "S" :
-                shifterGroup.defineHistogram(HistName, title='Distribution of online zPV;zPV;Events',
-                                             path=chain[2:],xbins=200,xmin=-200.0,xmax=200.0)
-                # print " ==> histogam ",HistName," is defined for shifterGroup"
-
-            HistName = 'd0_' + chain[2:]
-            if chain[0:1] == "E" :
-                myGroup.defineHistogram(HistName, title='Distribution of d0;d0;Events',
-                                        path=chain[2:],xbins=200,xmin=-2.0,xmax=2.0)
-                # print " ==> histogam ",HistName," is defined for myGroup"
-            if chain[0:1] == "S" :
-                shifterGroup.defineHistogram(HistName, title='Distribution of d0;d0;Events',
-                                             path=chain[2:],xbins=200,xmin=-2.0,xmax=2.0)
-                # print " ==> histogam ",HistName," is defined for shifterGroup"
-
-            HistName = 'jetPt_' + chain[2:]
-            if chain[0:1] == "E" :
-                myGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
-                                        path=chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
-                # print " ==> histogam ",HistName," is defined for myGroup"
-            if chain[0:1] == "S" :
-                shifterGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
-                                             path=chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
-                # print " ==> histogam ",HistName," is defined for shifterGroup"
-
-            HistName = 'wMV2c20_' + chain[2:]
-            if chain[0:1] == "E" :
-                myGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events',
-                                        path=chain[2:],xbins=200,xmin=-1.0,xmax=1.0)
-                # print " ==> histogam ",HistName," is defined for myGroup"
-            if chain[0:1] == "S" :
-                shifterGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events',
-                                             path=chain[2:],xbins=200,xmin=-1.0,xmax=1.0)
-                # print " ==> histogam ",HistName," is defined for shifterGroup"
-            continue
-
-
-    # print " ==> In TrigBjetMonitorAlgorithm.py: AllChains list: ", AllChains
-    trigBjetMonAlg.AllChains = AllChains
-    shifterTrigBjetMonAlg.AllChains = AllChains
-
-
-
-    ### STEP 6 ###
-    # Finalize. The return value should be a tuple of the ComponentAccumulator
-    # and the sequence containing the created algorithms. If we haven't called
-    # any configuration other than the AthMonitorCfgHelper here, then we can 
-    # just return directly (and not create "result" above)
-    return helper.result()
-    
-    # # Otherwise, merge with result object and return
-    # acc = helper.result()
-    # result.merge(acc)
-    # return result
-
-if __name__=='__main__':
-    # Setup logs
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import DEBUG
-    log.setLevel(DEBUG)
-
-    # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-
-    # Input files
-
-    # Original data input file from P.Onyisi and C.Burton:
-    #nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
-    #file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    #ConfigFlags.Input.Files = [nightly+file]
-    #ConfigFlags.Input.isMC = False
-
-    # MC file found by me but can be used only w/ asetup Athena,r2019-06-28,master
-    #nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
-    #file = 'mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1'
-    #ConfigFlags.Input.Files = [nightly+file]
-    #ConfigFlags.Input.isMC = True
-
-    # MC input files proposed by Tim Martin in https://its.cern.ch/jira/browse/ATR-19881 for Run-3
-    # file = '/afs/cern/ch/user/t/tamartin/public/ESD.pool.root'
-    # file = '/afs/cern/ch/user/t/tamartin/public/AOD.pool.root'
-    # file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/legacy.AOD.pool.root'
-    file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/mt.AOD.pool.root'
-    ConfigFlags.Input.Files = [file]
-    ConfigFlags.Input.isMC = True
-
-    # Output file (root)
-
-    ConfigFlags.Output.HISTFileName = 'TrigBjetMonitorOutput.root'
-
-    ConfigFlags.Trigger.triggerMenuSetup="Physics_pp_v7_primaries"
-    
-    ConfigFlags.lock()
-
-    # Initialize configuration object, add accumulator, merge, and run.
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
-    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-
-    trigBjetMonitorAcc = TrigBjetMonConfig(ConfigFlags)
-    cfg.merge(trigBjetMonitorAcc)
-
-    # If you want to turn on more detailed messages ...
-    #trigBjetMonitorAcc.getEventAlgo('TrigBjetMonAlg').OutputLevel = 2 # DEBUG
-    cfg.printConfig(withDetails=True) # set True for exhaustive info
-
-    Nevents = 25
-    #cfg.run(Nevents)
-    cfg.run() #use cfg.run(20) to only run on first 20 events
-
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
index ba4d3bb78593c15e82b92aff7c7b9c2b893e8311..47acd58f0ae1fd3f484225a64a7c0013a18f58ae 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 def TrigBphysMonConfig(inputFlags):
@@ -22,22 +22,24 @@ def TrigBphysMonConfig(inputFlags):
 
 if __name__=='__main__':
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
     file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'TrigBphysMonitorOutput.root'
+
+    flags = initConfigFlags()
+    flags.Input.Files = [nightly+file]
+    flags.Input.isMC = False
+    flags.Output.HISTFileName = 'TrigBphysMonitorOutput.root'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigBphysMonitorAcc = TrigBphysMonConfig(ConfigFlags)
+    trigBphysMonitorAcc = TrigBphysMonConfig(flags)
     cfg.merge(trigBphysMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitorAlgorithm.py
index a187c0bf2e4fb2b652f0d3ee51492849355c1ca3..77f044dee2ffd9a5b5b08702b94d4af9dbf34bf0 100644
--- a/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigCaloMonitoring/python/TrigCaloMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigCaloMonitorAlgorithm.py
@@ -499,25 +499,26 @@ if __name__=='__main__':
     log.setLevel(DEBUG)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
 
     # Input
     file = '/afs/cern.ch/work/j/joheinri/public/TestAOD/AOD.pool.root'
-    ConfigFlags.Input.Files = [file]
-    ConfigFlags.Input.isMC = True
+    flags = initConfigFlags()
+    flags.Input.Files = [file]
+    flags.Input.isMC = True
 
     # Output
-    ConfigFlags.Output.HISTFileName = 'TrigCaloMonitorOutput.root'
+    flags.Output.HISTFileName = 'TrigCaloMonitorOutput.root'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigCaloMonitorAcc = TrigCaloMonConfig(ConfigFlags)
+    trigCaloMonitorAcc = TrigCaloMonConfig(flags)
     cfg.merge(trigCaloMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
index 299442ef3397195550b5507e04774d65eefaffbc..4bf509b2f8ffd40c878acad5f1a6c67e47c67291 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigEgammaMonitorAlgorithm.py
@@ -55,23 +55,24 @@ if __name__=='__main__':
     ROOT6Setup()
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
 
     path = '/afs/cern.ch/work/j/jodafons/public/valid_sampleA/valid1.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.AOD.e5112_s3214_d1731_r13252_tid27512952_00'
     path+='/AOD.27512952._000185.pool.root.1'
-    ConfigFlags.Input.Files = [path]
-    ConfigFlags.Input.isMC = True
-    ConfigFlags.Output.HISTFileName = 'TrigEgammaMonitorOutput.root'
+    flags = initConfigFlags()
+    flags.Input.Files = [path]
+    flags.Input.isMC = True
+    flags.Output.HISTFileName = 'TrigEgammaMonitorOutput.root'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigEgammaMonitorAcc = TrigEgammaMonConfig(ConfigFlags)
+    trigEgammaMonitorAcc = TrigEgammaMonConfig(flags)
     cfg.merge(trigEgammaMonitorAcc)
   
 
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/share/RunTrigEgammaMonitoring.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/share/RunTrigEgammaMonitoring.py
index 4b42cea034d1a24609f58dbb2a403cc33722cc11..f63debd4cec063e72f532b5355f0d1a1a910d6ea 100755
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/share/RunTrigEgammaMonitoring.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/share/RunTrigEgammaMonitoring.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 if __name__=='__main__':
@@ -65,12 +65,13 @@ if __name__=='__main__':
   ROOT6Setup()
 
   # Set the Athena configuration flags
-  from AthenaConfiguration.AllConfigFlags import ConfigFlags
+  from AthenaConfiguration.AllConfigFlags import initConfigFlags
+  flags = initConfigFlags()
 
   if args.inputFiles is not None:
-    ConfigFlags.Input.Files = args.inputFiles.split(',')
-  ConfigFlags.Input.isMC = True
-  ConfigFlags.Output.HISTFileName = args.outputFile
+    flags.Input.Files = args.inputFiles.split(',')
+  flags.Input.isMC = True
+  flags.Output.HISTFileName = args.outputFile
 
 
   if args.preExec:
@@ -78,14 +79,14 @@ if __name__=='__main__':
     from AthenaMonitoring.DQConfigFlags import allSteeringFlagsOff
     exec(args.preExec)
 
-  ConfigFlags.lock()
+  flags.lock()
 
 
   # Initialize configuration object, add accumulator, merge, and run.
   from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
   from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-  cfg = MainServicesCfg(ConfigFlags)
-  cfg.merge(PoolReadCfg(ConfigFlags))
+  cfg = MainServicesCfg(flags)
+  cfg.merge(PoolReadCfg(flags))
 
   emulator=None
   if args.emulate:
@@ -105,7 +106,7 @@ if __name__=='__main__':
 
   # create the e/g monitoring tool and add into the component accumulator
   from TrigEgammaMonitoring.TrigEgammaMonitorAlgorithm import TrigEgammaMonConfig
-  trigEgammaMonitorAcc = TrigEgammaMonConfig(ConfigFlags, emulator=emulator)
+  trigEgammaMonitorAcc = TrigEgammaMonConfig(flags, emulator=emulator)
   cfg.merge(trigEgammaMonitorAcc)
 
 
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
index 3d92e68a1fad2a059679ea87f52e024479384790..4c8b5092877d1e361667c2eae446cd80160f8956 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/python/TrigGeneralMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigHLTMonitorAlgorithm.py
@@ -224,19 +224,20 @@ if __name__=='__main__':
     log.setLevel(DEBUG)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
+    flags.Input.isMC = False
+    flags.Output.HISTFileName = 'TrigHLTMonitorOutput.root'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigHLTMonitorAcc = TrigGeneralMonConfig(ConfigFlags)
+    trigHLTMonitorAcc = TrigGeneralMonConfig(flags)
     cfg.merge(trigHLTMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index 2521bcc468c75796fc5fcdc773b0a8f9cb1804c1..759c7934b503a4047149ac9d82f054a30e981e3a 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file MTMonitoring.py
@@ -615,13 +615,12 @@ for var in [ "pt", "eta", "m" ]:
 OnlineScaleMomenta.append("") #Adding this for convenience in the jet matching loop below
 OfflineScaleMomenta.append("")
 
-from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 def TrigJetMonConfig(inputFlags):
 
   # This is the right place to get the info, but the autoconfig of the flag
   # is not yet implemented
-  AthenaMT = ConfigFlags.Trigger.EDMVersion==3
+  AthenaMT = inputFlags.Trigger.EDMVersion==3
 
   # AthenaMT or Legacy
   InputType = 'MT' if AthenaMT else 'Legacy'
@@ -641,7 +640,7 @@ def TrigJetMonConfig(inputFlags):
                                         JetCalibScale=jetcalibscale)
         
         alg.ExtraInputs += [('xAOD::TrigCompositeContainer',
-                             'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+                             'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(inputFlags))]
         cfg.addEventAlgo(alg)
 
   # Match offline to offline jets
@@ -656,7 +655,7 @@ def TrigJetMonConfig(inputFlags):
                                         JetCalibScale=jetcalibscale)
         
         alg.ExtraInputs += [('xAOD::TrigCompositeContainer',
-                             'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+                             'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(inputFlags))]
         cfg.addEventAlgo(alg)
 
   # Match L1 to offline as well as HLT jets
@@ -671,7 +670,7 @@ def TrigJetMonConfig(inputFlags):
               
       alg = CompFactory.JetMatcherAlg(**kwds)
       alg.ExtraInputs += [('xAOD::TrigCompositeContainer',
-                           'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+                           'StoreGateSvc+%s' % getRun3NavigationContainerFromInput(inputFlags))]
       cfg.addEventAlgo(alg)
 
   # The following class will make a sequence, configure algorithms, and link
@@ -681,13 +680,13 @@ def TrigJetMonConfig(inputFlags):
 
   # Loop over L1 jet collections
   for jetcoll in L1JetCollections:
-    l1jetconf = l1JetMonitoringConfig(ConfigFlags,jetcoll,'',True)
+    l1jetconf = l1JetMonitoringConfig(inputFlags,jetcoll,'',True)
     l1jetconf.toAlg(helper)
 
   # Loop over L1 jet chains
   for chain,jetcolls in Chain2L1JetCollDict.items():
     for jetcoll in jetcolls:
-      l1chainconf = l1JetMonitoringConfig(ConfigFlags,jetcoll,chain)
+      l1chainconf = l1JetMonitoringConfig(inputFlags,jetcoll,chain)
       l1chainconf.toAlg(helper)
 
   # Loop over offline jet collections
@@ -1176,15 +1175,17 @@ if __name__=='__main__':
   log.setLevel(INFO)
 
   # Set the Athena configuration flags
-  ConfigFlags.Input.Files = [inputFile]
-  ConfigFlags.Input.isMC = True
-  ConfigFlags.Output.HISTFileName = 'AthenaMTMonitorOutput.root' if AthenaMT else 'LegacyMonitoringOutput.root'
-  ConfigFlags.lock()
+  from AthenaConfiguration.AllConfigFlags import initConfigFlags
+  flags = initConfigFlags()
+  flags.Input.Files = [inputFile]
+  flags.Input.isMC = True
+  flags.Output.HISTFileName = 'AthenaMTMonitorOutput.root' if AthenaMT else 'LegacyMonitoringOutput.root'
+  flags.lock()
 
   # Initialize configuration object, add accumulator, merge, and run.
   from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
   from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-  cfg = MainServicesCfg(ConfigFlags)
+  cfg = MainServicesCfg(flags)
 
   # AthenaMT or Legacy
   InputType = 'MT' if AthenaMT else 'Legacy'
@@ -1196,7 +1197,7 @@ if __name__=='__main__':
     from JetRecConfig.StandardSmallRJets import AntiKt4Truth # import the standard definitions
     # Add the components from our jet reconstruction job
     from JetRecConfig.JetRecConfig import JetRecCfg
-    comp = JetRecCfg(AntiKt4Truth,ConfigFlags)
+    comp = JetRecCfg(AntiKt4Truth,flags)
     cfg.merge(comp)
     # add jets to the output list
     key = "{0}Jets".format(AntiKt4Truth.basename)
@@ -1213,7 +1214,7 @@ if __name__=='__main__':
     AntiKt10EMPFlowCSSKSoftDrop = JetSoftDrop(AntiKt10EMPFlowCSSK,modifiers=standardrecomods+substrmods,ZCut=0.1,Beta=1.0) # standard SoftDrop
     # Add the components from our jet reconstruction job
     from JetRecConfig.JetRecConfig import JetRecCfg
-    comp = JetRecCfg(AntiKt10EMPFlowCSSKSoftDrop,ConfigFlags)
+    comp = JetRecCfg(AntiKt10EMPFlowCSSKSoftDrop,flags)
     cfg.merge(comp)
     # add jets to the output list
     key = "{0}Jets".format(AntiKt10EMPFlowCSSKSoftDrop.basename)
@@ -1223,14 +1224,14 @@ if __name__=='__main__':
   if RunTruth or GenOfflineR10PF:
     # Get the output stream components
     from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-    cfg.merge(OutputStreamCfg(ConfigFlags,"xAOD",ItemList=outputlist))
+    cfg.merge(OutputStreamCfg(flags,"xAOD",ItemList=outputlist))
 
-  cfg.merge(PoolReadCfg(ConfigFlags))
+  cfg.merge(PoolReadCfg(flags))
 
   # The following class will make a sequence, configure algorithms, and link
   # them to GenericMonitoringTools
   from AthenaMonitoring import AthMonitorCfgHelper
-  helper = AthMonitorCfgHelper(ConfigFlags,'TrigJetMonitorAlgorithm')
+  helper = AthMonitorCfgHelper(flags,'TrigJetMonitorAlgorithm')
   cfg.merge(helper.result()) # merge it to add the sequence needed to add matchers
 
   # Match HLT jets to offline jets
@@ -1240,7 +1241,7 @@ if __name__=='__main__':
         scalestring = "_"+jetcalibscale if jetcalibscale != "" else ""
         name = 'Matching_{}{}_{}'.format(hltColl,scalestring,collDict['MatchTo'])
         alg = CompFactory.JetMatcherAlg(name, JetContainerName1=hltColl,JetContainerName2=collDict['MatchTo'],JetCalibScale=jetcalibscale)
-        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(flags))]
         cfg.addEventAlgo(alg,sequenceName='AthMonSeq_TrigJetMonitorAlgorithm') # Add matchers to monitoring alg sequence
 
   # Match offline to offline jets
@@ -1250,7 +1251,7 @@ if __name__=='__main__':
         scalestring = "_"+jetcalibscale if jetcalibscale != "" else ""
         name = 'Matching_{}{}_{}'.format(offjetColl,scalestring,collDict['MatchTo'])
         alg = CompFactory.JetMatcherAlg(name, JetContainerName1=offjetColl,JetContainerName2=collDict['MatchTo'],JetCalibScale=jetcalibscale)
-        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(flags))]
         cfg.addEventAlgo(alg,sequenceName='AthMonSeq_TrigJetMonitorAlgorithm')
 
   # Match L1 to offline as well as HLT jets
@@ -1259,27 +1260,27 @@ if __name__=='__main__':
       if matchjetcoll != 'NONE':
         name = 'Matching_{}_{}'.format(l1jetColl,matchjetcoll)
         alg = CompFactory.JetMatcherAlg(name, L1JetContainerName1=l1jetColl,JetContainerName2=matchjetcoll,MatchL1=True)
-        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(ConfigFlags))]
+        alg.ExtraInputs += [('xAOD::TrigCompositeContainer','StoreGateSvc+%s' % getRun3NavigationContainerFromInput(flags))]
         cfg.addEventAlgo(alg,sequenceName='AthMonSeq_TrigJetMonitorAlgorithm')
   
   # Loop over L1 jet collectoins
   for jetcoll in L1JetCollections:
-    l1jetconf = l1JetMonitoringConfig(ConfigFlags,jetcoll,'',True)
+    l1jetconf = l1JetMonitoringConfig(flags,jetcoll,'',True)
     l1jetconf.toAlg(helper)
 
   # Loop over L1 jet chains
   for chain,jetcoll in Chain2L1JetCollDict.items():
-    l1chainconf = l1JetMonitoringConfig(ConfigFlags,jetcoll,chain)
+    l1chainconf = l1JetMonitoringConfig(flags,jetcoll,chain)
     l1chainconf.toAlg(helper)
 
   # Loop over offline jet collections
   for jetcoll in OfflineJetCollections:
-    offlineMonitorConf = jetMonitoringConfig(ConfigFlags,jetcoll,AthenaMT)
+    offlineMonitorConf = jetMonitoringConfig(flags,jetcoll,AthenaMT)
     offlineMonitorConf.toAlg(helper)
 
   # Loop over HLT jet collections
   for jetcoll in JetCollections[InputType]:
-    monitorConf = jetMonitoringConfig(ConfigFlags,jetcoll,AthenaMT)
+    monitorConf = jetMonitoringConfig(flags,jetcoll,AthenaMT)
     # then we turn the full specification into properly configured algorithm and tools.
     # we use the method 'toAlg()' defined for the specialized dictionnary 'JetMonAlgSpec'
     monitorConf.toAlg(helper)
@@ -1289,13 +1290,13 @@ if __name__=='__main__':
     jetcoll = chainDict['HLTColl']
     # kinematic plots
     if AthenaMT:
-      chainMonitorConfT = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,True)
+      chainMonitorConfT = jetChainMonitoringConfig(flags,jetcoll,chain,AthenaMT,True)
       chainMonitorConfT.toAlg(helper)
-    chainMonitorConfF = jetChainMonitoringConfig(ConfigFlags,jetcoll,chain,AthenaMT,False)
+    chainMonitorConfF = jetChainMonitoringConfig(flags,jetcoll,chain,AthenaMT,False)
     chainMonitorConfF.toAlg(helper)
     # efficiency plots
     if chainDict['RefChain'] != 'NONE' and chainDict['OfflineColl'] != 'NONE':
-      effMonitorConf = jetEfficiencyMonitoringConfig(ConfigFlags, jetcoll,
+      effMonitorConf = jetEfficiencyMonitoringConfig(flags, jetcoll,
                                                      chainDict['OfflineColl'], chain,
                                                      chainDict['RefChain'], AthenaMT)
       effMonitorConf.toAlg(helper)
diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
index a6c63820030707c3839eccf80a4e966e6a9674c8..3a0b0dbea2b9c06bdfdf2ed05ed0f40e83ba5496 100644
--- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigMETMonitoringAlgorithm.py
@@ -857,22 +857,23 @@ if __name__=='__main__':
     log.setLevel(DEBUG)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
     file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.isMC = True
-    ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root'
+    flags = initConfigFlags()
+    flags.Input.Files = [nightly+file]
+    flags.Input.isMC = True
+    flags.Output.HISTFileName = 'TrigMETMonitorOutput.root'
 
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigMETMonitorAcc = TrigMETMonConfig(ConfigFlags)
+    trigMETMonitorAcc = TrigMETMonConfig(flags)
     cfg.merge(trigMETMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigAFPSidHypoMonitoring.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigAFPSidHypoMonitoring.py
index 71ebaa2c8d45177a79a6584d0d328877c6346140..e11d28e569ec6c765fae7b4bf592f0e7cc115bd4 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigAFPSidHypoMonitoring.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigAFPSidHypoMonitoring.py
@@ -1,4 +1,4 @@
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 
 def TrigAFPSidHypoMonitoring(configFlags):
     from AthenaMonitoring import AthMonitorCfgHelper
@@ -23,18 +23,19 @@ if __name__ == '__main__':
     # Setup logs
     from AthenaCommon.Constants import DEBUG
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
 
-    ConfigFlags.Output.HISTFileName = 'TestMonitorOutput.root'
-    ConfigFlags.fillFromArgs()
-    ConfigFlags.lock()
+    flags.Output.HISTFileName = 'TestMonitorOutput.root'
+    flags.fillFromArgs()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(TrigAFPSidHypoMonitoring(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
+    cfg.merge(TrigAFPSidHypoMonitoring(flags))
 
     cfg.getEventAlgo('TrigAFPSidHypoMonitoring').OutputLevel = DEBUG
     cfg.printConfig(withDetails=True)  # set True for exhaustive info
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigExclMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigExclMonitoringMT.py
index d24fe8ca245885b4f5a3e13f4f2014711eaf972a..c8ebfd5f07343a84cc3332f8d1305c1b9c7e5957 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigExclMonitoringMT.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigExclMonitoringMT.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 """
@@ -66,25 +66,26 @@ def TrigExcl(configFlags):
 
 if __name__ == "__main__":
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.DQ.Environment = "AOD"
-    ConfigFlags.Concurrency.NumConcurrentEvents = 5
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
+    flags.DQ.Environment = "AOD"
+    flags.Concurrency.NumConcurrentEvents = 5
 
-    ConfigFlags.Output.HISTFileName = "TestExclMonitorOutput.root"
-    ConfigFlags.fillFromArgs()
+    flags.Output.HISTFileName = "TestExclMonitorOutput.root"
+    flags.fillFromArgs()
     from AthenaCommon.Logging import logging
     log = logging.getLogger(__name__)
-    log.info("Input %s", str(ConfigFlags.Input.Files))
-    ConfigFlags.lock()
+    log.info("Input %s", str(flags.Input.Files))
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 
-    cfg = MainServicesCfg(ConfigFlags)
+    cfg = MainServicesCfg(flags)
 
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(TrigExcl(ConfigFlags)) # for local testing save reference histograms
+    cfg.merge(PoolReadCfg(flags))
+    cfg.merge(TrigExcl(flags)) # for local testing save reference histograms
 
     # If you want to turn on more detailed messages ...
     from AthenaCommon.Constants import DEBUG
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMBTSMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMBTSMonitoringMT.py
index bbb18c8c4b7e0cc6143197155946fb7eee8e125f..e017efc7dae09195bd170f0b7b0f73e5c7ee43ad 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMBTSMonitoringMT.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMBTSMonitoringMT.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''
@@ -75,18 +75,19 @@ if __name__ == '__main__':
     # Setup logs
     from AthenaCommon.Constants import DEBUG
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
 
-    ConfigFlags.Output.HISTFileName = 'TestMBTSMonitorOutput.root'
-    ConfigFlags.fillFromArgs()
-    ConfigFlags.lock()
+    flags = initConfigFlags()
+    flags.Output.HISTFileName = 'TestMBTSMonitorOutput.root'
+    flags.fillFromArgs()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(TrigMBTS(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
+    cfg.merge(TrigMBTS(flags))
 
     cfg.getEventAlgo('HLTMBTSMonitoringAlgMT').OutputLevel = DEBUG  # DEBUG
     cfg.printConfig(withDetails=True)  # set True for exhaustive info
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasEffMonitoring.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasEffMonitoring.py
index 5942d8a132a96f990765300ce6590c078f1c9001..cce991286584d8b0c432ac33c053cfe63e795e35 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasEffMonitoring.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasEffMonitoring.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''
@@ -168,17 +168,18 @@ def TrigMinBiasEff(flags):
 
 if __name__ == '__main__':
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.Output.HISTFileName = 'TestMinBiasMonitorOutput.root'
-    ConfigFlags.fillFromArgs()
-    ConfigFlags.lock()
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
+    flags.Output.HISTFileName = 'TestMinBiasMonitorOutput.root'
+    flags.fillFromArgs()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(TrigMinBiasEff(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
+    cfg.merge(TrigMinBiasEff(flags))
 
 
     #    cfg.getEventAlgo('HLTMinBiasEffMonitoringAlg').OutputLevel = DEBUG  # DEBUG
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringMT.py
index a761c19fd2e642ab74a67449e32aada2db265dcd..16bcf64dc0c428b55032f9d59a86d41e8fe09506 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringMT.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigMinBiasMonitoringMT.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 """
@@ -25,8 +25,9 @@ def TrigMinBias(configFlags):
 
 
 if __name__ == "__main__":
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
 
+    flags = initConfigFlags()
     flags.DQ.Environment = "AOD"
     flags.Output.HISTFileName = 'TestMinBiasMonitorOutput.root'
     from AthenaConfiguration.TestDefaults import defaultTestFiles
diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
index ac805d1e0e249e7d906ffa8ed97eb7d5e08edca2..11e536903d00e521c67222aa9b18a5d9cb786c49 100644
--- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
+++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 """
@@ -155,25 +155,26 @@ def TrigSPTRK(configFlags, highGranularity=False):
 
 if __name__ == "__main__":
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.DQ.Environment = "AOD"
-    ConfigFlags.Concurrency.NumConcurrentEvents = 5
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
+    flags.DQ.Environment = "AOD"
+    flags.Concurrency.NumConcurrentEvents = 5
 
-    ConfigFlags.Output.HISTFileName = "TestMonitorOutput.root"
-    ConfigFlags.fillFromArgs()
+    flags.Output.HISTFileName = "TestMonitorOutput.root"
+    flags.fillFromArgs()
     from AthenaCommon.Logging import logging
     log = logging.getLogger(__name__)
-    log.info("Input %s", str(ConfigFlags.Input.Files))
-    ConfigFlags.lock()
+    log.info("Input %s", str(flags.Input.Files))
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 
-    cfg = MainServicesCfg(ConfigFlags)
+    cfg = MainServicesCfg(flags)
 
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(TrigSPTRK(ConfigFlags, highGranularity=True)) # for local testing have very granular histograms
+    cfg.merge(PoolReadCfg(flags))
+    cfg.merge(TrigSPTRK(flags, highGranularity=True)) # for local testing have very granular histograms
 
     # If you want to turn on more detailed messages ...
     #    from AthenaCommon.Constants import DEBUG
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoring_options.py b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoring_options.py
index 2b96ccb74b88d31c88d809c711a7b60485060f85..ec9aa80d47d3956fdc755df6564bdb1afca850ed 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoring_options.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoring/python/TrigMuonMonitoring_options.py
@@ -1,4 +1,4 @@
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 
 
 from TrigMuonMonitoring.TrigMuonMonitoringConfig import TrigMuonMonConfig
@@ -7,21 +7,22 @@ from TrigMuonMonitoring.TrigMuonMonitoringConfig import TrigMuonMonConfig
 
 if __name__=='__main__':     
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
     aodfile = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    ConfigFlags.Input.Files = [nightly+aodfile]
-    ConfigFlags.Input.isMC = True
-    ConfigFlags.Output.HISTFileName = 'HIST.root'
+    flags = initConfigFlags()
+    flags.Input.Files = [nightly+aodfile]
+    flags.Input.isMC = True
+    flags.Output.HISTFileName = 'HIST.root'
 
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
-    muonMonitorAcc = TrigMuonMonConfig(ConfigFlags)
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
+    muonMonitorAcc = TrigMuonMonConfig(flags)
     cfg.merge(muonMonitorAcc)
 
     cfg.printConfig(withDetails=False)
diff --git a/Trigger/TrigMonitoring/TrigTLAMonitoring/python/TrigTLAMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigTLAMonitoring/python/TrigTLAMonitorAlgorithm.py
index 5dcb98028615865eee66751b4327c6b6365be964..93214c001dd9dabbaae4ccfc102a7c0250e812a8 100644
--- a/Trigger/TrigMonitoring/TrigTLAMonitoring/python/TrigTLAMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigTLAMonitoring/python/TrigTLAMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file TrigTLAMonitorAlgorithm.py
@@ -401,31 +401,32 @@ if __name__=='__main__':
     # log.setLevel(INFO)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
+    flags = initConfigFlags()
 
     # Set execute flags (number of events to process)
-    ConfigFlags.Exec.MaxEvents = args.nevents
+    flags.Exec.MaxEvents = args.nevents
 
     # Input files (AOD or other files, e.g. costumized RAW file, to be defined 
-    ConfigFlags.Input.Files = [args.input]
-    ConfigFlags.Input.isMC = not args.data
+    flags.Input.Files = [args.input]
+    flags.Input.isMC = not args.data
 
     # Output file (root)
-    ConfigFlags.Output.HISTFileName = 'TrigTLAMonitorOutput.root'
+    flags.Output.HISTFileName = 'TrigTLAMonitorOutput.root'
 
-    # ConfigFlags.Trigger.triggerMenuSetup="Physics_pp_v7_primaries"
-    ConfigFlags.Trigger.triggerMenuSetup = 'Physics_pp_run3_v1'
-    ConfigFlags.Trigger.triggerConfig = 'DB'                   
+    # flags.Trigger.triggerMenuSetup="Physics_pp_v7_primaries"
+    flags.Trigger.triggerMenuSetup = 'Physics_pp_run3_v1'
+    flags.Trigger.triggerConfig = 'DB'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigTLAMonitorAcc = TrigTLAMonConfig(ConfigFlags)
+    trigTLAMonitorAcc = TrigTLAMonConfig(flags)
     cfg.merge(trigTLAMonitorAcc)
 
     # If you want to turn on more detailed messages ...
diff --git a/Trigger/TrigMonitoring/TrigTLAMonitoring/python/decodeBS_TLA_AOD.py b/Trigger/TrigMonitoring/TrigTLAMonitoring/python/decodeBS_TLA_AOD.py
index a243f5db5e6e3551109424e5e512346cf2b8930a..4cfb377890ad6c1344f55cfbd2f65131f23ad5eb 100644
--- a/Trigger/TrigMonitoring/TrigTLAMonitoring/python/decodeBS_TLA_AOD.py
+++ b/Trigger/TrigMonitoring/TrigTLAMonitoring/python/decodeBS_TLA_AOD.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 from AthenaConfiguration.ComponentFactory import CompFactory
@@ -88,21 +88,22 @@ def setupDecodeCfgCA(flags):
 
 if __name__ == "__main__":
    
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
 
     args = GetCustomAthArgs()
+    flags = initConfigFlags()
 
     # Setup custom input file
-    ConfigFlags.Input.Files = args.filesInput
+    flags.Input.Files = args.filesInput
 
-    ConfigFlags.Trigger.triggerConfig = "DB"
-    ConfigFlags.Input.isMC = False
+    flags.Trigger.triggerConfig = "DB"
+    flags.Input.isMC = False
 
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # setup CA 
-    cfg = setupDecodeCfgCA(ConfigFlags)
+    cfg = setupDecodeCfgCA(flags)
 
     # Execute
     import sys
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitorAlgorithm.py
index 5b453906186a97c9756509a3396e962327e71f02..fb9d0ba21a8cea33f00bf2cfc696f02e2e8503b7 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitorAlgorithm.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 #
 
 def TrigTauMonConfig(inputFlags):
@@ -29,22 +29,23 @@ if __name__=='__main__':
     log.setLevel(DEBUG)
 
     # Set the Athena configuration flags
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.AllConfigFlags import initConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
     file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
-    ConfigFlags.Input.Files = [nightly+file]
-    ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'TrigTauMonitorOutput.root'
+    flags = initConfigFlags()
+    flags.Input.Files = [nightly+file]
+    flags.Input.isMC = False
+    flags.Output.HISTFileName = 'TrigTauMonitorOutput.root'
     
-    ConfigFlags.lock()
+    flags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg 
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    cfg = MainServicesCfg(ConfigFlags)
-    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg = MainServicesCfg(flags)
+    cfg.merge(PoolReadCfg(flags))
 
-    trigTauMonitorAcc = TrigTauMonConfig(ConfigFlags)
+    trigTauMonitorAcc = TrigTauMonConfig(flags)
     cfg.merge(trigTauMonitorAcc)
 
     # If you want to turn on more detailed messages ...