ATLAS Offline Software
Functions | Variables
python.TrigDecisionToolConfig Namespace Reference

Functions

def TrigDecisionToolCfg (flags)
 
def getRun3NavigationContainerFromInput (flags)
 

Variables

 possible_keys
 
 flags
 
 Files
 
 acc
 
 withDetails
 
 True
 
 summariseProps
 
 prefix
 

Function Documentation

◆ getRun3NavigationContainerFromInput()

def python.TrigDecisionToolConfig.getRun3NavigationContainerFromInput (   flags)

Definition at line 75 of file TrigDecisionToolConfig.py.

76  # What to return if we cannot look in the file
77  default_key = 'HLTNav_Summary_OnlineSlimmed' if flags.Trigger.doOnlineNavigationCompactification else 'HLTNav_Summary'
78  to_return = default_key
79 
80  if flags.Trigger.doEDMVersionConversion:
81  to_return = 'HLTNav_R2ToR3Summary'
82  else:
83  for key in possible_keys:
84  if key in flags.Input.Collections:
85  to_return = key
86  break
87 
88  msg = logging.getLogger('getRun3NavigationContainerFromInput')
89  msg.info('Returning %s as the Run 3 trigger navigation colletion to read in this job.', to_return)
90 
91  # Double check 'possible_keys' is kept up to date
92  if to_return not in possible_keys:
93  msg.error('Must add %s to the "possible_keys" array!', to_return)
94 
95  return to_return
96 
97 

◆ TrigDecisionToolCfg()

def python.TrigDecisionToolConfig.TrigDecisionToolCfg (   flags)
@brief Configures and returns the TrigDecisionTool (TDT) for use in Athena-MT. 
The TDT uses a Tool interface such that it can be used in either Athena or AnalysisBase releases.
The manages an MT-safe internal state, hence we should only have one instance of it configured in any job.
It is thus one of the few places where it OK to use a PublicTool in Athena-MT.

Obtain the configured public tool instance by calling getPrimary()
on the ComponentAccumulator returned by this function, or by calling
getPublicTool('TrigDecisionTool') or getPrimaryAndMerge()
on any downstream merged ComponentAccumulator.


When running in AnalysisBase, the tdt.TrigConfigTool='TrigConf::xAODConfigTool' should be used 
in place of the TrigConf::xAODConfigSvc

Definition at line 10 of file TrigDecisionToolConfig.py.

10 def TrigDecisionToolCfg(flags):
11  '''
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.
16 
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.
21 
22 
23  When running in AnalysisBase, the tdt.TrigConfigTool='TrigConf::xAODConfigTool' should be used
24  in place of the TrigConf::xAODConfigSvc
25  '''
26  msg = logging.getLogger('TrigDecisionToolCfg')
27  from AthenaConfiguration.ComponentFactory import CompFactory
28  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
29  from AthenaConfiguration.Enums import Format, Project
30  acc = ComponentAccumulator()
31 
32  from TrigConfxAOD.TrigConfxAODConfig import getxAODConfigSvc
33  cfgsvc = acc.getPrimaryAndMerge(getxAODConfigSvc(flags))
34 
35  tdt = CompFactory.Trig.TrigDecisionTool('TrigDecisionTool')
36  tdt.TrigConfigSvc = cfgsvc
37  use_run3_format = flags.Trigger.EDMVersion == 3 # or flags.Trigger.doEDMVersionConversion (to be added when this is working)
38  tdt.NavigationFormat = 'TrigComposite' if use_run3_format else 'TriggerElement'
39  tdt.HLTSummary = getRun3NavigationContainerFromInput(flags)
40 
41  if flags.Input.Format is Format.BS and flags.Trigger.EDMVersion in [1, 2]:
42  tdt.UseAODDecision = True
43 
44  if flags.Common.Project is not Project.AthAnalysis:
45  # Full Athena
46  # This pre-loads libraries required to read the run 2 trigger navigation
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]
50  tdt.Navigation = nav
51  acc.addPublicTool(nav)
52 
53  acc.addPublicTool(tdt, primary=True)
54 
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',
57  str(use_run3_format),
58  tdt.HLTSummary)
59 
60  return acc
61 
62 
63 # List of all possible keys of the Run 3 navigation summary collection
64 # in order of verbosity. Want to take the most verbose which is available.

Variable Documentation

◆ acc

python.TrigDecisionToolConfig.acc

Definition at line 111 of file TrigDecisionToolConfig.py.

◆ Files

python.TrigDecisionToolConfig.Files

Definition at line 105 of file TrigDecisionToolConfig.py.

◆ flags

python.TrigDecisionToolConfig.flags

Definition at line 103 of file TrigDecisionToolConfig.py.

◆ possible_keys

python.TrigDecisionToolConfig.possible_keys

Definition at line 65 of file TrigDecisionToolConfig.py.

◆ prefix

python.TrigDecisionToolConfig.prefix

Definition at line 112 of file TrigDecisionToolConfig.py.

◆ summariseProps

python.TrigDecisionToolConfig.summariseProps

Definition at line 112 of file TrigDecisionToolConfig.py.

◆ True

python.TrigDecisionToolConfig.True

Definition at line 112 of file TrigDecisionToolConfig.py.

◆ withDetails

python.TrigDecisionToolConfig.withDetails

Definition at line 112 of file TrigDecisionToolConfig.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TrigConfxAODConfig.getxAODConfigSvc
def getxAODConfigSvc(flags)
Definition: TrigConfxAODConfig.py:5
python.TrigDecisionToolConfig.getRun3NavigationContainerFromInput
def getRun3NavigationContainerFromInput(flags)
Definition: TrigDecisionToolConfig.py:75
str
Definition: BTagTrackIpAccessor.cxx:11
python.TrigDecisionToolConfig.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TrigDecisionToolConfig.py:10