diff --git a/Reconstruction/egamma/egammaConfig/CMakeLists.txt b/Reconstruction/egamma/egammaConfig/CMakeLists.txt index 9d4d5dcce0d9c107cfec1d37774fc370b06dea4b..4aeef28b705bb58d84ae15754aa481d73b1b0e31 100644 --- a/Reconstruction/egamma/egammaConfig/CMakeLists.txt +++ b/Reconstruction/egamma/egammaConfig/CMakeLists.txt @@ -16,10 +16,6 @@ atlas_add_test( egammaReconstructionConfigTest SCRIPT python -m egammaConfig.egammaReconstructionConfig POST_EXEC_SCRIPT nopost.sh ) -atlas_add_test( egammaUpstreamConfigTest - SCRIPT python -m egammaConfig.egammaUpstreamConfig - POST_EXEC_SCRIPT nopost.sh ) - atlas_add_test( egammaxAODThinningConfigTest SCRIPT python -m egammaConfig.egammaxAODThinningConfig POST_EXEC_SCRIPT nopost.sh ) @@ -30,4 +26,4 @@ atlas_add_test( egammaSteeringConfigTest atlas_add_test( egammaLRTReconstructionConfigTest SCRIPT python -m egammaConfig.egammaLRTReconstructionConfig - POST_EXEC_SCRIPT nopost.sh ) \ No newline at end of file + POST_EXEC_SCRIPT nopost.sh ) diff --git a/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py index fb64008815dadf407899d9539a31d3d8a09419b0..3f07f9af613b0ea9232d28e3034fb0bd1825f9cb 100644 --- a/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py +++ b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py @@ -1,6 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -# this is based on MuonConfigFlags as a guide +# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration import unittest from AthenaConfiguration.AthConfigFlags import AthConfigFlags @@ -155,7 +153,7 @@ def createEgammaConfigFlags(): egcf.addFlag("Egamma.Keys.Output.EgammaLargeFWDClusters", 'egamma66FWDClusters') egcf.addFlag("Egamma.Keys.Output.EgammaLargeFWDClustersSuppESD", '') - + return egcf diff --git a/Reconstruction/egamma/egammaConfig/python/egammaSteeringConfig.py b/Reconstruction/egamma/egammaConfig/python/egammaSteeringConfig.py index 71bd11958c874c5e4eb4b27efda9769760d37882..2b8c854b2344bd6ccec42cfbb1fcc790228aff9c 100644 --- a/Reconstruction/egamma/egammaConfig/python/egammaSteeringConfig.py +++ b/Reconstruction/egamma/egammaConfig/python/egammaSteeringConfig.py @@ -13,20 +13,13 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator def EGammaSteeringCfg(flags, - name="EGammaSteering", - doAllUpstream=False): + name="EGammaSteering"): mlog = logging.getLogger(name) mlog.info('Starting EGamma Steering') acc = ComponentAccumulator() - # upstream the main egamma reconstruction - from egammaConfig.egammaUpstreamConfig import ( - egammaUpstreamCfg) - acc.merge(egammaUpstreamCfg(flags, - doAll=doAllUpstream)) - # e/gamma main Reconstruction from egammaConfig.egammaReconstructionConfig import ( egammaReconstructionCfg) diff --git a/Reconstruction/egamma/egammaConfig/python/egammaUpstreamConfig.py b/Reconstruction/egamma/egammaConfig/python/egammaUpstreamConfig.py deleted file mode 100644 index 31c88f64cdd26cc853c57ac4dafc30ba77a2b61d..0000000000000000000000000000000000000000 --- a/Reconstruction/egamma/egammaConfig/python/egammaUpstreamConfig.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - -__doc__ = """ - Instantiate things needed upstream the main egamma Reconstruction, - could be all systems or just egamma related things - (doAll default false). - """ - -from AthenaCommon.Logging import logging -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - - -def egUpstreamSystemCfg(flags, - name="egUpstreamSystem"): - - mlog = logging.getLogger(name) - mlog.info('EGamma All Upstream Systems configs requested') - acc = ComponentAccumulator() - # AOD2xAOD Truth conversion - if flags.Input.isMC: - from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg - acc.merge(GEN_AOD2xAODCfg(flags)) - - # calorimeter - if flags.Detector.EnableCalo: - from CaloRec.CaloRecoConfig import CaloRecoCfg - acc.merge(CaloRecoCfg(flags)) - - # ID / ITk - if flags.Reco.EnableTracking: - from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg - acc.merge(InDetTrackRecoCfg(flags)) - - return acc - - -def egammaUpstreamCfg(flags, - doAll=False, - name="EGammaUpstream"): - - mlog = logging.getLogger(name) - mlog.info('Starting EGamma Upstream configuration') - - acc = ComponentAccumulator() - - # In case we want to redo calo/tracking - # from e/gamma config - if doAll: - acc.merge(egUpstreamSystemCfg(flags)) - - # egamma selected/copied topo clusters - if flags.Detector.EnableCalo: - from egammaAlgs.egammaTopoClusterCopierConfig import ( - egammaTopoClusterCopierCfg) - acc.merge(egammaTopoClusterCopierCfg(flags)) - - # This is not a direct dependency - if not flags.Input.isMC: - from LumiBlockComps.LumiBlockMuWriterConfig import ( - LumiBlockMuWriterCfg) - acc.merge(LumiBlockMuWriterCfg(flags)) - - mlog.info("EGamma upstream configured") - - return acc - - -if __name__ == "__main__": - from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags - from AthenaConfiguration.TestDefaults import defaultTestFiles - from AthenaConfiguration.MainServicesConfig import MainServicesCfg - flags.Input.Files = defaultTestFiles.RDO_RUN2 - flags.lock() - - acc = MainServicesCfg(flags) - acc.merge(egammaUpstreamCfg(flags, doAll=True)) - acc.printConfig(withDetails=True, - printDefaults=True) - - with open("egammareconstructionconfig.pkl", "wb") as f: - acc.store(f) diff --git a/Reconstruction/egamma/egammaConfig/python/runEgammaOnly.py b/Reconstruction/egamma/egammaConfig/python/runEgammaOnly.py new file mode 100644 index 0000000000000000000000000000000000000000..eff7ca634d0b80d9a2bc9c0494307cba4fb4e573 --- /dev/null +++ b/Reconstruction/egamma/egammaConfig/python/runEgammaOnly.py @@ -0,0 +1,49 @@ +# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + +# Simple script to run a +# Calo/Tracking/Egamma job +# +# Usefull for quick testing +# run with +# +# athena --CA runEgammaOnly.py + +import sys + + +def _run(): + from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags + # input + from AthenaConfiguration.TestDefaults import defaultTestFiles + flags.Exec.MaxEvents = 20 + flags.Input.Files = defaultTestFiles.RDO_RUN2 + from AthenaConfiguration.Enums import ProductionStep + flags.Common.ProductionStep = ProductionStep.Reconstruction + + # output + flags.Output.ESDFileName = "myESD.pool.root" + flags.Output.AODFileName = "myAOD.pool.root" + + # egamma Only + from egammaConfig.egammaOnlyFromRawFlags import egammaOnlyFromRaw + egammaOnlyFromRaw(flags) + + flags.lock() + flags.dump() + + from RecJobTransforms.RecoSteering import RecoSteering + acc = RecoSteering(flags) + + from AthenaConfiguration.Utils import setupLoggingLevels + setupLoggingLevels(flags, acc) + + # running + statusCode = acc.run() + return statusCode + + +if __name__ == "__main__": + statusCode = None + statusCode = _run() + assert statusCode is not None, "Issue while running" + sys.exit(not statusCode.isSuccess())