ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TriggerCommon
TriggerMenuMT
scripts
test_HLTmenu.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
4
"""Standalone menu generation in CA mode"""
5
6
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
7
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
8
from
AthenaConfiguration.AccumulatorCache
import
AccumulatorDecorator
9
from
TriggerJobOpts
import
runHLT
10
11
# Prevent usage of legacy job properties
12
from
AthenaCommon
import
JobProperties
13
JobProperties.jobPropertiesDisallowed =
True
14
15
# Set flags
16
flags = initConfigFlags()
17
runHLT.set_flags(flags)
18
flags.Trigger.generateMenuDiagnostics =
False
19
flags.Common.isOnline =
True
# online environment
20
flags.Input.Files = []
# menu cannot depend on input files
21
22
flags.fillFromArgs()
23
flags.lock()
24
25
# Set the Python OutputLevel on the root logger (usually done in MainServicesCfg)
26
from
AthenaCommon.Logging
import
log
27
log.setLevel(flags.Exec.OutputLevel)
28
29
from
TriggerMenuMT.HLT.Config.GenerateMenuMT
import
generateMenuMT
30
acc = ComponentAccumulator()
31
menu = generateMenuMT(flags)
32
acc.merge(menu)
33
34
with
open(flags.Trigger.triggerMenuSetup+
".pkl"
,
"wb"
)
as
f:
35
acc.store(f)
36
AccumulatorDecorator.printStats()
37
38
# Run menu verification
39
import
os, sys, subprocess
40
sys.stdout.flush()
41
rc = subprocess.call(
"verify_menu_config.py --folder "
+ os.getcwd(), shell=
True
)
42
if
rc != 0:
43
log.error(
"Menu verification failed"
)
44
sys.exit(rc)
Generated on
for ATLAS Offline Software by
1.17.0