Commit d3378a43 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TriggerFlags: remove doMergedHLTResult flag

The `doMergedHLTResult` was used to distinguish Run-1 where we had a
split-level HLT (L2+EF) from Run-2 and beyond. But the same information
is available via the `EDMVersion` flag.

Also cleanup configuration of Run-2 DataScouting unpacking and always
set L2/EF/HLTResultKeys explicitly instead of relying on defaults.
parent 85d4504a
#!/usr/bin/env python
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#
# art-description: Test of reconstruction of Run-1 data with trigger
# art-type: build
......@@ -18,7 +18,7 @@ ex.input = 'data_run1'
ex.args = '--outputESDFile=ESD.pool.root --outputAODFile=AOD.pool.root --outputHISTFile=HIST.root'
ex.args += ' --autoConfiguration="everything"'
ex.args += ' --conditionsTag "all:COMCOND-BLKPA-RUN1-07"'
ex.args += ' --preExec "all:DQMonFlags.doCTPMon=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doHLTMon=False;" "RAWtoESD:TriggerFlags.doMergedHLTResult=False;"'
ex.args += ' --preExec "all:DQMonFlags.doCTPMon=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doHLTMon=False;"'
test = Test.Test()
test.art_type = 'build'
......
......@@ -28,15 +28,7 @@ class xAODConversionGetter(Configured):
from TrigEDMConfig.TriggerEDM import getPreregistrationList
from TrigEDMConfig.TriggerEDM import getEFRun1BSList,getEFRun2EquivalentList,getL2Run1BSList,getL2Run2EquivalentList
xaodconverter.Navigation.ClassesToPreregister = getPreregistrationList(ConfigFlags.Trigger.EDMVersion)
## if ConfigFlags.Trigger.EDMVersion == 2:
## # if TriggerFlags.doMergedHLTResult():
## #if ConfigFlags.Trigger.EDMVersion == 2: #FPP
## xaodconverter.Navigation.ClassesToPreregister = getHLTPreregistrationList()
## else:
## xaodconverter.Navigation.ClassesToPreregister = list(set(getL2PreregistrationList()+getEFPreregistrationList()+getHLTPreregistrationList()))
#we attempt to convert the entire old navigation (L2+EF)
#xaodconverter.BStoxAOD.ContainersToConvert = list(set(getL2PreregistrationList()+getEFPreregistrationList()))
# we want only containers from Run 1 with the BS tag
xaodconverter.BStoxAOD.ContainersToConvert = getL2Run1BSList() + getEFRun1BSList()
xaodconverter.BStoxAOD.NewContainers = getL2Run2EquivalentList() + getEFRun2EquivalentList()
......@@ -93,21 +85,8 @@ class ByteStreamUnpackGetterRun1or2(Configured):
#if TriggerFlags.readBS():
log.info( "TriggerFlags.dataTakingConditions: %s", TriggerFlags.dataTakingConditions() )
# in MC this is always FullTrigger
hasHLT = TriggerFlags.dataTakingConditions()=='HltOnly' or TriggerFlags.dataTakingConditions()=='FullTrigger'
hasHLT = TriggerFlags.dataTakingConditions() in ('HltOnly', 'FullTrigger')
if hasHLT:
# Decide based on the run number whether to assume a merged, or a
# split HLT:
if not TriggerFlags.doMergedHLTResult():
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
"HLT::HLTResult/HLTResult_L2",
"HLT::HLTResult/HLTResult_EF" ]
else:
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
"HLT::HLTResult/HLTResult_HLT" ]
pass
pass
# BS unpacking
from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction
extr = TrigBSExtraction()
......@@ -124,32 +103,39 @@ class ByteStreamUnpackGetterRun1or2(Configured):
from TrigEDMConfig.TriggerEDM import getPreregistrationList
extr.Navigation.ClassesToPreregister = getPreregistrationList(ConfigFlags.Trigger.EDMVersion)
if TriggerFlags.doMergedHLTResult():
extr.L2ResultKey=""
extr.EFResultKey=""
if ConfigFlags.Trigger.EDMVersion == 1: # Run-1 has L2 and EF result
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
"HLT::HLTResult/HLTResult_L2",
"HLT::HLTResult/HLTResult_EF" ]
extr.L2ResultKey = "HLTResult_L2"
extr.EFResultKey = "HLTResult_EF"
extr.HLTResultKey = ""
else:
extr.HLTResultKey=""
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
"HLT::HLTResult/HLTResult_HLT" ]
extr.L2ResultKey = ""
extr.EFResultKey = ""
extr.HLTResultKey = "HLTResult_HLT"
#
# Configure DataScouting
#
from PyUtils.MetaReaderPeeker import metadata
if 'stream' in metadata:
stream_local = metadata['stream']
stream_local = metadata['stream'] # e.g. calibration_DataScouting_05_Jets
if stream_local.startswith('calibration_DataScouting_'):
if 'calibration' in stream_local and 'DataScouting_' in stream_local:
ds_tag = stream_local[12:27]
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/"+ds_tag ]
extr.DSResultKeys += [ ds_tag ]
ds_tag = '_'.join(stream_local.split('_')[1:3]) # e.g. DataScouting_05
ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/"+ds_tag ]
extr.DSResultKeys += [ ds_tag ]
else:
#if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings
# but the extr alg must run
extr.L2ResultKey=""
extr.EFResultKey=""
extr.HLTResultKey=""
extr.DSResultKeys=[]
# if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings
# but the extraction algorithm must run
extr.L2ResultKey = ""
extr.EFResultKey = ""
extr.HLTResultKey = ""
extr.DSResultKeys = []
topSequence += extr
......@@ -223,9 +209,8 @@ class TrigDecisionGetterRun1or2(Configured):
elif TriggerFlags.dataTakingConditions()=='HltOnly':
from AthenaCommon.AlgSequence import AlgSequence
topSequence.TrigDecMaker.doL1=False
# Decide based on the doMergedHLTResult to assume a merged, or a
# split HLT:
if not TriggerFlags.doMergedHLTResult():
if ConfigFlags.Trigger.EDMVersion == 1: # Run-1 has L2 and EF result
topSequence.TrigDecMaker.doHLT = False
topSequence.TrigNavigationCnvAlg.doL2 = False
topSequence.TrigNavigationCnvAlg.doHLT = False
......@@ -254,13 +239,13 @@ class HLTTriggerResultGetter(Configured):
from PyUtils.MetaReaderPeeker import metadata
if 'stream' in metadata:
stream = metadata['stream']
log.debug("the stream found in 'metadata' is "+stream)
log.debug("the stream found in 'metadata' is %s", stream)
if "express" in stream:
from TrigEDMConfig.TriggerEDM import getTypeAndKey,EDMDetails
type,key=getTypeAndKey("TrigOperationalInfo#HLT_EXPRESS_OPI_HLT")
if 'collection'in EDMDetails[type]:
colltype = EDMDetails[type]['collection']
log.info("Adding HLT_EXPRESS_OPI_HLT to ESD for stream "+stream)
log.info("Adding HLT_EXPRESS_OPI_HLT to ESD for stream %s", stream)
from RecExConfig.ObjKeyStore import objKeyStore
objKeyStore.addStreamESD(colltype, key)
return True
......@@ -420,9 +405,6 @@ class HLTTriggerResultGetter(Configured):
_addSlimming('StreamESD', _TriggerESDList )
log.info("configured navigation slimming for ESD output")
objKeyStore.addManyTypesStreamESD( _TriggerESDList )
objKeyStore.addManyTypesStreamAOD( _TriggerAODList )
......
......@@ -294,7 +294,6 @@ def createTriggerFlags():
return flags
# for reference, this flags are skipped as never used or never set in fact, or set identical to de default or used in a very old JO:
# doMergedHLTResult - not needed now
# configForStartup
# the flags related to trigger DB are redundant of triggerConfig - need to decide if they are needed in this form
# also not defined the Prescale sets yet
......
......@@ -26,7 +26,6 @@ def bool_flag_with_default(name, val):
default_true_flags = [
"doLVL1", # run the LVL1 simulation (set to FALSE to read the LVL1 result from BS file)
"doL1Topo", # Run the L1 Topo simulation (set to FALSE to read the L1 Topo result from BS file)
"doMergedHLTResult", # if False disable decoding of the merged HLT Result (so decoding L2/EF Result) """
"doID", # if False, disable ID algos at LVL2 and EF """
"doCalo", # if False, disable Calo algorithms at LVL2 & EF """
"doCaloOffsetCorrection", # enable Calo pileup offset BCID correction """
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment