ATLAS Offline Software
Loading...
Searching...
No Matches
python.HLT.CommonSequences.TLABuildingSequences Namespace Reference

Functions

 addTLAStep (flags, chain, chainDict)
 getTLASignatureSequenceGenCfg (flags, chainDict, chainPart)
 findTLAStep (chainConfig)
 alignTLASteps (chain_configs, chain_dicts)

Variables

 log = logging.getLogger(__name__)

Function Documentation

◆ addTLAStep()

python.HLT.CommonSequences.TLABuildingSequences.addTLAStep ( flags,
chain,
chainDict )
Add one extra chain step for TLA Activities

Definition at line 15 of file TLABuildingSequences.py.

15def addTLAStep(flags, chain, chainDict):
16 '''
17 Add one extra chain step for TLA Activities
18 '''
19
20 tlaSequencesList = []
21 log.debug("addTLAStep: processing chain: %s", chainDict['chainName'])
22
23
24 for cPart in chainDict['chainParts']:
25 log.debug("addTLAStep: processing signature: %s", cPart['signature'] )
26 # call the sequence from their respective signatures
27 tlaSequencesList.append(functools.partial(getTLASignatureSequenceGenCfg, flags, chainDict=chainDict, chainPart=cPart))
28
29 log.debug("addTLAStep: About to add a step with: %d parallel sequences.", len(tlaSequencesList))
30
31 # we add one step per TLA chain, with sequences matching the list of signatures
32 # and multiplicities matching those of the previous step of the chain (already merged if combined)
33 prevStep = chain.steps[-1]
34 stepName = 'TLAStep_{:s}'.format(prevStep.name)
35 step = ChainStep(name = stepName,
36 SequenceGens = tlaSequencesList,
37 chainDicts = prevStep.stepDicts)
38
39 log.debug("addTLAStep: About to add step %s ", stepName)
40 chain.steps.append(step)
41
42
43

◆ alignTLASteps()

python.HLT.CommonSequences.TLABuildingSequences.alignTLASteps ( chain_configs,
chain_dicts )

Definition at line 78 of file TLABuildingSequences.py.

78def alignTLASteps(chain_configs, chain_dicts):
79
80 TLAEventBuildTypes = ('PhysicsTLA', 'FTagPEBTLA', 'EgammaPEBTLA', 'DarkJetPEBTLA')
81 all_tla_chain_configs = [ch for ch in chain_configs if any(ebtype in chain_dicts[ch.name]['eventBuildType'] for ebtype in TLAEventBuildTypes)]
82
83 def getTLAStepPosition(chainConfig):
84 tlaStep = findTLAStep(chainConfig)
85 log.debug('getTLAStepPosition found step %s and return %d',tlaStep,chainConfig.steps.index(tlaStep) + 1)
86 return chainConfig.steps.index(tlaStep) + 1
87
88 # First loop to find the maximal TLA step positions to which we need to align
89 maxTLAStepPosition = 0 # {eventBuildType: N}
90 for chain in all_tla_chain_configs:
91 tlaStepPosition = getTLAStepPosition(chain)
92 if tlaStepPosition > maxTLAStepPosition:
93 maxTLAStepPosition = tlaStepPosition
94
95 log.debug('maxTLAStepPosition=%d',maxTLAStepPosition)
96
97 # Second loop to insert empty steps before the TLA steps where needed
98 for chain in all_tla_chain_configs:
99 tlaStepPosition = getTLAStepPosition(chain)
100 log.debug('Aligning TLA step at step %d for chain %s ', tlaStepPosition, chain.name)
101 if tlaStepPosition < maxTLAStepPosition:
102 numStepsNeeded = maxTLAStepPosition - tlaStepPosition
103 log.debug('Aligning TLA step for chain %s by adding %d empty steps', chain.name, numStepsNeeded)
104 chain.insertEmptySteps('EmptyTLAAlign', numStepsNeeded, tlaStepPosition-1)
105 chain.numberAllSteps()

◆ findTLAStep()

python.HLT.CommonSequences.TLABuildingSequences.findTLAStep ( chainConfig)

Definition at line 69 of file TLABuildingSequences.py.

69def findTLAStep(chainConfig):
70 tlaSteps = [s for s in chainConfig.steps if 'TLAStep' in s.name and 'EmptyPEBAlign' not in s.name and 'EmptyTLAAlign' not in s.name and 'PEBInfoWriter' not in s.name]
71 if len(tlaSteps) == 0:
72 return None
73 elif len(tlaSteps) > 1:
74 raise RuntimeError('Multiple TLA steps in one chain are not supported. ', len(tlaSteps), ' were found in chain ' + chainConfig.name)
75 return tlaSteps[0]
76
77

◆ getTLASignatureSequenceGenCfg()

python.HLT.CommonSequences.TLABuildingSequences.getTLASignatureSequenceGenCfg ( flags,
chainDict,
chainPart )

Definition at line 44 of file TLABuildingSequences.py.

44def getTLASignatureSequenceGenCfg(flags, chainDict, chainPart):
45 # Here we simply retrieve the TLA sequence from the existing signature code
46 signature= chainPart['signature']
47
48 if signature == 'Photon':
49 photonOutCollectionName = "HLT_egamma_Photons"
50 return PhotonTLAMenuSequenceGenCfg(flags, photonsIn=photonOutCollectionName)
51
52 elif signature == 'Muon':
53 return MuonTLAMenuSequenceGenCfg(flags, muChainPart=chainPart)
54
55 elif signature == 'Jet':
56 # Use the jet reco machinery to define the jet collection
57 jetChainConfig = JetChainConfiguration(chainDict)
58 jetChainConfig.prepareDataDependencies(flags)
59 jetInputCollectionName = jetChainConfig.jetName
60 log.debug(f"TLA jet input collection = {jetInputCollectionName}")
61 return JetTLAMenuSequenceGenCfg(flags, jetsIn=jetInputCollectionName)
62 elif signature == 'MET':
63 return EmptyMenuSequence("EmptyMETTLA")
64
65 else:
66 raise ValueError(f"Unsupported TLA signature: No TLA sequence specified for signature {signature}.")
67
68

Variable Documentation

◆ log

python.HLT.CommonSequences.TLABuildingSequences.log = logging.getLogger(__name__)

Definition at line 12 of file TLABuildingSequences.py.