diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py index a82f39ffda00fd35be0354466c5a27deebcc6fc3..155a9ece10e34712984b39ff3f2a4c5f87ff6f23 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py @@ -20,6 +20,7 @@ rec.doTrigger.set_Value_and_Lock(True) rec.doRDOTrigger.set_Value_and_Lock(True) recAlgs.doTrigger.set_Value_and_Lock(True) + from AthenaCommon.Logging import logging recoLog = logging.getLogger('rdo_to_rdotrigger') recoLog.info( '****************** STARTING RDO->RDOTrigger MAKING *****************' ) @@ -37,7 +38,7 @@ elif hasattr(runArgs,"inputRDO_FTKFile"): rec.readRDO.set_Value_and_Lock( True ) globalflags.InputFormat.set_Value_and_Lock('pool') athenaCommonFlags.PoolRDOInput.set_Value_and_Lock( runArgs.inputRDO_FTKFile ) - from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.doFTK=True; else: raise RuntimeError("No RDO input file specified") @@ -61,14 +62,27 @@ if hasattr(runArgs,"preInclude"): for fragment in runArgs.preInclude: include(fragment) -from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -# small hack, switching temporarily the ESD writing on, to allow writing of some trigger containers into the RDOTrigger file -rec.doWriteESD = True -cfg = TriggerConfigGetter() -rec.doWriteESD.set_Value_and_Lock( False ) -# end of hack. +if TriggerFlags.doMTHLT(): + log.info("configuring MT Trigger, actually nothing happens for now") + +else: + + from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter + from AthenaCommon.AppMgr import ServiceMgr as svcMgr + # small hack, switching temporarily the ESD writing on, to allow writing of some trigger containers into the RDOTrigger file + rec.doWriteESD = True + cfg = TriggerConfigGetter() + rec.doWriteESD.set_Value_and_Lock( False ) + # end of hack. + +def preplist(input): + triglist = [] + for k,val in input.iteritems(): + for j in val: + triglist.append(k + "#" + j) + return triglist + #======================================================== # Central topOptions (this is one is a string not a list) #======================================================== @@ -96,21 +110,49 @@ for i in topSequence.getAllChildren(): if not hasattr(i,'RoIBResultToxAOD'): idx += 1 topSequence.insert(idx, RoIBResultToAOD("RoIBResultToxAOD")) + for i in outSequence.getAllChildren(): - if "StreamRDO" in i.getName(): - from TrigDecisionMaker.TrigDecisionMakerConfig import TrigDecisionMaker,WritexAODTrigDecision - topSequence.insert(idx, TrigDecisionMaker('TrigDecMaker')) - from AthenaCommon.Logging import logging - log = logging.getLogger( 'WriteTrigDecisionToAOD' ) - log.info('TrigDecision writing enabled') - from xAODTriggerCnv.xAODTriggerCnvConf import xAODMaker__TrigDecisionCnvAlg - alg = xAODMaker__TrigDecisionCnvAlg() - alg.AODKey = "TrigDecision" - alg.xAODKey = "xTrigDecision" - topSequence.insert(idx+1, alg) - from xAODTriggerCnv.xAODTriggerCnvConf import xAODMaker__TrigNavigationCnvAlg - topSequence.insert(idx+2, xAODMaker__TrigNavigationCnvAlg()) - + if "StreamRDO" in i.getName() and ( not TriggerFlags.doMTHLT() ): + from TrigDecisionMaker.TrigDecisionMakerConfig import TrigDecisionMaker,WritexAODTrigDecision + topSequence.insert(idx, TrigDecisionMaker('TrigDecMaker')) + from AthenaCommon.Logging import logging + log = logging.getLogger( 'WriteTrigDecisionToAOD' ) + log.info('TrigDecision writing enabled') + from xAODTriggerCnv.xAODTriggerCnvConf import xAODMaker__TrigDecisionCnvAlg + alg = xAODMaker__TrigDecisionCnvAlg() + alg.AODKey = "TrigDecision" + alg.xAODKey = "xTrigDecision" + topSequence.insert(idx+1, alg) + from xAODTriggerCnv.xAODTriggerCnvConf import xAODMaker__TrigNavigationCnvAlg + topSequence.insert(idx+2, xAODMaker__TrigNavigationCnvAlg()) + _TriggerESDList = {} + _TriggerAODList = {} + from TrigEDMConfig.TriggerEDM import getTriggerEDMList + _TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) ) + _TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) ) + + + StreamRDO.ItemList += ["HLT::HLTResult#HLTResult_HLT"] + StreamRDO.ItemList += ["TrigDec::TrigDecision#TrigDecision"] + StreamRDO.ItemList += ["TrigInDetTrackTruthMap#*"] + StreamRDO.ItemList += preplist(_TriggerESDList) + StreamRDO.ItemList += preplist(_TriggerAODList) + from TrigEDMConfig.TriggerEDM import getLvl1ESDList + StreamRDO.ItemList += preplist(getLvl1ESDList()) + from TrigEDMConfig.TriggerEDM import getLvl1AODList + StreamRDO.ItemList += preplist(getLvl1AODList()) + StreamRDO.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ] + + if "StreamRDO" in i.getName() and TriggerFlags.doMTHLT(): + from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTList + from TrigEDMConfig.TriggerEDM import getLvl1ESDList + StreamRDO.ItemList += preplist(getLvl1ESDList()) + + StreamRDO.ItemList += ["TrigInDetTrackTruthMap#*"] + for item in TriggerHLTList: + if "ESD" in item[1] or "AOD" in item[1]: + StreamRDO.ItemList += item[0] + from AthenaCommon.AppMgr import ServiceMgr, ToolSvc from TrigDecisionTool.TrigDecisionToolConf import * @@ -118,46 +160,27 @@ if hasattr(ToolSvc, 'TrigDecisionTool'): ToolSvc.TrigDecisionTool.TrigDecisionKey = "TrigDecision" ToolSvc.TrigDecisionTool.UseAODDecision = True -# inform TD maker that some parts may be missing -if TriggerFlags.dataTakingConditions()=='Lvl1Only': - topSequence.TrigDecMaker.doL2=False - topSequence.TrigDecMaker.doEF=False - topSequence.TrigDecMaker.doHLT=False -elif TriggerFlags.dataTakingConditions()=='HltOnly': - from AthenaCommon.AlgSequence import AlgSequence - topSequence.TrigDecMaker.doL1=False -# Decide based on the run number whether to assume a merged, or a -# split HLT: -if not TriggerFlags.doMergedHLTResult(): - topSequence.TrigDecMaker.doHLT = False +if TriggerFlags.doMTHLT(): + pass else: - topSequence.TrigDecMaker.doL2 = False - topSequence.TrigDecMaker.doEF = False - -_TriggerESDList = {} -_TriggerAODList = {} -from TrigEDMConfig.TriggerEDM import getTriggerEDMList -_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) ) -_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) ) - -def preplist(input): - triglist = [] - for k,val in input.iteritems(): - for j in val: - triglist.append(k + "#" + j) - return triglist - -StreamRDO.ItemList += ["HLT::HLTResult#HLTResult_HLT"] -StreamRDO.ItemList += ["TrigDec::TrigDecision#TrigDecision"] -StreamRDO.ItemList += ["TrigInDetTrackTruthMap#*"] -StreamRDO.ItemList += preplist(_TriggerESDList) -StreamRDO.ItemList += preplist(_TriggerAODList) -from TrigEDMConfig.TriggerEDM import getLvl1ESDList -StreamRDO.ItemList += preplist(getLvl1ESDList()) -from TrigEDMConfig.TriggerEDM import getLvl1AODList -StreamRDO.ItemList += preplist(getLvl1AODList()) - -StreamRDO.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ] + # inform TD maker that some parts may be missing + if TriggerFlags.dataTakingConditions()=='Lvl1Only': + topSequence.TrigDecMaker.doL2=False + topSequence.TrigDecMaker.doEF=False + topSequence.TrigDecMaker.doHLT=False + elif TriggerFlags.dataTakingConditions()=='HltOnly': + from AthenaCommon.AlgSequence import AlgSequence + topSequence.TrigDecMaker.doL1=False + # Decide based on the run number whether to assume a merged, or a + # split HLT: + if not TriggerFlags.doMergedHLTResult(): + topSequence.TrigDecMaker.doHLT = False + else: + topSequence.TrigDecMaker.doL2 = False + topSequence.TrigDecMaker.doEF = False + + +#unconditinally store these items StreamRDO.ItemList += [ "DataVector<LVL1::TriggerTower>#TriggerTowers" ] StreamRDO.ItemList += [ "TRT_RDO_Container#TRT_RDOs" ] StreamRDO.ItemList += [ "SCT_RDO_Container#SCT_RDOs" ] diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py index 5a783fbce8c283fb76894591b5405d4a4e34d4cc..6a1164102a313e89ec86c23c33eac6f45e834957 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py @@ -12,6 +12,7 @@ from TrigConfigSvc.TrigConfigSvcUtils import getKeysFromNameRelease, getMenuName _flags = [] + # Define Default Flags class doLVL1(JobProperty): """ run the LVL1 simulation (set to FALSE to read the LVL1 result from BS file) """ @@ -136,6 +137,16 @@ class doHLT(JobProperty): _flags.append(doHLT) +# Define Default Flags +class doMTHLT(JobProperty): + """ Run upgrade type of config """ + statusOn=True + allowedType=['bool'] + from AthenaCommon.ConcurrencyFlags import jobproperties + StoredValue= bool(jobproperties.ConcurrencyFlags.NumThreads >= 1) + +_flags.append(doMTHLT) + class doMergedHLTResult(JobProperty): """ if False disable decoding of the merged HLT Result (so decoding L2/EF Result) """ diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerGetter.py index 3abdbe3c5a8cdcf00189fb69225690e6e03443eb..77348d7b0993b79b426b0909b14f6d737de92c6d 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerGetter.py @@ -46,8 +46,17 @@ class TriggerGetter(Configured): # start with print some information what this will do log.info("Basic configuration flags RecAlgsFlag.doTrigger: %d RecFlags.doTrigger: %d TriggerFlags.doTriggerConfigOnly %d" % (recAlgs.doTrigger(), rec.doTrigger(), TF.doTriggerConfigOnly()) ) - log.info("TriggerFlags: doL1Topo: %s, doLVL1: %s, doLVL2: %s, doEF: %s, doHLT: %s" % (TF.doL1Topo(), TF.doLVL1(), TF.doLVL2(), TF.doEF(), TF.doHLT() ) ) + log.info("TriggerFlags: doL1Topo: %s, doLVL1: %s, doLVL2: %s, doEF: %s, doHLT: %s, doMTHLT: %s" % (TF.doL1Topo(), TF.doLVL1(), TF.doLVL2(), TF.doEF(), TF.doHLT(), TF.doMTHLT() ) ) + if TF.doMTHLT(): + log.info("configuring MT Trigger, actually nothing happens for now") + + return True + + + + + willGenerateMenu = recAlgs.doTrigger() and (TF.doLVL1() or TF.doLVL2() or TF.doEF() or TF.doHLT()) and not TF.doTriggerConfigOnly() willRunTriggerConfigGetter = recAlgs.doTrigger() or rec.doTrigger() or TF.doTriggerConfigOnly() willRunLVL1SimulationGetter = recAlgs.doTrigger() and not TF.doTriggerConfigOnly()