5 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
6 from AthenaCommon.Logging
import logging
12 @brief Configures and returns the TrigDecisionTool (TDT) for use in Athena-MT.
13 The TDT uses a Tool interface such that it can be used in either Athena or AnalysisBase releases.
14 The manages an MT-safe internal state, hence we should only have one instance of it configured in any job.
15 It is thus one of the few places where it OK to use a PublicTool in Athena-MT.
17 Obtain the configured public tool instance by calling getPrimary()
18 on the ComponentAccumulator returned by this function, or by calling
19 getPublicTool('TrigDecisionTool') or getPrimaryAndMerge()
20 on any downstream merged ComponentAccumulator.
23 When running in AnalysisBase, the tdt.TrigConfigTool='TrigConf::xAODConfigTool' should be used
24 in place of the TrigConf::xAODConfigSvc
26 msg = logging.getLogger(
'TrigDecisionToolCfg')
27 from AthenaConfiguration.ComponentFactory
import CompFactory
28 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
29 from AthenaConfiguration.Enums
import Format, Project
32 from TrigConfxAOD.TrigConfxAODConfig
import getxAODConfigSvc
35 tdt = CompFactory.Trig.TrigDecisionTool(
'TrigDecisionTool')
36 tdt.TrigConfigSvc = cfgsvc
37 use_run3_format = flags.Trigger.EDMVersion >= 3
38 tdt.NavigationFormat =
'TrigComposite' if use_run3_format
else 'TriggerElement'
41 if flags.Input.Format
is Format.BS
and flags.Trigger.EDMVersion
in [1, 2]:
42 tdt.UseAODDecision =
True
44 if flags.Common.Project
is not Project.AthAnalysis:
47 from TrigEDMConfig.TriggerEDM
import EDMLibraries
48 nav = CompFactory.HLT.Navigation(
'Navigation')
49 nav.Dlls = [e
for e
in EDMLibraries
if 'TPCnv' not in e]
51 acc.addPublicTool(nav)
53 acc.addPublicTool(tdt, primary=
True)
55 msg.info(
'Configuring the TrigDecisionTool and xAODConfigSvc to use ConfigSource: %s, Run3NavigationFormat: %s, Run3NavigationSummaryCollection: %s',
56 'InFileMetadata' if flags.Trigger.triggerConfig ==
'INFILE' else 'ConditionsAndDetStore',
64 from TrigDecisionTool.TrigDecisionToolHelpers
import (
65 getRun3NavigationContainerFromInput_forAnalysisBase)
69 if __name__ ==
'__main__':
70 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
71 from AthenaConfiguration.TestDefaults
import defaultTestFiles
75 if '--RAWRUN2' in sys.argv:
76 flags.Input.Files = defaultTestFiles.RAW_RUN2
78 flags.Input.Files = defaultTestFiles.AOD_RUN2_DATA
83 acc.printConfig(withDetails=
True, summariseProps=
True, prefix=
'UnitTest')