ATLAS Offline Software
GenerateElectronChainDefs.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 ..Electron.ElectronChainConfiguration import ElectronChainConfiguration
5 from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
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, perSig_lengthOfChainConfigs):
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  listOfChainDefs = []
21 
22  for subChainDict in listOfChainDicts:
23  log.debug('Assembling subChainsDict %s for chain %s', len(listOfChainDefs), subChainDict['chainName'] )
24  Electron = ElectronChainConfiguration(subChainDict).assembleChain(flags)
25 
26  listOfChainDefs += [Electron]
27 
28 
29  if len(listOfChainDefs)>1:
30  theChainDef, perSig_lengthOfChainConfigs = mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs)
31  else:
32  theChainDef = listOfChainDefs[0]
33 
34 
35  return theChainDef, perSig_lengthOfChainConfigs
36 
37 
38 
39 
40 
41 
python.HLT.Egamma.GenerateElectronChainDefs.generateChainConfigs
def generateChainConfigs(flags, chainDict, perSig_lengthOfChainConfigs)
Definition: GenerateElectronChainDefs.py:14
ChainDictTools.splitChainDict
def splitChainDict(chainDict)
Definition: ChainDictTools.py:104
python.HLT.Electron.ElectronChainConfiguration.ElectronChainConfiguration
Definition: ElectronChainConfiguration.py:56
ChainMerging.mergeChainDefs
def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs=None)
Definition: ChainMerging.py:15