Commit 8a5adb8c authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'l1sim-test' into 'master'

Update L1Sim trigger tests and configuration to enable Phase-I testing

See merge request atlas/athena!33608
parents fbba7864 5c15d5ad
......@@ -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
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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
......
......@@ -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( "=======================================" );
......
......@@ -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");
......
......@@ -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():
......
......@@ -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'
......
#!/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())
......@@ -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
......
......@@ -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")
......
......@@ -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
......@@ -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.")
......
......@@ -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]
......
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