diff --git a/Event/EventBookkeeperTools/CMakeLists.txt b/Event/EventBookkeeperTools/CMakeLists.txt index 499dae3bd4a3a6f97ad786410043ea4fad920e5a..1ce5b56d3970485a436af39f11234534a89ebb7c 100644 --- a/Event/EventBookkeeperTools/CMakeLists.txt +++ b/Event/EventBookkeeperTools/CMakeLists.txt @@ -69,4 +69,14 @@ if( NOT XAOD_STANDALONE ) SCRIPT athena EventBookkeeperTools/TestCutFlowSvcOutput.py PROPERTIES TIMEOUT 300 POST_EXEC_SCRIPT nopost.sh ) + + atlas_add_test( CutFlowSvcOutputMT + SCRIPT athena EventBookkeeperTools/TestCutFlowSvcOutput.py --threads=2 + PROPERTIES TIMEOUT 300 + POST_EXEC_SCRIPT nopost.sh ) + + atlas_add_test( CutFlowSvcOutputMP + SCRIPT athena EventBookkeeperTools/TestCutFlowSvcOutput.py --nprocs=2 + PROPERTIES TIMEOUT 300 + POST_EXEC_SCRIPT nopost.sh ) endif() diff --git a/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py b/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py index 311c938002af6d53899c1a033a6640fe53b6236a..e6f2f6c99b2f6b17b80d5f711f434d63fc26f111 100644 --- a/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py +++ b/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py @@ -1,20 +1,24 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # setup the input from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if 'inputFiles' in dir(): - athenaCommonFlags.FilesInput = inputFiles.split(',') + athenaCommonFlags.FilesInput = inputFiles.split(',') # noqa: F821 del inputFiles else: athenaCommonFlags.FilesInput = [ '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1' ] +# get a handle to the ApplicationManager +from AthenaCommon.AppMgr import theApp theApp.EvtMax = 10 +# setup basic sequencing from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() +# setup old EventInfo conversion from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg topSequence += xAODMaker__EventInfoCnvAlg() diff --git a/Event/EventBookkeeperTools/share/TestCutFlowSvcOutput.py b/Event/EventBookkeeperTools/share/TestCutFlowSvcOutput.py index a4cce5c7e9054816ea389bb13dd65eeea740bc9c..adf6506b2c8eb0eec6afea92fcb1c45eac895347 100644 --- a/Event/EventBookkeeperTools/share/TestCutFlowSvcOutput.py +++ b/Event/EventBookkeeperTools/share/TestCutFlowSvcOutput.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ############################################################### # # Minimal athena options to execute the CutFlowSvc with algorithms @@ -12,16 +12,17 @@ #============================================================== # debug logging +from AthenaCommon.Constants import DEBUG from AthenaCommon.Logging import logging logging.getLogger('CreateCutFlowSvc').setLevel(DEBUG) # basic job configuration -import AthenaCommon.AtlasUnixStandardJob +import AthenaCommon.AtlasUnixStandardJob # noqa: F401 # setup the input from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if 'inputFiles' in dir(): - athenaCommonFlags.FilesInput = inputFiles.split(',') + athenaCommonFlags.FilesInput = inputFiles.split(',') # noqa: F821 del inputFiles else: athenaCommonFlags.FilesInput = [ @@ -39,7 +40,7 @@ from AthenaCommon.AppMgr import ServiceMgr, ToolSvc from AthenaCommon.AppMgr import theApp # load POOL support -import AthenaPoolCnvSvc.ReadAthenaPool +import AthenaPoolCnvSvc.ReadAthenaPool # noqa: F401 # setup some configuration from RecExConfig.RecFlags import rec diff --git a/Event/EventBookkeeperTools/test/test_BookkeeperDumperTool.py b/Event/EventBookkeeperTools/test/test_BookkeeperDumperTool.py index e1b5f6b6ee214d97edd5dba9c485bde39f1cfc70..824a05546f23e90125230a9754f926f663b72e63 100755 --- a/Event/EventBookkeeperTools/test/test_BookkeeperDumperTool.py +++ b/Event/EventBookkeeperTools/test/test_BookkeeperDumperTool.py @@ -15,8 +15,8 @@ from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from EventBookkeeperTools.EventBookkeeperToolsConfig import BookkeeperDumperToolCfg # Argument parsing -parser = ArgumentParser(prog='dump-cbk') -parser.add_argument('input', metavar='input', type=str, nargs='?', +parser = ArgumentParser(prog='test_BookkeeperDumpertool') +parser.add_argument('input', type=str, nargs='?', help='Specify the input file') args = parser.parse_args() diff --git a/Event/EventBookkeeperTools/test/test_CutFlowSvc.py b/Event/EventBookkeeperTools/test/test_CutFlowSvc.py index 26403c15b12d9bd714b67a5a4480b67699a61ec1..9f54cc7e543b537f3443dc6dda1355c2c08a5fdc 100755 --- a/Event/EventBookkeeperTools/test/test_CutFlowSvc.py +++ b/Event/EventBookkeeperTools/test/test_CutFlowSvc.py @@ -17,8 +17,8 @@ from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from EventBookkeeperTools.EventBookkeeperToolsConfig import CutFlowSvcCfg, CutFlowOutputList # Argument parsing -parser = ArgumentParser(prog='dump-cbk') -parser.add_argument('input', metavar='input', type=str, nargs='?', +parser = ArgumentParser(prog='test_CutFlowSvc') +parser.add_argument('input', type=str, nargs='?', help='Specify the input file') args = parser.parse_args() @@ -44,6 +44,11 @@ ConfigFlags.lock() # Setup service acc = MainServicesCfg(ConfigFlags) acc.merge(PoolReadCfg(ConfigFlags)) + +if 'EventInfo' not in ConfigFlags.Input.Collections: + from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg + acc.merge(EventInfoCnvAlgCfg(ConfigFlags, disableBeamSpot=True)) + acc.merge(CutFlowSvcCfg(ConfigFlags)) acc.addEventAlgo(CompFactory.TestFilterReentrantAlg("TestReentrant1", FilterKey="TestReentrant1", Modulo=2)) acc.addEventAlgo(CompFactory.TestFilterReentrantAlg("TestReentrant2", FilterKey="TestReentrant2", Modulo=4))