Skip to content
Snippets Groups Projects
Commit 1edbe571 authored by Tim Martin's avatar Tim Martin
Browse files

Merge branch '24.0-TMMT-EndOfEvent' into '24.0'

ATR-28888 -- Reimplement End-of-Event processing in HLT

See merge request atlas/athena!69397
parents 30f272a6 3fab4e7d
No related branches found
No related tags found
No related merge requests found
......@@ -666,7 +666,7 @@ def triggerRunCfg( flags, menu=None ):
if flags.Trigger.doCFEmulationTest:
summaryAlg.Prescaler=CompFactory.PrescalingEmulationTool()
acc.addEventAlgo( summaryAlg, sequenceName="HLTFinalizeSeq" )
# TODO: Add end-of-event sequences here (port from HLTCFConfig.py)
acc.merge( triggerEndOfEventCfg(flags), sequenceName="HLTFinalizeSeq" )
#once menu is included we should configure monitoring here as below
hltSeedingAlg = hltSeedingAcc.getEventAlgo("HLTSeeding")
......@@ -741,6 +741,64 @@ def triggerIDCCacheCreatorsCfg(flags, seqName = None):
return acc
def triggerEndOfEventCfg(flags):
from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig
acceptedEventChainDicts = [cd for cd in HLTMenuConfig.dictsList() \
if 'Calib' in cd['signatures'] \
and 'acceptedevts' in cd['chainParts'][0]['purpose']]
acc = ComponentAccumulator()
# If no relevant chains or just not desired, can shortcut and return empty CA
if not (flags.Trigger.enableEndOfEventProcessing and acceptedEventChainDicts):
return acc
# Add end-of-event sequences executed conditionally on the DecisionSummaryMakerAlg filter status
endOfEventRoIMaker = CompFactory.EndOfEventROIConfirmerAlg('EndOfEventROIConfirmerAlg')
acc.addEventAlgo( endOfEventRoIMaker )
acc.addSequence( parOR("acceptedEventTopSeq") )
acc.getSequence("acceptedEventTopSeq").IgnoreFilterPassed=True
# Define the alg configuration by purpose
def EndOfEventSeqCfg(flags, prescaleChain, purposes):
acc = ComponentAccumulator()
seqLabel = prescaleChain.replace('HLT_acceptedevts','')
seqName = 'acceptedEventSeq'+seqLabel
acc.addSequence( seqAND(seqName) )
endOfEventFilterAlg = CompFactory.EndOfEventFilterAlg('EndOfEventFilterAlg'+seqLabel, ChainName=prescaleChain)
acc.addEventAlgo(endOfEventFilterAlg, sequenceName=seqName)
# The LAr Noise Burst end-of-event sequence
if 'larnoiseburst' in purposes:
# Add stream filter to EndOfEventFilterAlg
# Only accept events going to streams that already do full calo reco
# CosmicCalo explicitly requested [ATR-26096]
endOfEventFilterAlg.StreamFilter = ['Main','VBFDelayed','TLA','DarkJetPEBTLA','FTagPEBTLA','CosmicCalo']
from TriggerMenuMT.HLT.CalibCosmicMon.CalibChainConfiguration import getLArNoiseBurstRecoCfg
acc.merge(getLArNoiseBurstRecoCfg(flags), sequenceName=seqName)
elif any(purpose.startswith("met") for purpose in purposes):
from TriggerMenuMT.HLT.MET.EndOfEvent import getMETRecoSequences
metcfg, rois, streams = getMETRecoSequences(flags, purposes)
endOfEventFilterAlg.StreamFilter = streams
endOfEventRoIMaker.RoIs = [x for x in rois if x not in endOfEventRoIMaker.RoIs]
acc.merge(metcfg, sequenceName=seqName)
return acc
for acceptedEventChainDict in acceptedEventChainDicts:
# Common config for each chain
prescaleChain = acceptedEventChainDict['chainName']
# Now add chain-specific end-of-event sequences executed conditionally on the prescale
purposes = acceptedEventChainDict['chainParts'][0]['purpose']
acc.merge(EndOfEventSeqCfg(flags, prescaleChain, purposes), sequenceName="acceptedEventTopSeq")
return acc
def triggerPostRunCfg(flags):
"""
Configures components needed for processing trigger information in RAW/ESD step
......
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
"""Code to setup MET reconstruction during the end-of-event sequence"""
from typing import List
from AthenaCommon.CFElements import parOR
from AthenaCommon.Configurable import ConfigurableCABehavior
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from .ConfigHelpers import AlgConfig, stringToMETRecoDict
from ..CommonSequences.FullScanDefs import caloFSRoI, trkFSRoI
_algs_by_purpose = {
"metcalo": ["cell", "tcpufit", "tcpufit_sig30"],
"mettrk": [
"pfopufit",
"pfsum",
"pfsum_vssk",
"pfsum_cssk",
"trkmht",
"mhtpufit_pf",
"mhtpufit_em",
"pfopufit_sig30",
"nn",
],
}
def getMETRecoSequences(flags, purposes: List[str]):
"""Create the full reconstruction sequences to run at the end of the event
Parameters
----------
purposes : List[str]
The purpose keys given in the associated acceptedevts chain
Returns
-------
An OR containing the configured algorithms
A list of the required RoIs
A list of the required streams
"""
ef_reco_algs = []
for purpose in purposes:
ef_reco_algs += [
alg for alg in _algs_by_purpose.get(purpose, []) if alg not in ef_reco_algs
]
seqname = f"{''.join(purposes)}EndOfEventRecoSequence"
with ConfigurableCABehavior():
merged_ca = ComponentAccumulator()
merged_ca.addSequence(parOR(seqname), primary=True)
max_step_idx = 0
for alg in ef_reco_algs:
cfg = AlgConfig.fromRecoDict(**stringToMETRecoDict(alg))
step_output = cfg.make_reco_algs(flags, **cfg.interpret_reco_dict())
max_step_idx = max(max_step_idx, step_output.max_step_idx)
for ca in step_output.steps:
merged_ca.merge(ca, seqname)
rois = [caloFSRoI]
if max_step_idx > 1:
# If we have more than one step then we also need the FS tracking RoI
rois.append(trkFSRoI)
streams = ["Main", "VBFDelayed"]
return merged_ca, rois, streams
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment