diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py index 4b232ecd42cfa98d82e61cccb2c1997aee990754..92d4ab8d663a7da85092a6912099a54149b70b29 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py @@ -115,6 +115,7 @@ def set_flags(flags, options=default_options): flags.Input.isMC = False flags.IOVDb.DatabaseInstance = 'CONDBR2' flags.IOVDb.GlobalTag = flags.Trigger.OnlineCondTag + flags.Trigger.doHLT = True flags.Trigger.EDMVersion = 3 flags.Trigger.triggerMenuSetup = 'LS2_v1' flags.Trigger.enableL1MuonPhase1 = options.EnableL1MuonPhase1 diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsCAConfig.py b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsCAConfig.py index f84ad1d41f21eefead82324dc63e11b8ffa02c15..35ed8126325e55d2ef294bd1b1569f72b94c1657 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsCAConfig.py +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsCAConfig.py @@ -2,16 +2,33 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaCommon.Logging import logging +_log = logging.getLogger('AnalysisTriggerAlgsCAConfig.py') def RoIBResultToxAODCfg(flags): - if (flags.Trigger.enableL1MuonPhase1 and flags.Trigger.enableL1CaloPhase1) and not flags.Trigger.enableL1CaloLegacy: + if flags.Trigger.enableL1MuonPhase1 and not flags.Trigger.enableL1CaloLegacy: # No Run-2 L1 RoIs -> nothing to covert to xAOD -> don't add RoIBResultToxAOD + _log.debug('Not adding RoIBResultToxAOD because no Run-2 L1 system is enabled by flags') return ComponentAccumulator() acc = ComponentAccumulator() alg = CompFactory.RoIBResultToxAOD('RoIBResultToxAOD') - alg.DoMuon = not flags.Trigger.enableL1MuonPhase1 - alg.DoCalo = flags.Trigger.enableL1CaloLegacy + alg.DoMuon = flags.Detector.EnableMuon and not flags.Trigger.enableL1MuonPhase1 + alg.DoCalo = flags.Detector.EnableCalo and flags.Trigger.enableL1CaloLegacy + + if flags.Input.Format == 'POOL': + if str(alg.xAODKeyMuon) in flags.Input.Collections: + _log.debug('L1Muon xAOD already in the input file, setting RoIBResultToxAOD.DoMuon=False') + alg.DoMuon = False + allCaloOutputs = [k.Path for k in [alg.xAODKeyEmTau, alg.xAODKeyEsum, alg.xAODKeyJetEt, alg.xAODKeyJet]] + if all([k in flags.Input.Collections for k in allCaloOutputs]): + _log.debug('L1Calo xAOD already in the input file, setting RoIBResultToxAOD.DoCalo=False') + alg.DoCalo = False + + if not alg.DoMuon and not alg.DoCalo: + _log.debug('Not adding RoIBResultToxAOD because both DoMuon and DoCalo properties are False') + return ComponentAccumulator() + acc.addEventAlgo(alg) if flags.Input.Format == 'BS': @@ -22,14 +39,14 @@ def RoIBResultToxAODCfg(flags): outputList = [] if alg.DoMuon: outputList += [ - ("xAOD::MuonRoIContainer", str(alg.xAODKeyMuon)) + (alg.xAODKeyMuon.Type, alg.xAODKeyMuon.Path) ] if alg.DoCalo: outputList += [ - ("xAOD::EmTauRoIContainer", str(alg.xAODKeyEmTau)), - ("xAOD::EnergySumRoI", str(alg.xAODKeyEsum)), - ("xAOD::JetEtRoI", str(alg.xAODKeyJetEt)), - ("xAOD::JetRoIContainer", str(alg.xAODKeyJet)) + (alg.xAODKeyEmTau.Type, alg.xAODKeyEmTau.Path), + (alg.xAODKeyEsum.Type, alg.xAODKeyEsum.Path), + (alg.xAODKeyJetEt.Type, alg.xAODKeyJetEt.Path), + (alg.xAODKeyJet.Type, alg.xAODKeyJet.Path) ] return acc, outputList diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py index 2c04d9398d5b8e3d8b1e075bbfcd07903f44ae63..4a6ed36e39249699dd97aa489674edaeb47b7d59 100644 --- a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py +++ b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py @@ -61,7 +61,7 @@ def ExampleL1TriggerByteStreamToolCfg(name, writeBS=False): def MuonRoIByteStreamToolCfg(name, flags, writeBS=False): tool = CompFactory.MuonRoIByteStreamTool(name) - muctpi_moduleid = 1 + muctpi_moduleid = 1 # RoIB ROB muctpi_robid = int(SourceIdentifier(SubDetector.TDAQ_MUON_CTP_INTERFACE, muctpi_moduleid)) tool.MUCTPIModuleId = muctpi_moduleid tool.ROBIDs = [muctpi_robid] @@ -126,7 +126,8 @@ def L1TriggerByteStreamDecoderCfg(flags): maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id))) # Run-3 L1Muon decoding - if flags.Trigger.enableL1MuonPhase1: + if flags.Trigger.enableL1MuonPhase1 and flags.Trigger.doHLT: + # Currently added only when running in HLT selection, not in offline reco (ATR-23992) muonRoiTool = MuonRoIByteStreamToolCfg(name="L1MuonBSDecoderTool", flags=flags, writeBS=False) decoderTools += [muonRoiTool] diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0MonTrf_build.py b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0MonTrf_build.py index f2a3a90f09dd826b394fe600bdd7be9781ff7cc5..11dbc096a76fde086964cc96c01f060981ecc669 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0MonTrf_build.py +++ b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0MonTrf_build.py @@ -28,6 +28,8 @@ hlt.input = 'data' tzrecoPreExec = ' '.join([ "from AthenaConfiguration.AllConfigFlags import ConfigFlags;", "ConfigFlags.Trigger.triggerMenuSetup=\'PhysicsP1_pp_run3_v1\';", + "ConfigFlags.Trigger.enableL1MuonPhase1=True;", + "ConfigFlags.Trigger.enableL1CaloPhase1=True;", "from TriggerJobOpts.TriggerFlags import TriggerFlags;", "TriggerFlags.configForStartup=\'HLToffline\';", "TriggerFlags.AODEDMSet.set_Value_and_Lock(\'AODFULL\')", diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_build.py b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_build.py index bf823942ea850a08af3d5d7e21682045488667c3..f7420fc013a40621428fc91098119fe96a79a6d1 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_build.py +++ b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_build.py @@ -31,6 +31,8 @@ filter_bs.args = '-s Main ' + find_file('*_HLTMPPy_output.*.data') tzrecoPreExec = ' '.join([ "from AthenaConfiguration.AllConfigFlags import ConfigFlags;", "ConfigFlags.Trigger.triggerMenuSetup=\'PhysicsP1_pp_run3_v1\';", + "ConfigFlags.Trigger.enableL1MuonPhase1=True;", + "ConfigFlags.Trigger.enableL1CaloPhase1=True;", "from TriggerJobOpts.TriggerFlags import TriggerFlags;", "TriggerFlags.configForStartup=\'HLToffline\';", "TriggerFlags.AODEDMSet.set_Value_and_Lock(\'AODFULL\');" diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_grid.py b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_grid.py index da7f7ae8316ef800340caf2134dd4e3519a0ebbc..356e16e9067e3189b6b3985e1b8e7fb5941cad39 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_grid.py +++ b/Trigger/TrigValidation/TrigP1Test/test/test_trigP1_v1PhysP1_T0Mon_grid.py @@ -43,6 +43,8 @@ filter_bs.args = '-s Main ' + find_file('*_HLTMPPy_output.*.data') tzrecoPreExec = ' '.join([ "from AthenaConfiguration.AllConfigFlags import ConfigFlags;", "ConfigFlags.Trigger.triggerMenuSetup=\'PhysicsP1_pp_run3_v1\';", + "ConfigFlags.Trigger.enableL1MuonPhase1=True;", + "ConfigFlags.Trigger.enableL1CaloPhase1=True;", "from TriggerJobOpts.TriggerFlags import TriggerFlags;", "TriggerFlags.configForStartup=\'HLToffline\';", "TriggerFlags.AODEDMSet.set_Value_and_Lock(\'AODFULL\');" diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py index 6ad1cb776a7ebff6fa84c28c459229789422d5b0..0c4d83cabb22fed17bf9ffd002285b08b98dfb8c 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py @@ -4,8 +4,9 @@ # L1 Getter of the result # ------------------------------------------------------------- from AthenaCommon.GlobalFlags import jobproperties -from AthenaCommon.Include import include # to include old style job options -from AthenaCommon.AppMgr import theApp + +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper from RecExConfig.RecFlags import rec @@ -17,13 +18,9 @@ class Lvl1ResultBuilderGetter(Configured): def configure(self): - if jobproperties.Global.InputFormat() == 'bytestream': - theApp.Dlls += [ "TrigT1Calo" ] - include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") - - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - + if ConfigFlags.Input.Format == 'BS': + from TrigT1CaloByteStream.LVL1CaloRun2ByteStreamConfig import LVL1CaloRun2ReadBSCfg + CAtoGlobalWrapper(LVL1CaloRun2ReadBSCfg, ConfigFlags) if rec.doTrigger(): if (rec.doESD() or rec.doAOD()) and (not(rec.readAOD() or \ @@ -32,10 +29,8 @@ class Lvl1ResultBuilderGetter(Configured): # Decode ROIB::RoIBResult from ByteStream from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup L1ByteStreamDecodersRecExSetup() - from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import RoIBResultToxAOD - topSequence += RoIBResultToxAOD() - pass - pass + from AnalysisTriggerAlgs.AnalysisTriggerAlgsCAConfig import RoIBResultToxAODCfg + CAtoGlobalWrapper(RoIBResultToxAODCfg, ConfigFlags) from TrigEDMConfig.TriggerEDM import getLvl1ESDList objKeyStore.addManyTypesStreamESD(getLvl1ESDList()) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index 9261456029b7c0fa2df3788d303371e85be6eb88..62f9d7e2bb061e5fde7cc2222e8973a3e1c63b4b 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -19,15 +19,12 @@ def createTriggerFlags(): # need proper documentation flags.addFlag('Trigger.useRun1CaloEnergyScale', False) - # enable HLT part of the trigger - flags.addFlag('Trigger.doHLT', True) + # Run HLT selection algorithms + flags.addFlag('Trigger.doHLT', False) # changes decoding of L1 so that allways all configured chains are enabled, testing mode flags.addFlag("Trigger.HLTSeeding.forceEnableAllChains", False) -# # Enable Run-3 LVL1 simulation and/or decoding -# flags.addFlag('Trigger.enableL1Phase1', False) - # Enable Run-3 LVL1 muon simulation and/or decoding flags.addFlag('Trigger.enableL1MuonPhase1', False) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py index cbd116b991c5edbf71498fc01fe5a42d8e48ee00..d46ac7a6eadcd83ac38853064a3df1afc907994b 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py @@ -52,10 +52,10 @@ for name in default_false_flags: _flags.append(newFlag) class doHLT(JobProperty): - """ if False, disable HLT selection """ + """ if True, run HLT selection algorithms """ statusOn=True allowedType=['bool'] - StoredValue=True + StoredValue=False _flags.append(doHLT) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index ab47b954770101e6708917a8be80dce1fc2c56ec..6e764addafa2108422421e62f216bb9f626275aa 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -225,8 +225,8 @@ ConfigFlags.Trigger.enableL1TopoDump = opt.enableL1TopoDump # Transfer flags into TriggerFlags #------------------------------------------------------------- -# To turn off HLT for athena running -TriggerFlags.doHLT = bool(opt.doHLT) +# Pass on the option enabling HLT selection algorithms +ConfigFlags.Trigger.doHLT = TriggerFlags.doHLT = bool(opt.doHLT) # To extract the Trigger configuration TriggerFlags.Online.doDBConfig = bool(opt.doDBConfig) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py index 289e7b03877ec576ef3c5b7eac9783cd9a865123..032fd68c81cd6fee81758a19d1da99651495fbc1 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py @@ -36,6 +36,7 @@ flags.Trigger.EDMVersion = 3 flags.Output.doWriteRDO = True flags.Output.RDOFileName = 'RDO_TRIG.pool.root' +flags.Trigger.doHLT = True flags.Trigger.CostMonitoring.doCostMonitoring = True flags.Trigger.doRuntimeNaviVal = True flags.Scheduler.CheckDependencies = True