TRTOverlayConfig_test.py 1.4 KB
Newer Older
1
2
3
#!/usr/bin/env python
"""Run tests on TRTOverlayConfig.py

4
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5
6
7
8
9
"""
import sys

from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.AllConfigFlags import ConfigFlags
10
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
11
12
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from InDetOverlay.TRTOverlayConfig import TRTOverlayCfg
13
from OverlayConfiguration.OverlayTestHelpers import \
14
    CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
15
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
16
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
17
18
19
20

# Configure
Configurable.configurableRun3Behavior = True

21
22
23
24
25
# Argument parsing
parser = CommonTestArgumentParser("TRTOverlayConfig_test.py")
args = parser.parse_args()

# Configure
26
defaultTestFlags(ConfigFlags, args)
27
postprocessAndLockFlags(ConfigFlags, args)
28
29

# Construct our accumulator to run
30
acc = MainServicesCfg(ConfigFlags)
31
32
acc.merge(PoolReadCfg(ConfigFlags))

33
34
# Add event and truth overlay (needed downstream)
acc.merge(EventInfoOverlayCfg(ConfigFlags))
35
36
37
38
39
acc.merge(CopyMcEventCollectionCfg(ConfigFlags))

# Add TRT overlay
acc.merge(TRTOverlayCfg(ConfigFlags))

40
41
42
43
# Dump the pickle
with open("TRTOverlayCfg.pkl", "wb") as f:
    acc.store(f)

44
45
# Print and run
sys.exit(printAndRun(acc, ConfigFlags, args))