ATLAS Offline Software
Loading...
Searching...
No Matches
GenerateCalibChainDefs.py
Go to the documentation of this file.
1# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3from TriggerMenuMT.HLT.Config.Utility.ChainDictTools import splitChainDict
4from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
5from .CalibChainConfiguration import CalibChainConfiguration
6
7
8from AthenaCommon.Logging import logging
9log = logging.getLogger(__name__)
10log.debug("Importing %s",__name__)
11
12
13
14def generateChainConfigs(flags, chainDict ):
15
16 listOfChainDicts = splitChainDict(chainDict)
17 log.debug("Will generate Config for streamer: %s", chainDict['chainName'])
18
19 listOfChainDefs = []
20
21 #streamers will never have more than one chainPart but this is still
22 #needed to move to the correct format [{}]->{}
23 for subChainDict in listOfChainDicts:
24
25 Calib = CalibChainConfiguration(subChainDict).assembleChain(flags)
26
27 listOfChainDefs += [Calib]
28 log.debug('length of chaindefs %s', len(listOfChainDefs) )
29
30 if len(listOfChainDefs)>1:
31 log.warning("This is a streamer with more than one chainPart, is this really intended?")
32 theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
33 else:
34 theChainDef = listOfChainDefs[0]
35
36 log.debug("theChainDef %s" , theChainDef)
37
38 return theChainDef