ATLAS Offline Software
GenerateMETChainDefs.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from TriggerMenuMT.HLT.Config.Utility.ChainDictTools import splitChainDict
4 from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
5 from .METChainConfiguration import METChainConfiguration
6 
7 import pprint
8 from AthenaCommon.Logging import logging
9 log = logging.getLogger(__name__)
10 log.debug("Importing %s",__name__)
11 
12 
13 
14 def generateChainConfigs(flags, chainDict ):
15 
16  if log.isEnabledFor(logging.DEBUG): # pprint.pformat is expensive
17  log.debug('dictionary is: %s\n', pprint.pformat(chainDict))
18 
19  listOfChainDicts = splitChainDict(chainDict)
20  log.debug("Implement case for met chain with %d legs ",len(listOfChainDicts))
21 
22  listOfChainDefs = []
23 
24  for subChainDict in listOfChainDicts:
25 
26  MET = METChainConfiguration(subChainDict).assembleChain(flags)
27 
28  listOfChainDefs += [MET]
29  log.debug('length of chaindefs %s', len(listOfChainDefs) )
30 
31 
32  if len(listOfChainDefs)>1:
33  log.debug("Implement case for mulit-leg met chain")
34  theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
35  else:
36  theChainDef = listOfChainDefs[0]
37 
38  log.debug("theChainDef %s" , theChainDef)
39 
40  return theChainDef
ChainDictTools.splitChainDict
def splitChainDict(chainDict)
Definition: ChainDictTools.py:104
python.HLT.MET.METChainConfiguration.METChainConfiguration
Definition: METChainConfiguration.py:28
python.HLT.MET.GenerateMETChainDefs.generateChainConfigs
def generateChainConfigs(flags, chainDict)
Definition: GenerateMETChainDefs.py:14
ChainMerging.mergeChainDefs
def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs=None)
Definition: ChainMerging.py:15