ATLAS Offline Software
Functions | Variables
python.HLT.CommonSequences.TLABuildingSequences Namespace Reference

Functions

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

Variables

 log
 

Function Documentation

◆ addTLAStep()

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

Definition at line 14 of file TLABuildingSequences.py.

14 def addTLAStep(flags, chain, chainDict):
15  '''
16  Add one extra chain step for TLA Activities
17  '''
18 
19  tlaSequencesList = []
20  log.debug("addTLAStep: processing chain: %s", chainDict['chainName'])
21 
22 
23  for cPart in chainDict['chainParts']:
24 
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()

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

Definition at line 81 of file TLABuildingSequences.py.

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

◆ findTLAStep()

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

Definition at line 72 of file TLABuildingSequences.py.

72 def findTLAStep(chainConfig):
73  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]
74  if len(tlaSteps) == 0:
75  return None
76  elif len(tlaSteps) > 1:
77  raise RuntimeError('Multiple TLA steps in one chain are not supported. ', len(tlaSteps), ' were found in chain ' + chainConfig.name)
78  return tlaSteps[0]
79 
80 

◆ getTLASignatureSequenceGenCfg()

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

Definition at line 44 of file TLABuildingSequences.py.

44 def 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' or signature == 'Bjet':
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 
62  # Turn off b-tagging for jets that have no tracks anyway - we want to avoid
63  # adding a TLA AntiKt4EMTopoJets_subjetsIS BTagging container in the EDM.
64  # We do not switch off BTag recording for Jet signatures as both Jet and Bjet signature
65  # will use the same hypo alg, so it needs to be configured the same!
66  # Thus, BTag recording will always run for PFlow jets, creating an empty container if no btagging exists.
67  attachBtag = True
68  if jetChainConfig.recoDict["trkopt"] == "notrk": attachBtag = False
69  return JetTLAMenuSequenceGenCfg(flags, jetsIn=jetInputCollectionName, attachBtag=attachBtag)
70 
71 

Variable Documentation

◆ log

python.HLT.CommonSequences.TLABuildingSequences.log

Definition at line 11 of file TLABuildingSequences.py.

vtune_athena.format
format
Definition: vtune_athena.py:14
python.HLT.Jet.JetTLASequenceConfig.JetTLAMenuSequenceGenCfg
def JetTLAMenuSequenceGenCfg(flags, jetsIn, attachBtag=True)
Definition: JetTLASequenceConfig.py:32
PrecisionPhotonTLAMenuSequenceConfig.PhotonTLAMenuSequenceGenCfg
def PhotonTLAMenuSequenceGenCfg(flags, photonsIn)
Definition: PrecisionPhotonTLAMenuSequenceConfig.py:26
python.HLT.CommonSequences.TLABuildingSequences.addTLAStep
def addTLAStep(flags, chain, chainDict)
Definition: TLABuildingSequences.py:14
python.HLT.CommonSequences.TLABuildingSequences.getTLASignatureSequenceGenCfg
def getTLASignatureSequenceGenCfg(flags, chainDict, chainPart)
Definition: TLABuildingSequences.py:44
python.HLT.CommonSequences.TLABuildingSequences.alignTLASteps
def alignTLASteps(chain_configs, chain_dicts)
Definition: TLABuildingSequences.py:81
python.HLT.CommonSequences.TLABuildingSequences.findTLAStep
def findTLAStep(chainConfig)
Definition: TLABuildingSequences.py:72
python.HLT.Muon.MuonTLASequenceConfig.MuonTLAMenuSequenceGenCfg
def MuonTLAMenuSequenceGenCfg(flags, muChainPart)
Definition: MuonTLASequenceConfig.py:40