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