ATLAS Offline Software
Loading...
Searching...
No Matches
GenerateUnconventionalTrackingChainDefs.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from .UnconventionalTrackingChainConfiguration import UnconventionalTrackingChainConfiguration
4from TriggerMenuMT.HLT.Config.Utility.ChainDictTools import splitChainDict
5from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
6from AthenaConfiguration.AthConfigFlags import AthConfigFlags
7
8import pprint
9from AthenaCommon.Logging import logging
10log = logging.getLogger(__name__)
11log.debug("Importing %s",__name__)
12
13
14
15def generateChainConfigs(flags, chainDict ):
16
17 if log.isEnabledFor(logging.DEBUG): # pprint.pformat is expensive
18 log.debug('dictionary is: %s\n', pprint.pformat(chainDict))
19
20 listOfChainDicts = splitChainDict(chainDict)
21
22 listOfChainDefs=[]
23 for subChainDict in listOfChainDicts:
24 subChain = UnconventionalTrackingChainConfiguration(subChainDict).assembleChain(flags)
25 listOfChainDefs += [subChain]
26
27 log.debug('length of chaindefs %s', len(listOfChainDefs))
28
29 if len(listOfChainDefs) > 1:
30 chainDef = mergeChainDefs(listOfChainDefs, chainDict)
31 else:
32 chainDef = listOfChainDefs[0]
33
34 log.debug('ChainDef %s', chainDef)
35 return chainDef
36
37def prepareDefaultSignatureFlags(inflags : AthConfigFlags) -> AthConfigFlags:
38 """
39 invoked before generateChainConfigs method to prevent repeated cloning of flags within chain generation
40 """
41 from TrigInDetConfig.utils import cloneFlagsToActiveConfig
42 flags = cloneFlagsToActiveConfig(inflags, "fullScan", log)
43 return flags
AthConfigFlags prepareDefaultSignatureFlags(AthConfigFlags inflags)