Skip to content
Snippets Groups Projects
Commit 8bad7cca authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Left it up to the CMake code to decide when the unit test should use bramspot information.

All clients will need to set this flag of EventInfoCnvAlgCfg(...) correctly
from now on, otherwise they'll get an import error if they used an incorrect
setting in one of the lightweight offline releases.
parent 2024d094
No related branches found
No related tags found
No related merge requests found
......@@ -22,12 +22,16 @@ atlas_install_python_modules( python/*.py
atlas_install_joboptions( share/*.py )
# Setup and run tests
set( _extraFlags )
if( SIMULATIONBASE OR GENERATIONBASE OR XAOD_ANALYSIS )
set( _extraFlags --noBeamSpot )
endif()
atlas_add_test( EvenInfoCnvConfigTest
SCRIPT test/EventInfoCnv_test.py
SCRIPT test/EventInfoCnv_test.py ${_extraFlags}
PROPERTIES TIMEOUT 300 )
atlas_add_test( EvenInfoCnvConfigTestMT
SCRIPT test/EventInfoCnv_test.py -n 25 -t 3
SCRIPT test/EventInfoCnv_test.py -n 25 -t 3 ${_extraFlags}
PROPERTIES TIMEOUT 300 )
if( NOT SIMULATIONBASE AND NOT GENERATIONBASE AND NOT XAOD_ANALYSIS )
......
......@@ -3,7 +3,6 @@
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
"""
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
......@@ -23,13 +22,8 @@ def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg",
# TODO: luminosity
if not disableBeamSpot:
try:
from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
acc.merge(BeamSpotCondAlgCfg(flags))
except ImportError:
log = logging.getLogger( 'EventInfoCnvAlgCfg' )
log.info( 'BeamSpotConditions not available, not using it' )
pass
from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
acc.merge(BeamSpotCondAlgCfg(flags))
xAODMaker__EventInfoCnvAlg = CompFactory.xAODMaker.EventInfoCnvAlg
alg = xAODMaker__EventInfoCnvAlg(name, **kwargs)
......
......@@ -24,6 +24,7 @@ from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("-n", "--maxEvents", default=3, type=int, help="The number of events to run. 0 skips execution")
parser.add_argument("-t", "--threads", default=1, type=int, help="The number of concurrent threads to run. 0 uses serial Athena.")
parser.add_argument("-b", "--noBeamSpot", default=False, action="store_true", help="Don't try to use beamspot information in the conversion test")
parser.add_argument("-V", "--verboseAccumulators", default=False, action="store_true", help="Print full details of the AlgSequence for each accumulator")
args = parser.parse_args()
......@@ -43,7 +44,7 @@ if args.threads > 0:
ConfigFlags.lock()
# Function tests
accAlg = EventInfoCnvAlgCfg(ConfigFlags)
accAlg = EventInfoCnvAlgCfg(ConfigFlags, disableBeamSpot=args.noBeamSpot)
# reset to prevent errors on deletion
accAlg.__init__()
......@@ -52,7 +53,7 @@ acc = MainServicesCfg(ConfigFlags)
acc.merge(PoolReadCfg(ConfigFlags))
# Add event info overlay
acc.merge(EventInfoCnvAlgCfg(ConfigFlags))
acc.merge(EventInfoCnvAlgCfg(ConfigFlags, disableBeamSpot=args.noBeamSpot))
# Add output
acc.merge(OutputStreamCfg(ConfigFlags, "HITS"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment