ATLAS Offline Software
GenerateBjetChainDefs.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 .BjetChainConfiguration import BjetChainConfiguration
5 from ..Jet.JetChainConfiguration import JetChainConfiguration
6 from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
7 
8 import pprint
9 from AthenaCommon.Logging import logging
10 log = logging.getLogger(__name__)
11 log.debug("Importing %s",__name__)
12 
13 def generateChainConfigs(flags, chainDict ):
14 
15  if log.isEnabledFor(logging.DEBUG): # pprint.pformat is expensive
16  log.debug('bjet full dictionary is: %s\n', pprint.pformat(chainDict))
17 
18  listOfChainDicts = splitChainDict(chainDict)
19  listOfChainDefs = []
20 
21  for subChainDict in listOfChainDicts:
22 
23  jet_cfg = JetChainConfiguration(chainDict)
24  jet_cfg.prepareDataDependencies(flags)
25  jet = jet_cfg.assembleChain(flags)
26  jet_name = jet_cfg.jetName
27 
28  # don't setup btagging for legs that are jet-only
29  # happens for bjet + normal jet chains
30  if subChainDict['chainParts'][0]['signature'] != 'Bjet':
31  listOfChainDefs += [jet]
32  else:
33  log.debug('input jet collection name is: %s\n', jet_name)
34  Bjet = BjetChainConfiguration(subChainDict, jet_name).assembleChain(flags)
35  jet.append_bjet_steps(Bjet.steps)
36  listOfChainDefs += [ jet ]
37 
38  if len(listOfChainDefs)>1:
39  theBjetChainDef = mergeChainDefs(listOfChainDefs, chainDict)
40  else:
41  theBjetChainDef = listOfChainDefs[0]
42 
43  return theBjetChainDef
python.HLT.Bjet.BjetChainConfiguration.BjetChainConfiguration
Definition: BjetChainConfiguration.py:14
python.HLT.Jet.JetChainConfiguration.JetChainConfiguration
Definition: JetChainConfiguration.py:32
ChainDictTools.splitChainDict
def splitChainDict(chainDict)
Definition: ChainDictTools.py:104
ChainMerging.mergeChainDefs
def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs=None)
Definition: ChainMerging.py:15
python.HLT.Bjet.GenerateBjetChainDefs.generateChainConfigs
def generateChainConfigs(flags, chainDict)
Definition: GenerateBjetChainDefs.py:13