Commit 741f94ca authored by Rafal Bielski's avatar Rafal Bielski
Browse files

Replace TriggerFlags.EDMDecodingVersion with ConfigFlags.Trigger.EDMDecodingVersion

parent 83d89cdb
......@@ -351,14 +351,13 @@ if DQMonFlags.doMonitoring():
from AthenaMonitoring.AthenaMonitoringCfg import AthenaMonitoringCfg
from AthenaMonitoring.DQConfigFlags import allSteeringFlagsOff
from AthenaMonitoring import AthenaMonitoringConf
from TriggerJobOpts.TriggerFlags import TriggerFlags
Steering = ConfigFlags.DQ.Steering
Steering.doGlobalMon=DQMonFlags.doGlobalMon()
Steering.doLVL1CaloMon=DQMonFlags.doLVL1CaloMon()
Steering.doCTPMon=DQMonFlags.doCTPMon()
# do not enable new HLT monitoring if we are not in Run 3 EDM
Steering.doHLTMon=DQMonFlags.doHLTMon() and TriggerFlags.EDMDecodingVersion() == 3
Steering.doHLTMon=DQMonFlags.doHLTMon() and ConfigFlags.Trigger.EDMDecodingVersion == 3
Steering.doPixelMon=DQMonFlags.doPixelMon()
Steering.doSCTMon=DQMonFlags.doSCTMon()
Steering.doTRTMon=DQMonFlags.doTRTMon()
......
......@@ -396,7 +396,7 @@ Trig_reco_tf.py \
--outputNTUP_TRIGRATEFile="NTUP_TRIGRATE.04854087._000852.root.1" \
--outputNTUP_TRIGEBWGHTFile="NTUP_TRIGEBWGHT.04854087._000852.root.1" \
--geometryVersion 'ATLAS-R1-2012-02-00-00' --conditionsTag 'COMCOND-BLKPA-RUN1-07' --beamType 'collisions' --autoConfiguration 'everything' \
--preExec "RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(2);DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doCTPMon=False" "ESDtoAOD:DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doCTPMon=False;from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags;HLTMonFlags.doTau=False" \
--preExec "RAWtoESD:from AthenaConfiguration.AllConfigFlags import ConfigFlags; ConfigFlags.Trigger.EDMDecodingVersion=2;DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doCTPMon=False" "ESDtoAOD:DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doLVL1CaloMon=False;DQMonFlags.doCTPMon=False;from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags;HLTMonFlags.doTau=False" \
--outputBSFile="RAW.05530098._000001.pool.root.1" \
--outputESDFile='thetestESD.pool.root' \
--outputAODFile='thetestAOD.pool.root' \
......
......@@ -39,6 +39,8 @@ if hasattr(runArgs,"inputAODFile"):
rec.doDPD.set_Value_and_Lock(True)
rec.OutputFileNameForRecoStep.set_Value_and_Lock("AODtoDAOD")
athenaCommonFlags.PoolAODInput.set_Value_and_Lock( runArgs.inputAODFile )
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Input.Files = athenaCommonFlags.PoolAODInput()
elif hasattr(runArgs,'inputEVNTFile') or hasattr(runArgs,'jobConfig'):
# Assume that we're running from EVNT or straight through evgen
globalflags.InputFormat.set_Value_and_Lock('pool')
......
......@@ -36,14 +36,18 @@ monMan.ManualRunLBSetup = True
monMan.Run = 1
monMan.LumiBlock = 1
# Input
from AthenaConfiguration.AllConfigFlags import ConfigFlags
if hasattr(runArgs,"inputESDFile"):
rec.readESD.set_Value_and_Lock( True )
athenaCommonFlags.PoolESDInput.set_Value_and_Lock( runArgs.inputESDFile )
ConfigFlags.Input.Files = athenaCommonFlags.PoolESDInput()
rec.readESD = True
rec.readAOD = False
elif hasattr(runArgs,"inputAODFile"):
rec.readAOD.set_Value_and_Lock( True )
athenaCommonFlags.PoolAODInput.set_Value_and_Lock( runArgs.inputAODFile )
ConfigFlags.Input.Files = athenaCommonFlags.PoolAODInput()
rec.readESD = False
rec.readAOD = True
else:
......@@ -151,7 +155,7 @@ if hasattr(runArgs,"postExec"):
# Temporary (July 19) trigger additions
if TriggerFlags.doMT() or TriggerFlags.EDMDecodingVersion() == 3:
if ConfigFlags.Trigger.EDMDecodingVersion == 3:
if hasattr(ToolSvc, 'TrigDecisionTool'):
ToolSvc.TrigDecisionTool.NavigationFormat="TrigComposite"
......
......@@ -21,14 +21,18 @@ recoLog.info( '****************** STARTING ESD->AOD MAKING *****************' )
from AthenaCommon.AppMgr import ServiceMgr; import AthenaPoolCnvSvc.AthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
## Input
if hasattr(runArgs,"inputFile"): athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputFile )
if hasattr(runArgs,"inputFile"):
athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputFile )
ConfigFlags.Input.Files = athenaCommonFlags.FilesInput()
if hasattr(runArgs,"inputESDFile"):
globalflags.InputFormat.set_Value_and_Lock('pool')
rec.readESD.set_Value_and_Lock( True )
rec.readRDO.set_Value_and_Lock( False )
athenaCommonFlags.PoolESDInput.set_Value_and_Lock( runArgs.inputESDFile )
ConfigFlags.Input.Files = athenaCommonFlags.PoolESDInput()
## Pre-exec
if hasattr(runArgs,"preExec"):
......
......@@ -30,6 +30,7 @@ rec.DPDMakerScripts.append(SetupOutputDPDs(runArgs,listOfFlags))
from AthenaCommon.AppMgr import ServiceMgr; import AthenaPoolCnvSvc.AthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
......@@ -55,10 +56,12 @@ if hasattr(runArgs,"inputBSFile"):
rec.readRDO.set_Value_and_Lock( True )
globalflags.InputFormat.set_Value_and_Lock('bytestream')
athenaCommonFlags.BSRDOInput.set_Value_and_Lock( runArgs.inputBSFile )
ConfigFlags.Input.Files = athenaCommonFlags.BSRDOInput()
if len(DRAWInputs) == 1:
rec.readRDO.set_Value_and_Lock( True )
globalflags.InputFormat.set_Value_and_Lock('bytestream')
athenaCommonFlags.BSRDOInput.set_Value_and_Lock( getattr(runArgs, DRAWInputs[0]) )
ConfigFlags.Input.Files = athenaCommonFlags.BSRDOInput()
elif len(DRAWInputs) > 1:
raise RuntimeError('Impossible to run RAWtoESD with multiple input DRAW files (viz.: {0})'.format(DRAWInputs))
......@@ -72,6 +75,7 @@ if hasattr(runArgs,"inputRDO_TRIGFile"):
rec.readRDO.set_Value_and_Lock( True )
globalflags.InputFormat.set_Value_and_Lock('pool')
athenaCommonFlags.PoolRDOInput.set_Value_and_Lock( runArgs.inputRDO_TRIGFile)
ConfigFlags.Input.Files = athenaCommonFlags.PoolRDOInput()
rec.doTrigger.set_Value_and_Lock(False)
recAlgs.doTrigger.set_Value_and_Lock(False)
from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
......
......@@ -10,6 +10,7 @@ from RecExConfig.RecAlgsFlags import recAlgs
from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
import six
#Common job options disable most RecExCommon by default. Re-enable below on demand.
......@@ -31,6 +32,9 @@ from AthenaMonitoring.DQMonFlags import DQMonFlags
DQMonFlags.doMonitoring.set_Value_and_Lock(False)
DQMonFlags.doLArMon.set_Value_and_Lock(False)
# Legacy (Run-2) trigger produces Run-2 EDM
ConfigFlags.Trigger.EDMDecodingVersion = 2
#disable offline ID configuration and reco
from InDetRecExample.InDetJobProperties import InDetFlags
InDetFlags.doNewTracking.set_Value_and_Lock(False)
......@@ -150,8 +154,8 @@ if _streamRDO:
_TriggerESDList = {}
_TriggerAODList = {}
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) )
_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) )
_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMDecodingVersion) )
_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), ConfigFlags.Trigger.EDMDecodingVersion) )
_streamRDO.ItemList += ["HLT::HLTResult#HLTResult_HLT"]
_streamRDO.ItemList += ["TrigDec::TrigDecision#TrigDecision"]
......
......@@ -11,7 +11,7 @@
Reco_tf.py --AMI=q221 --athenaopts='--threads=1' --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --imf False --preExec="all:from IOVDbSvc.CondDB import conddb; conddb.addOverride('/PIXEL/PixMapOverlay','PixMapOverlay-SIM-MC16-000-03');"
echo "art-result: $? Reco"
Reco_tf.py --validationFlags 'doExample,doMET,doPFlow,doTau,doEgamma,doBtag,doZee,doJet,doTopoCluster,doMuon,doTrigMinBias,doTrigIDtrk,doTrigBphys,doTrigMET,doTrigJet,doTrigTau, doTrigEgamma,doTrigMuon,doTrigBjet,doTrigHLTResult' --inputAODFile=myAOD.pool.root --outputNTUP_PHYSVALFile=myNTUP_PHYSVAL.root --preExec="TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3)"
Reco_tf.py --validationFlags 'doExample,doMET,doPFlow,doTau,doEgamma,doBtag,doZee,doJet,doTopoCluster,doMuon,doTrigMinBias,doTrigIDtrk,doTrigBphys,doTrigMET,doTrigJet,doTrigTau, doTrigEgamma,doTrigMuon,doTrigBjet,doTrigHLTResult' --inputAODFile=myAOD.pool.root --outputNTUP_PHYSVALFile=myNTUP_PHYSVAL.root
echo "art-result: $? PhysVal"
ArtPackage=$1
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
monitoring_bphys = [
# For individual chain monitoring folders, to fill DetailedIndividualChains - put them first
......@@ -75,7 +75,7 @@ primary_bphys = [
'HLT_mu11_mu6_bDimu',
]
if TriggerFlags.EDMDecodingVersion == 3 :
if ConfigFlags.Trigger.EDMDecodingVersion == 3 :
monitoring_bphys = [
'HLT_2mu4_bJpsimumu_L12MU4',
'HLT_2mu4_bUpsimumu_L12MU4',
......
......@@ -3,7 +3,7 @@
from TrigHLTMonitoring.HLTMonTriggerList import HLTMonTriggerList
hltmonList = HLTMonTriggerList()
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
# default configuration for pp
#if hltmonList.pp_mode :
......@@ -17,7 +17,7 @@ containers = [
"HLT_xAOD__TrigBphysContainer_MultiTrkFex",
"HLT_xAOD__TrigBphysContainer_EFTrackMass"
]
if TriggerFlags.EDMDecodingVersion == 3 :
if ConfigFlags.Trigger.EDMDecodingVersion == 3 :
# will add the MT version of TrigBphys containers once they are available in EDM
containers = [ "HLT_DimuEF" ]
......
......@@ -125,8 +125,8 @@ if data_type == 'pool':
ToolSvc += Trig__TrigDecisionTool( "TrigDecisionTool" )
from TrigEDMConfig.TriggerEDM import EDMLibraries
ToolSvc.TrigDecisionTool.Navigation.Dlls = [e for e in EDMLibraries if 'TPCnv' not in e]
from TriggerJobOpts.TriggerFlags import TriggerFlags
if TriggerFlags.doMT() or TriggerFlags.EDMDecodingVersion() == 3:
from AthenaConfiguration.AllConfigFlags import ConfigFlags
if ConfigFlags.Trigger.EDMDecodingVersion == 3:
ToolSvc.TrigDecisionTool.NavigationFormat="TrigComposite"
if hasattr(runArgs,"useDB") and runArgs.useDB:
......
......@@ -12,13 +12,10 @@ def TrigIDPhysValMonitoringTool( legacy_monitoring=False ):
if 'rec' not in dir():
from RecExConfig.RecFlags import rec
from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion
from TriggerJobOpts.TriggerFlags import TriggerFlags
EDMDecodingVersion()
from AthenaConfiguration.AllConfigFlags import ConfigFlags
mt_chains = True
if ( TriggerFlags.EDMDecodingVersion < 3 or legacy_monitoring ) :
if ( ConfigFlags.Trigger.EDMDecodingVersion < 3 or legacy_monitoring ) :
mt_chains = False
if rec.doInDet:
......
......@@ -6,13 +6,10 @@ def TrigIDtrkMonitoringTool( legacy_monitoring=False ):
# do we want the lagacy monitoring ?
from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion
from TriggerJobOpts.TriggerFlags import TriggerFlags
EDMDecodingVersion()
from AthenaConfiguration.AllConfigFlags import ConfigFlags
mt_chains = True
if ( TriggerFlags.EDMDecodingVersion < 3 or legacy_monitoring ) :
if ( ConfigFlags.Trigger.EDMDecodingVersion < 3 or legacy_monitoring ) :
mt_chains = False
list = []
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
monitoring_muonNonIso = ['HLT_mu50']
monitoring_muonNonIso_HI = ['HLT_mu8','HLT_mu3', 'HLT_mu4']#8TeV
#monitoring_muonNonIso_HI = ['HLT_mu10','HLT_mu14']
monitoring_muonNonIso_pp = ['HLT_mu50']
if TriggerFlags.EDMDecodingVersion == 3:
if ConfigFlags.Trigger.EDMDecodingVersion == 3:
monitoring_muonNonIso = ['HLT_mu50_L1MU20']
monitoring_muonNonIso_pp = ['HLT_mu50_L1MU20']
monitoring_muonIso = ['HLT_mu26_ivarmedium']
monitoring_muonIso_HI = ['']
monitoring_muonIso_pp = ['HLT_mu26_ivarmedium']
if TriggerFlags.EDMDecodingVersion == 3:
if ConfigFlags.Trigger.EDMDecodingVersion == 3:
monitoring_muonIso = ['HLT_mu26_ivarmedium_L1MU20']
monitoring_muonIso_pp = ['HLT_mu26_ivarmedium_L1MU20']
monitoring_MSonly = ['HLT_mu60_0eta105_msonly']
monitoring_MSonly_HI = ['HLT_mu15_msonly']
monitoring_MSonly_pp = ['HLT_mu60_0eta105_msonly']
if TriggerFlags.EDMDecodingVersion == 3:
if ConfigFlags.Trigger.EDMDecodingVersion == 3:
monitoring_MSonly = ['HLT_mu60_0eta105_msonly_L1MU20']
monitoring_MSonly_pp = ['HLT_mu60_0eta105_msonly_L1MU20']
......
......@@ -30,7 +30,7 @@ physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSV
physval.args += ' --postInclude="TriggerTest/disableChronoStatSvcPrintout.py"'
validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
validationPreExec = 'from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
test = Test.Test()
......
......@@ -50,7 +50,7 @@ physval.explicit_input = True
physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
validationPreExec = 'TriggerFlags.EDMDecodingVersion.set_Value_and_Lock(3); from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
validationPreExec = 'from TrigEDMConfig import ContainerRemapping_Run2Run3; ContainerRemapping_Run2Run3.remapHLTContainerNames();'
physval.args += ' --validationFlags="{:s}" --preExec="{:s}"'.format(validationFlags, validationPreExec)
test = Test.Test()
......
......@@ -65,8 +65,8 @@ class TrigEDMChecker ( TrigEDMChecker ):
def getEDMAuxList():
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion
EDMVersion = EDMDecodingVersion()
from AthenaConfiguration.AllConfigFlags import ConfigFlags
EDMVersion = ConfigFlags.Trigger.EDMDecodingVersion
tlist=getTriggerEDMList('AODFULL',EDMVersion)
objlist=[]
for t,kset in six.iteritems(tlist):
......
......@@ -4,6 +4,7 @@
# flags for command-line input
from RecExConfig.RecFlags import rec
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
from AthenaConfiguration.AllConfigFlags import ConfigFlags
if not acf.EvtMax.is_locked():
acf.EvtMax=10
......@@ -28,6 +29,9 @@ doTAG=False
#rec.doTruth=True
rec.doTruth.set_Value_and_Lock(False)
# Legacy (Run-2) trigger produces Run-2 EDM
ConfigFlags.Trigger.EDMDecodingVersion = 2
#-----------------------------------------------------------
include("RecExCond/RecExCommon_flags.py")
#-----------------------------------------------------------
......
......@@ -34,7 +34,7 @@ test.check_steps = CheckSteps.default_check_steps(test)
# Ultimately there should be no per-event messages
msgcount = test.get_step("MessageCount")
msgcount.thresholds = {
'WARNING': 500,
'WARNING': 600,
'INFO': 1200,
'other': 80
}
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaCommon.Logging import logging
from AthenaCommon.GlobalFlags import globalflags
......@@ -13,97 +14,6 @@ from RecExConfig.RecFlags import rec
from TrigRoiConversion.TrigRoiConversionConf import RoiWriter
def EDMDecodingVersion():
log = logging.getLogger("EDMDecodingVersion")
# BYTESTREAM: decide Run3 or later based on ROD version, decide Run1/Run2 based on run number
if globalflags.InputFormat.is_bytestream():
# Check HLT ROD version in first event of first input file
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
inputFileName = athenaCommonFlags.FilesInput()[0]
if not inputFileName and athenaCommonFlags.isOnline():
log.info("Online reconstruction mode, no input file available. Leaving default TriggerFlags.EDMDecodingVersion=%d", TriggerFlags.EDMDecodingVersion())
return
import eformat
from libpyeformat_helper import SubDetector
bs = eformat.istream(inputFileName)
rodVersionM = -1
rodVersionL = -1
# Find the first HLT ROBFragment in the first event
for robf in bs[0]:
if robf.rob_source_id().subdetector_id()==SubDetector.TDAQ_HLT:
rodVersionM = robf.rod_minor_version() >> 8
rodVersionL = robf.rod_minor_version() & 0xFF
log.debug("HLT ROD minor version from input file is %d.%d", rodVersionM, rodVersionL)
break
if rodVersionM < 0 or rodVersionL < 0:
log.warning("Cannot determine HLT ROD version from input file, falling back to runNumber-based decision")
elif rodVersionM >= 1:
TriggerFlags.EDMDecodingVersion = 3
log.info("Decoding version set to 3, because running on BS file with HLT ROD version %d.%d", rodVersionM, rodVersionL)
return
# Use run number to determine decoding version
from RecExConfig.AutoConfiguration import GetRunNumber
runNumber = GetRunNumber()
boundary_run12 = 230000
boundary_run23 = 368000
if runNumber <= 0:
log.error("Cannot determine decoding version because run number %d is invalid. Leaving the default version %d",
runNumber, TriggerFlags.EDMDecodingVersion())
elif runNumber < boundary_run12:
# Run-1 data
TriggerFlags.EDMDecodingVersion = 1
TriggerFlags.doMergedHLTResult = False
log.info("Decoding version set to 1 based on BS file run number (runNumber < %d)",
boundary_run12)
elif runNumber < boundary_run23:
# Run-2 data
TriggerFlags.EDMDecodingVersion = 2
log.info("Decoding version set to 2 based on BS file run number (%d < runNumber < %d)",
boundary_run12, boundary_run23)
else:
# Run-3 data
TriggerFlags.EDMDecodingVersion = 3
log.info("Decoding version set to 3 based on BS file run number (runNumber > %d)",
boundary_run23)
else:
# POOL files: decide based on HLT output type present in file
from RecExConfig.ObjKeyStore import cfgKeyStore
from PyUtils.MetaReaderPeeker import convert_itemList
cfgKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
TriggerFlags.doMergedHLTResult = True
if cfgKeyStore.isInInputFile( "HLT::HLTResult", "HLTResult_EF" ):
TriggerFlags.EDMDecodingVersion = 1
TriggerFlags.doMergedHLTResult = False
log.info("Decoding version set to 1, because HLTResult_EF found in POOL file")
elif cfgKeyStore.isInInputFile( "xAOD::TrigNavigation", "TrigNavigation" ):
TriggerFlags.EDMDecodingVersion = 2
log.info("Decoding version set to 2, because TrigNavigation found in POOL file")
elif cfgKeyStore.isInInputFile( "xAOD::TrigCompositeContainer", "HLTNav_Summary"):
TriggerFlags.EDMDecodingVersion = 3
log.info("Decoding version set to 3, because HLTNav_Summary found in POOL file")
elif rec.readRDO():
# If running Trigger on RDO input (without previous trigger result), choose Run-2 or Run-3 based on doMT
if TriggerFlags.doMT():
TriggerFlags.EDMDecodingVersion = 3
log.info("Decoding version set to 3, because running Trigger with doMT=True")
else:
TriggerFlags.EDMDecodingVersion = 2
log.info("Decoding version set to 2, because running Trigger with doMT=False")
else:
log.warning("Cannot recognise HLT EDM format, leaving default TriggerFlags.EDMDecodingVersion=%d", TriggerFlags.EDMDecodingVersion())
class xAODConversionGetter(Configured):
def configure(self):
from AthenaCommon.AlgSequence import AlgSequence
......@@ -118,10 +28,10 @@ class xAODConversionGetter(Configured):
from TrigEDMConfig.TriggerEDM import getPreregistrationList
from TrigEDMConfig.TriggerEDM import getEFRun1BSList,getEFRun2EquivalentList,getL2Run1BSList,getL2Run2EquivalentList
xaodconverter.Navigation.ClassesToPreregister = getPreregistrationList(TriggerFlags.EDMDecodingVersion())
## if TriggerFlags.EDMDecodingVersion() == 2:
xaodconverter.Navigation.ClassesToPreregister = getPreregistrationList(ConfigFlags.Trigger.EDMDecodingVersion)
## if ConfigFlags.Trigger.EDMDecodingVersion == 2:
## # if TriggerFlags.doMergedHLTResult():
## #if EDMDecodingVersion() =='Run2': #FPP
## #if ConfigFlags.Trigger.EDMDecodingVersion == 2: #FPP
## xaodconverter.Navigation.ClassesToPreregister = getHLTPreregistrationList()
## else:
## xaodconverter.Navigation.ClassesToPreregister = list(set(getL2PreregistrationList()+getEFPreregistrationList()+getHLTPreregistrationList()))
......@@ -214,7 +124,7 @@ class ByteStreamUnpackGetterRun2(Configured):
extr.Navigation.Dlls = getEDMLibraries()
from TrigEDMConfig.TriggerEDM import getPreregistrationList
extr.Navigation.ClassesToPreregister = getPreregistrationList(TriggerFlags.EDMDecodingVersion())
extr.Navigation.ClassesToPreregister = getPreregistrationList(ConfigFlags.Trigger.EDMDecodingVersion)
if TriggerFlags.doMergedHLTResult():
extr.L2ResultKey=""
......@@ -250,7 +160,7 @@ class ByteStreamUnpackGetterRun2(Configured):
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += TrigSerToolTP
from TrigEDMConfig.TriggerEDM import getTPList
TrigSerToolTP.TPMap = getTPList((TriggerFlags.EDMDecodingVersion()))
TrigSerToolTP.TPMap = getTPList((ConfigFlags.Trigger.EDMDecodingVersion))
from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper
TrigSerializeConvHelper = TrigSerializeConvHelper(doTP = True)
......@@ -376,9 +286,6 @@ class HLTTriggerResultGetter(Configured):
log = logging.getLogger("HLTTriggerResultGetter.py")
from RecExConfig.ObjKeyStore import objKeyStore
# set EDMDecodingVersion
EDMDecodingVersion()
# Set AODFULL for data unless it was set explicitly already
if TriggerFlags.AODEDMSet.isDefault() and globalflags.DataSource()=='data':
TriggerFlags.AODEDMSet = 'AODFULL'
......@@ -387,25 +294,25 @@ class HLTTriggerResultGetter(Configured):
topSequence = AlgSequence()
log.info("BS unpacking (TF.readBS): %d", TriggerFlags.readBS() )
if TriggerFlags.readBS():
if TriggerFlags.EDMDecodingVersion() <= 2:
if ConfigFlags.Trigger.EDMDecodingVersion <= 2:
bs = ByteStreamUnpackGetterRun2() # noqa: F841
else:
bs = ByteStreamUnpackGetter() # noqa: F841
xAODContainers = {}
# if not recAlgs.doTrigger(): #only convert when running on old data
if TriggerFlags.EDMDecodingVersion()==1:
if ConfigFlags.Trigger.EDMDecodingVersion == 1:
xaodcnvrt = xAODConversionGetter()
xAODContainers = xaodcnvrt.xaodlist
if recAlgs.doTrigger() or TriggerFlags.doTriggerConfigOnly():
if TriggerFlags.EDMDecodingVersion() <= 2:
if ConfigFlags.Trigger.EDMDecodingVersion <= 2:
tdt = TrigDecisionGetterRun2() # noqa: F841
else:
tdt = TrigDecisionGetter() # noqa: F841
# Temporary hack to add Run-3 navigation to ESD and AOD
if (rec.doESD() or rec.doAOD()) and TriggerFlags.EDMDecodingVersion() == 3:
if (rec.doESD() or rec.doAOD()) and ConfigFlags.Trigger.EDMDecodingVersion == 3:
# The hack with wildcards is needed for BS->ESD because we don't know the exact keys
# of HLT navigation containers before unpacking them from the BS event.
objKeyStore._store['streamESD'].allowWildCard(True)
......@@ -474,17 +381,17 @@ class HLTTriggerResultGetter(Configured):
if(xAODContainers):
_TriggerESDList.update( xAODContainers )
else:
_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) )
_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMDecodingVersion) )
log.info("ESD content set according to the ESDEDMSet flag: %s and EDM version %d", TriggerFlags.ESDEDMSet() ,TriggerFlags.EDMDecodingVersion())
log.info("ESD content set according to the ESDEDMSet flag: %s and EDM version %d", TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMDecodingVersion)
# AOD objects choice
_TriggerAODList = {}
#from TrigEDMConfig.TriggerEDM import getAODList
_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) )
_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), ConfigFlags.Trigger.EDMDecodingVersion) )
log.info("AOD content set according to the AODEDMSet flag: %s and EDM version %d", TriggerFlags.AODEDMSet(),TriggerFlags.EDMDecodingVersion())
log.info("AOD content set according to the AODEDMSet flag: %s and EDM version %d", TriggerFlags.AODEDMSet(),ConfigFlags.Trigger.EDMDecodingVersion)
log.debug("ESD EDM list: %s", _TriggerESDList)
log.debug("AOD EDM list: %s", _TriggerAODList)
......
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