diff --git a/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py b/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py index 545c1b4fa73c73b1bbc54e82a5ba217d9681ecf6..9e55a14576a9a4388e5234bd7cd698631bb0561a 100644 --- a/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py +++ b/Trigger/TrigSteer/L1Decoder/python/L1DecoderConfig.py @@ -163,8 +163,8 @@ def L1DecoderCfg(flags): acc = ComponentAccumulator() decoderAlg = CompFactory.L1Decoder() - decoderAlg.RoIBResult = "RoIBResult" if flags.Trigger.decodeLegacyL1 else "" - decoderAlg.L1TriggerResult = "L1TriggerResult" if flags.Trigger.decodePhaseIL1 else "" + decoderAlg.RoIBResult = "RoIBResult" if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1 else "" + decoderAlg.L1TriggerResult = "L1TriggerResult" if flags.Trigger.enableL1Phase1 else "" decoderAlg.L1DecoderSummaryKey = "L1DecoderSummary" # Transient, consumed by DecisionSummaryMakerAlg decoderAlg.ctpUnpacker = CompFactory.CTPUnpackingTool( ForceEnableAllChains = flags.Trigger.L1Decoder.forceEnableAllChains, MonTool = CTPUnpackingMonitoring(512, 200) ) @@ -198,7 +198,7 @@ def L1DecoderCfg(flags): acc.merge( L1TriggerByteStreamDecoderCfg(flags) ) # Add the algorithm creating L1TriggerResult which is the input to L1Decoder (Run-3 L1) - if flags.Trigger.decodePhaseIL1: + if flags.Trigger.enableL1Phase1: acc.addEventAlgo( getL1TriggerResultMaker() ) Configurable.configurableRun3Behavior -= 1 diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/CMakeLists.txt b/Trigger/TrigT1/TrigT1MuctpiPhase1/CMakeLists.txt index 1246e98ba3360a02f742d255a5b8258b25ab497a..4a27c2201fa047d04d3b2244a44567a2968be1ec 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/CMakeLists.txt +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/CMakeLists.txt @@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerEvent Tools/PathResolver Control/CxxUtils + Event/xAOD/xAODTrigger Trigger/TrigConfiguration/TrigConfInterfaces Trigger/TrigConfiguration/TrigConfL1Data Trigger/TrigConfiguration/TrigConfMuctpi @@ -28,7 +29,7 @@ atlas_add_component( TrigT1MuctpiPhase1 src/*.cxx src/components/*.cxx INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel AnalysisTriggerEvent PathResolver TrigConfL1Data TrigConfMuctpi TrigT1Interfaces TrigT1Result ) + LINK_LIBRARIES ${XERCESC_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel AnalysisTriggerEvent PathResolver TrigConfL1Data TrigConfMuctpi TrigT1Interfaces TrigT1Result xAODTrigger ) # Install files from the package: atlas_install_headers( TrigT1MuctpiPhase1 ) diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/TrigT1MuctpiPhase1/MUCTPI_AthTool.h b/Trigger/TrigT1/TrigT1MuctpiPhase1/TrigT1MuctpiPhase1/MUCTPI_AthTool.h index 9aff8f461dd5f2e137492680ff8e7806a37b3254..37cd244926c598ce462a9ef133881ca4f6cc59b9 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/TrigT1MuctpiPhase1/MUCTPI_AthTool.h +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/TrigT1MuctpiPhase1/MUCTPI_AthTool.h @@ -17,6 +17,7 @@ class description #include "TrigT1Interfaces/MuCTPIL1Topo.h" #include "TrigT1Result/MuCTPI_RDO.h" +#include "xAODTrigger/MuonRoIContainer.h" #include "TrigT1MuctpiPhase1/Configuration.h" @@ -84,8 +85,9 @@ namespace LVL1MUCTPIPHASE1 { SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> m_muctpiPhase1KeyRPC{this, "MuctpiPhase1LocationRPC", "L1MuctpiStoreRPC", "Location of muctpiPhase1 for Rpc"}; SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> m_muctpiPhase1KeyTGC{this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"}; - SG::ReadHandleKey<MuCTPI_RDO> m_MuCTPI_RDOReadKey{this, "MUCTPI_RDOLocation", "MUCTPI_RDO", "Location of MuCTPI_RDO"}; - SG::WriteHandleKey<MuCTPI_RDO> m_MuCTPI_RDOWriteKey{this, "MUCTPI_RDOLocation", "MUCTPI_RDO", "Location of MuCTPI_RDO"}; + SG::ReadHandleKey<MuCTPI_RDO> m_MuCTPI_RDOReadKey{this, "MUCTPI_RDOReadKey", "MUCTPI_RDO", "Location of MuCTPI_RDO"}; + SG::WriteHandleKey<MuCTPI_RDO> m_MuCTPI_RDOWriteKey{this, "MUCTPI_RDOWriteKey", "MUCTPI_RDO", "Location of MuCTPI_RDO"}; + SG::WriteHandleKey<xAOD::MuonRoIContainer> m_MuCTPI_xAODWriteKey{this, "MUCTPI_xAODLocation", "LVL1MuonRoIs", "Location of xAOD::MuonRoIContainer"}; SG::WriteHandleKey<LVL1::MuCTPIL1Topo> m_MuCTPIL1TopoKey; SG::WriteHandleKey<LVL1::MuCTPIL1Topo> m_MuCTPIL1TopoKey_m2; SG::WriteHandleKey<LVL1::MuCTPIL1Topo> m_MuCTPIL1TopoKey_m1; diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/python/TrigT1MuctpiPhase1Config.py b/Trigger/TrigT1/TrigT1MuctpiPhase1/python/TrigT1MuctpiPhase1Config.py index e962f3f95cb1919583ec49494e8c13cdb4cdb6e0..32939555cffc9227979d7890857285854c6126e2 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/python/TrigT1MuctpiPhase1Config.py +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/python/TrigT1MuctpiPhase1Config.py @@ -118,7 +118,7 @@ class DefaultL1MuctpiPhase1Tool( LVL1MUCTPIPHASE1__MUCTPI_AthTool ): self.RunPeriod = "UNDEFINED" self.FlaggingMode = False self.MultiplicityStrategyName = "INCLUSIVE" - self.GeometryXMLFile = "TrigT1MuctpiPhase1/L1MuonGeometry.xml" + self.GeometryXMLFile = "TrigConfMuctpi/L1MuonGeometry_20200629.xml" # Decide which LUT to use, based on which run we are simulating: from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthAlg.cxx b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthAlg.cxx index 03bcbc1a24a26ca96b6728df95ded1422cd54d01..77aaae13aaec444def7435695e47b9f5626c3883 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthAlg.cxx +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthAlg.cxx @@ -10,7 +10,7 @@ namespace LVL1MUCTPIPHASE1 { MUCTPI_AthAlg::MUCTPI_AthAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm(name, pSvcLocator), - m_muctpiTool("LVL1MUCTPIPHASE1::MUCTPI_AthTool/LVL1MUCTPIPHASE1__MUCTPI_AthTool") + m_muctpiTool("LVL1MUCTPIPHASE1__MUCTPI_AthTool/MUCTPI_AthTool") { // Init message ATH_MSG_INFO( "=======================================" ); diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx index 6162425f9ea9e14c4bf3973cf886cad487dedfee..e88c7a48ead5426dcdd82af0667b540feef4d395 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx @@ -30,6 +30,8 @@ #include "TrigT1Result/MuCTPI_RDO.h" #include "TrigT1Result/MuCTPIRoI.h" +#include "xAODTrigger/MuonRoI.h" +#include "xAODTrigger/MuonRoIAuxContainer.h" #include "AnalysisTriggerEvent/LVL1_ROI.h" @@ -45,7 +47,7 @@ namespace LVL1MUCTPIPHASE1 { const std::string MUCTPI_AthTool::m_DEFAULT_L1MuctpiStoreLocationTGC = "/Event/L1MuctpiStoreTGC"; const std::string MUCTPI_AthTool::m_DEFAULT_AODLocID = "LVL1_ROI"; const std::string MUCTPI_AthTool::m_DEFAULT_RDOLocID = "MUCTPI_RDO"; - const std::string MUCTPI_AthTool::m_DEFAULT_geometryXMLFile = "TrigT1MuctpiPhase1/L1MuonGeometry.xml"; + const std::string MUCTPI_AthTool::m_DEFAULT_geometryXMLFile = "TrigConfMuctpi/L1MuonGeometry_20200629.xml"; MUCTPI_AthTool::MUCTPI_AthTool(const std::string& type, const std::string& name, const IInterface* parent) @@ -142,7 +144,7 @@ namespace LVL1MUCTPIPHASE1 { CHECK(m_configSvc.retrieve()); //initialize MSP ROI configuration - const std::string fullFileName = PathResolverFindXMLFile( m_geometryXMLFile ); + const std::string fullFileName = PathResolverFindCalibFile( m_geometryXMLFile ); m_theMuctpi->configureMSP(fullFileName); m_theMuctpi->getTriggerProcessor()->setThresholds(m_configSvc->thresholdConfig()->getThresholdVector(TrigConf::L1DataDef::MUON)); @@ -188,6 +190,7 @@ namespace LVL1MUCTPIPHASE1 { ATH_CHECK(m_muctpiPhase1KeyTGC.initialize()); ATH_CHECK(m_MuCTPI_RDOReadKey.initialize(m_inputSource == "RDO")); ATH_CHECK(m_MuCTPI_RDOWriteKey.initialize(m_inputSource != "RDO")); + ATH_CHECK(m_MuCTPI_xAODWriteKey.initialize()); ATH_CHECK(m_MuCTPIL1TopoKey.initialize()); m_MuCTPIL1TopoKey_m2 = m_MuCTPIL1TopoKey.key()+std::to_string(-2); @@ -423,9 +426,15 @@ namespace LVL1MUCTPIPHASE1 { ATH_CHECK(wh_muctpi_rdo.record(std::make_unique<MuCTPI_RDO>(*muCTPI_RDO))); ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate"); - - - + // create MuCTPI xAOD + auto xAODRoIs = SG::makeHandle(m_MuCTPI_xAODWriteKey); + ATH_CHECK(xAODRoIs.record(std::make_unique<xAOD::MuonRoIContainer>(), std::make_unique<xAOD::MuonRoIAuxContainer>())); + ATH_MSG_DEBUG("Recorded MuonRoIContainer with key " << m_MuCTPI_xAODWriteKey.key()); + for (const unsigned int word : dataWords) { + xAODRoIs->push_back(new xAOD::MuonRoI); + // RB: dummy values just to have the objects for downstream code development + xAODRoIs->back()->initialize(word, 99, 99, "DummyThreshold", 99); + } // get outputs for L1Topo and store into Storegate ATH_MSG_DEBUG("Getting the output for L1Topo"); diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py index 568acf36eb7f24fefdd926ef58935d255baf97de..4dbf27eb1f4781a29978ca775a861b56fcac2dc4 100644 --- a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py +++ b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py @@ -35,11 +35,11 @@ def ExampleL1TriggerByteStreamToolCfg(name, writeBS=False): def L1TriggerByteStreamDecoderCfg(flags): decoderTools = [] - if flags.Trigger.decodeLegacyL1: + if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1: roibResultTool = RoIBResultByteStreamToolCfg(name="RoIBResultBSDecoderTool", writeBS=False) decoderTools += [roibResultTool] - if flags.Trigger.decodePhaseIL1: + if flags.Trigger.enableL1Phase1: # Placeholder for real decoder tools - now it's just an example exampleTool = ExampleL1TriggerByteStreamToolCfg(name="L1MuonBSDecoderTool", writeBS=False) decoderTools += [exampleTool] @@ -55,23 +55,21 @@ def L1TriggerByteStreamEncoderCfg(flags): from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator acc = ComponentAccumulator() - if flags.Trigger.decodeLegacyL1: # TODO: Maybe have separate encode*L1 flags? + if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1: roibResultTool = RoIBResultByteStreamToolCfg(name="RoIBResultBSEncoderTool", writeBS=True) acc.addPublicTool(roibResultTool) - if flags.Trigger.decodePhaseIL1: + if flags.Trigger.enableL1Phase1: # Placeholder for real encoder tools - now it's just an example exampleTool = ExampleL1TriggerByteStreamToolCfg(name="L1MuonBSEncoderTool", writeBS=True) acc.addPublicTool(exampleTool) return acc -def L1ByteStreamDecodersRecExSetup(enableRun2L1=True, enableRun3L1=True): +def L1ByteStreamDecodersRecExSetup(): # Use new-style config from the above functions and import into old-style JO from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper from AthenaConfiguration.AllConfigFlags import ConfigFlags - ConfigFlags.Trigger.decodeLegacyL1 = enableRun2L1 - ConfigFlags.Trigger.decodePhaseIL1 = enableRun3L1 CAtoGlobalWrapper(L1TriggerByteStreamDecoderCfg,ConfigFlags) def L1ByteStreamEncodersRecExSetup(): diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_emptyMenu_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_build.py similarity index 77% rename from Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_emptyMenu_build.py rename to Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_build.py index f06b8ae5336d2395ee431dea4f1f07a7a47dc96b..d83dfb3691d50e6c6af7ffc06cea274591181adf 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_emptyMenu_build.py +++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_build.py @@ -13,7 +13,14 @@ ex.type = 'athena' ex.job_options = 'TriggerJobOpts/runHLT_standalone.py' ex.input = 'ttbar' ex.threads = 1 -ex.args = '-c "setMenu=\'LS2_v1\';doL1Sim=True;doEmptyMenu=True;doWriteBS=False;doWriteRDOTrigger=True;"' +precommand = ''.join([ + "setMenu='LS2_v1';", # LS2_v1 soon to be renamed to Dev_pp_run3_v1 + "doL1Sim=True;", + "doEmptyMenu=True;", + "doWriteBS=False;", + "doWriteRDOTrigger=True;" +]) +ex.args = '-c "{:s}"'.format(precommand) test = Test.Test() test.art_type = 'build' diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_phase1_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_phase1_build.py new file mode 100755 index 0000000000000000000000000000000000000000..5a54df9da1dd239b38052053495ad799d4bee595 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_L1SimOnly_phase1_build.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +# art-description: Trigger RDO->RDO_TRIG athena test with L1 simulation with Phase-I path enabled but without any HLT chains +# art-type: build +# art-include: master/Athena +# Skipping art-output which has no effect for build tests. +# If you create a grid version, check art-output in existing grid tests. + +from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps + +ex = ExecStep.ExecStep() +ex.type = 'athena' +ex.job_options = 'TriggerJobOpts/runHLT_standalone.py' +ex.input = 'ttbar' +ex.threads = 1 +precommand = ''.join([ + "setMenu='LS2_v1';", # LS2_v1 soon to be renamed to Dev_pp_run3_v1 + "doL1Sim=True;", + "enableL1Phase1=True;", + "enableL1CaloLegacy=True;", + "doEmptyMenu=True;", + "doWriteBS=False;", + "doWriteRDOTrigger=True;" +]) +ex.args = '-c "{:s}"'.format(precommand) + +test = Test.Test() +test.art_type = 'build' +test.exec_steps = [ex] +test.check_steps = CheckSteps.default_check_steps(test) + +# Skip ZeroCounts check because empty menu has no counts +test.check_steps.remove(test.get_step("ZeroCounts")) + +import sys +sys.exit(test.run()) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerGetter.py index ac460ed0cea5a2731bf6ec63ce8dbb1f932b70a3..7b875313fab3d499b0022cc44cb38e0e422826a7 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerGetter.py @@ -141,7 +141,7 @@ class HLTSimulationGetter(Configured): if jobproperties.Global.InputFormat() == 'bytestream': # Decode ROIB::RoIBResult from ByteStream from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup - L1ByteStreamDecodersRecExSetup(enableRun2L1=True, enableRun3L1=False) + L1ByteStreamDecodersRecExSetup() log.info("Loading RegionSelector") from AthenaCommon.AppMgr import ServiceMgr diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py index 90e4961a36f7f5e911090e00b022271dc00033a6..510671ab213a699f80ba77e6aaba454e1e0fb0f0 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1ResultBuilderGetter.py @@ -47,7 +47,7 @@ class Lvl1ResultBuilderGetter(Configured): if jobproperties.Global.InputFormat() == 'bytestream': # Decode ROIB::RoIBResult from ByteStream from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup - L1ByteStreamDecodersRecExSetup(enableRun2L1=True, enableRun3L1=False) + L1ByteStreamDecodersRecExSetup() from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import \ RoIBResultToAOD topSequence += RoIBResultToAOD("RoIBResultToxAOD") diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py index 8919edd3be2473221f38698d32c1df9a6e444f57..beb53063b7a6694bdafa103a80888da9a0ac69f4 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py @@ -28,59 +28,67 @@ def Lvl1SimulationSequence( flags = None ): log.info("setting up LVL1ConfigSvc, including the menu generation") from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc svcMgr += conf2toConfigurable(getL1ConfigSvc()) - - from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMaker - caloTowerMaker = Run2TriggerTowerMaker("Run2TriggerTowerMaker25ns") - caloTowerMaker.ExtraInputs = ["LArTTL1Container#LArTTL1EM", "LArTTL1Container#LArTTL1HAD", "TileTTL1Container#TileTTL1Cnt" ] - caloTowerMaker.ZeroSuppress = True - caloTowerMaker.CellType = 3 - - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__Run2CPMTowerMaker - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__Run2JetElementMaker - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__CPMSim - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JEMJetSim - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JEMEnergySim - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__CPCMX - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JetCMX - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__EnergyCMX - from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__RoIROD - - from TrigT1MBTS.TrigT1MBTSConf import LVL1__TrigT1MBTS - from TrigT1ZDC.TrigT1ZDCConf import LVL1__TrigT1ZDC - - l1CaloSim = seqAND('l1CaloSim',[ - caloTowerMaker, - #LVL1__Run2CPMTowerMaker( 'CPMTowerMaker', ExtraInputs=["XYZ#1"], ExtraOutputs=["XYZ#2"]) , - LVL1__Run2CPMTowerMaker( 'CPMTowerMaker') , - LVL1__Run2JetElementMaker( 'JetElementMaker'), - LVL1__CPMSim( 'CPMSim' ) , - LVL1__JEMJetSim( 'JEMJetSim' ) , - LVL1__JEMEnergySim( 'JEMEnergySim' ) , - LVL1__CPCMX( 'CPCMX' ) , - LVL1__JetCMX( 'JetCMX' ) , - LVL1__EnergyCMX( 'EnergyCMX' ) , - LVL1__RoIROD( 'RoIROD' ), - LVL1__TrigT1MBTS(), - LVL1__TrigT1ZDC() - ]) - - from IOVDbSvc.CondDB import conddb - L1CaloFolderList = [] - #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"] - L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"] - #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/RunParameters"] - #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DerivedRunPars"] - #L1CaloFolderList += ["/TRIGGER/Receivers/Conditions/VgaDac"] - #L1CaloFolderList += ["/TRIGGER/Receivers/Conditions/Strategy"] - L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Conditions/DisabledTowers"] - L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/PpmDeadChannels"] - L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"] - - for l1calofolder in L1CaloFolderList: - #conddb.addFolderWithTag("TRIGGER_OFL", l1calofolder, "HEAD") - conddb.addFolder( "TRIGGER_OFL", l1calofolder ) - # muons + ################################################## + # Calo + ################################################## + + if flags.Trigger.enableL1CaloLegacy: + + from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMaker + caloTowerMaker = Run2TriggerTowerMaker("Run2TriggerTowerMaker25ns") + caloTowerMaker.ExtraInputs = ["LArTTL1Container#LArTTL1EM", "LArTTL1Container#LArTTL1HAD", "TileTTL1Container#TileTTL1Cnt" ] + caloTowerMaker.ZeroSuppress = True + caloTowerMaker.CellType = 3 + + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__Run2CPMTowerMaker + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__Run2JetElementMaker + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__CPMSim + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JEMJetSim + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JEMEnergySim + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__CPCMX + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__JetCMX + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__EnergyCMX + from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__RoIROD + + from TrigT1MBTS.TrigT1MBTSConf import LVL1__TrigT1MBTS + from TrigT1ZDC.TrigT1ZDCConf import LVL1__TrigT1ZDC + + l1CaloSim = seqAND('l1CaloSim',[ + caloTowerMaker, + #LVL1__Run2CPMTowerMaker( 'CPMTowerMaker', ExtraInputs=["XYZ#1"], ExtraOutputs=["XYZ#2"]) , + LVL1__Run2CPMTowerMaker( 'CPMTowerMaker') , + LVL1__Run2JetElementMaker( 'JetElementMaker'), + LVL1__CPMSim( 'CPMSim' ) , + LVL1__JEMJetSim( 'JEMJetSim' ) , + LVL1__JEMEnergySim( 'JEMEnergySim' ) , + LVL1__CPCMX( 'CPCMX' ) , + LVL1__JetCMX( 'JetCMX' ) , + LVL1__EnergyCMX( 'EnergyCMX' ) , + LVL1__RoIROD( 'RoIROD' ), + LVL1__TrigT1MBTS(), + LVL1__TrigT1ZDC() + ]) + + from IOVDbSvc.CondDB import conddb + L1CaloFolderList = [] + #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Calibration/Physics/PprChanCalib"] + L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"] + #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/RunParameters"] + #L1CaloFolderList += ["/TRIGGER/L1Calo/V1/Conditions/DerivedRunPars"] + #L1CaloFolderList += ["/TRIGGER/Receivers/Conditions/VgaDac"] + #L1CaloFolderList += ["/TRIGGER/Receivers/Conditions/Strategy"] + L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Conditions/DisabledTowers"] + L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Calibration/PpmDeadChannels"] + L1CaloFolderList += ["/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"] + + for l1calofolder in L1CaloFolderList: + #conddb.addFolderWithTag("TRIGGER_OFL", l1calofolder, "HEAD") + conddb.addFolder( "TRIGGER_OFL", l1calofolder ) + + ################################################## + # Muons + ################################################## from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigitTool MuonRdoToMuonDigitTool = MuonRdoToMuonDigitTool (DecodeMdtRDO = False, @@ -104,15 +112,33 @@ def Lvl1SimulationSequence( flags = None ): from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigit from TrigT1RPCsteering.TrigT1RPCsteeringConf import TrigT1RPC from TrigT1TGC.TrigT1TGCConf import LVL1TGCTrigger__LVL1TGCTrigger - from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi - from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool - ToolSvc += L1MuctpiTool("L1MuctpiTool") - ToolSvc.L1MuctpiTool.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc - - muctpi = L1Muctpi() - muctpi.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc - + TrigT1RPC.useRun3Config = flags.Trigger.enableL1Phase1 + LVL1TGCTrigger__LVL1TGCTrigger.useRun3Config = flags.Trigger.enableL1Phase1 + + if flags.Trigger.enableL1Phase1: + # Placeholder for phase-I MUCTPI simulation + log.info("Configuring Phase-I MUCTPI simulation") + from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1 + from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1Tool + + ToolSvc += L1MuctpiPhase1Tool("MUCTPI_AthTool") + ToolSvc.MUCTPI_AthTool.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc + + muctpi = L1MuctpiPhase1() + muctpi.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc + + else: + log.info("Configuring legacy (Run 2) MUCTPI simulation") + from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi + from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool + + ToolSvc += L1MuctpiTool("L1MuctpiTool") + ToolSvc.L1MuctpiTool.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc + + muctpi = L1Muctpi() + muctpi.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc + l1MuonSim = seqAND("l1MuonSim", [ MuonRdoToMuonDigit( "MuonRdoToMuonDigit", @@ -138,37 +164,52 @@ def Lvl1SimulationSequence( flags = None ): conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_EIFI", className="CondAttrListCollection") conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_BW", className="CondAttrListCollection") conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_TILE", className="CondAttrListCollection") - from TrigT1CTP.TrigT1CTPConfig import CTPSimulationInReco - from TrigT1RoIB.TrigT1RoIBConfig import RoIBuilder condSeq = AthSequencer("AthCondSeq") from MuonCondSvc.MuonCondSvcConf import TGCTriggerDbAlg condSeq += TGCTriggerDbAlg() - from L1TopoSimulation.L1TopoSimulationConfig import L1TopoSimulation - l1TopoSim = L1TopoSimulation() + ################################################## + # Topo + ################################################## - l1TopoSim.MuonInputProvider.ROIBResultLocation = "" #disable input from RoIBResult - l1TopoSim.MuonInputProvider.MuctpiSimTool = ToolSvc.L1MuctpiTool - - # enable the reduced (coarse) granularity topo simulation - # currently only for MC - from AthenaCommon.GlobalFlags import globalflags - if globalflags.DataSource()!='data': - l1TopoSim.MuonInputProvider.MuonEncoding = 1 + if flags.Trigger.enableL1Phase1: + log.info("No phase1 configuration for L1Topo simulation is available, adding L1TopoSimPlaceholder") + l1TopoSim = AthSequencer("L1TopoSimPlaceholder") else: - l1TopoSim.MuonInputProvider.MuonEncoding = 0 + from L1TopoSimulation.L1TopoSimulationConfig import L1TopoSimulation + l1TopoSim = L1TopoSimulation() + + l1TopoSim.MuonInputProvider.ROIBResultLocation = "" #disable input from RoIBResult + l1TopoSim.MuonInputProvider.MuctpiSimTool = ToolSvc.L1MuctpiTool + # enable the reduced (coarse) granularity topo simulation + # currently only for MC + from AthenaCommon.GlobalFlags import globalflags + if globalflags.DataSource()!='data': + l1TopoSim.MuonInputProvider.MuonEncoding = 1 + else: + l1TopoSim.MuonInputProvider.MuonEncoding = 0 + ################################################## + # CTP + ################################################## + from TrigT1CTP.TrigT1CTPConfig import CTPSimulationInReco ctp = CTPSimulationInReco("CTPSimulation") ctp.DoLUCID = False ctp.DoBCM = False - ctp.DoL1Topo = True + ctp.DoL1Topo = not flags.Trigger.enableL1Phase1 ctp.UseCondL1Menu = False ctp.TrigConfigSvc = svcMgr.LVL1ConfigSvc - ctpSim = seqAND("ctpSim", [ctp, RoIBuilder("RoIBuilder")]) + ctpSim = seqAND("ctpSim", [ctp]) + + if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1: + from TrigT1RoIB.TrigT1RoIBConfig import RoIBuilder + roib = RoIBuilder("RoIBuilder") + roib.DoCalo = flags.Trigger.enableL1CaloLegacy + roib.DoMuon = not flags.Trigger.enableL1Phase1 + ctpSim += [roib] #l1Sim = seqAND("l1Sim", [caloTowerMaker] ) l1Sim = seqAND("l1Sim", [l1CaloSim, l1MuonSim, l1TopoSim, ctpSim] ) return l1Sim - diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index 424342251df8650e767c7f4263ab4cb2dcdfc37e..46cfe3dd8f634e2866a827f4e4fb2a8ef2e3b988 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -28,10 +28,12 @@ def createTriggerFlags(): # changes decoding of L1 so that allways all configured chains are enabled, testing mode flags.addFlag("Trigger.L1Decoder.forceEnableAllChains", False) - # L1 decoding options - flags.addFlag('Trigger.decodeLegacyL1', True) - flags.addFlag('Trigger.decodePhaseIL1', False) - + # Enable Run-3 LVL1 simulation and/or decoding + flags.addFlag('Trigger.enableL1Phase1', False) + + # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True) + flags.addFlag('Trigger.enableL1CaloLegacy', True) + # if 1, Run1 decoding version is set; if 2, Run2; if 3, Run 3 def EDMDecodingVersion(flags): log.debug("Attempting to determine EDMDecodingVersion.") diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index bd983492a07456dd75086f98819fcb1e4754fa43..4f66fbe955c3bdddb76d45df6bbc294bf9b65a37 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -41,8 +41,8 @@ class opt: endJobAfterGenerate = False # Finish job after menu generation failIfNoProxy = False # Sets the SGInputLoader.FailIfNoProxy property forceEnableAllChains = False # if True, all HLT chains will run even if the L1 item is false - decodeLegacyL1 = True # Decode L1 RoIs from legacy L1 systems through RoIBResult for HLT seeding - decodePhaseIL1 = False # Decode L1 RoIs from Run-3 L1 systems through L1TriggerResult for HLT seeding + enableL1Phase1 = False # Enable Run-3 LVL1 simulation and/or decoding + enableL1CaloLegacy = True # Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True) #Individual slice flags doEgammaSlice = True doMuonSlice = True @@ -176,6 +176,11 @@ if 'doL1Sim' not in globals(): opt.doL1Sim = globalflags.DataSource != 'data' log.info('Setting default doL1Sim=%s because globalflags.DataSource=%s', opt.doL1Sim, globalflags.DataSource()) +# Translate opts to flags for LVL1 +ConfigFlags.Trigger.doLVL1 = opt.doL1Sim +ConfigFlags.Trigger.enableL1Phase1 = opt.enableL1Phase1 +ConfigFlags.Trigger.enableL1CaloLegacy = opt.enableL1CaloLegacy + #------------------------------------------------------------- # Transfer flags into TriggerFlags #------------------------------------------------------------- @@ -438,7 +443,7 @@ CAtoGlobalWrapper(L1ConfigSvcCfg,None) # --------------------------------------------------------------- if opt.doL1Sim: from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence - topSequence += Lvl1SimulationSequence() + topSequence += Lvl1SimulationSequence(ConfigFlags) @@ -451,20 +456,17 @@ if opt.doL1Unpacking: if globalflags.InputFormat.is_bytestream(): # Create inputs for L1Decoder from ByteStream from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup - L1ByteStreamDecodersRecExSetup( - enableRun2L1=opt.decodeLegacyL1, - enableRun3L1=opt.decodePhaseIL1) + L1ByteStreamDecodersRecExSetup() if globalflags.InputFormat.is_bytestream() or opt.doL1Sim: + # TODO: replace with L1DecoderCfg from L1Decoder.L1DecoderConfig import L1Decoder l1decoder = L1Decoder("L1Decoder") l1decoder.ctpUnpacker.ForceEnableAllChains = opt.forceEnableAllChains - if opt.decodePhaseIL1: + l1decoder.RoIBResult = "RoIBResult" if opt.enableL1CaloLegacy or not opt.enableL1Phase1 else "" + l1decoder.L1TriggerResult = "L1TriggerResult" if opt.enableL1Phase1 else "" + if opt.enableL1Phase1: from L1Decoder.L1DecoderConfig import getL1TriggerResultMaker topSequence += conf2toConfigurable(getL1TriggerResultMaker()) - else: - l1decoder.L1TriggerResult = "" - if not opt.decodeLegacyL1: - l1decoder.RoIBResult = "" if TriggerFlags.doTransientByteStream(): transTypeKey = ("TransientBSOutType","StoreGateSvc+TransientBSOutKey") l1decoder.ExtraInputs += [transTypeKey]