from L1Trigger.L1TCalorimeter.simCaloStage1LegacyFormatDigis_cfi import * from L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi import * from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger (stage1L1Trigger & ~stage2L1Trigger).toReplaceWith(SimL1TCalorimeter, cms.Sequence(simRctDigis + simRctUpgradeFormatDigis + simCaloStage1Digis + simCaloStage1FinalDigis + simCaloStage1LegacyFormatDigis)) # # Stage-2 Trigger # # select one of the following two options: # - layer1 from L1Trigger/L1TCalorimeter package #from L1Trigger.L1TCalorimeter.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis # - layer1 from L1Trigger/L1TCaloLayer1 package from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis stage2L1Trigger.toReplaceWith(SimL1TCalorimeter, cms.Sequence( simCaloStage2Layer1Digis + simCaloStage2Digis )) def _modifyStage2L1TriggerCaloParams(process): from CondCore.CondDB.CondDB_cfi import CondDB CondDB.connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") process.l1conddb = cms.ESSource("PoolDBESSource", CondDB, toGet = cms.VPSet( cms.PSet( record = cms.string('L1TCaloParamsO2ORcd'), tag = cms.string("L1TCaloParams_static_CMSSW_9_2_10_2017_v1_8_2_updateHFSF_v6MET") ) ) ) modifySimDigis_stage2L1TriggerCaloPArams = stage2L1Trigger.makeProcessModifier(_modifyStage2L1TriggerCaloParams)
simEmtfDigis.RPCInput = 'unpackRPC' simCaloStage2Layer1Digis.ecalToken = 'unpackEcal:EcalTriggerPrimitives' simCaloStage2Layer1Digis.hcalToken = 'unpackHcal' # uGT inputs for Muons are from unpacked simGtStage2Digis.MuonInputTag = "unpackGtStage2","Muon" # Finally, pack the newly re-emulated L1T parts back into RAW # Calo packer from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 # uGT packer from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packCaloStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith(SimL1Emulator, cms.Sequence(unpackEcal+unpackHcal+unpackCSC+unpackDT+unpackRPC+unpackEmtf+unpackCsctf+unpackBmtf+unpackGtStage2 +SimL1EmulatorCore+packCaloStage2 +packGtStage2+rawDataCollector))
DQMHarvestL1TMon ) # DQM Offline sequence for modules requiring an electron dataset Stage2l1tEgDqmOfflineClient = cms.Sequence( DQMHarvestL1TEg ) # DQM Offline sequence for modules requiring a muon dataset Stage2l1tMuonDqmOfflineClient = cms.Sequence( DQMHarvestL1TMuon ) #replacements for stage2 stage2L1Trigger.toReplaceWith(l1TriggerOnline, Stage2l1TriggerOnline) stage2L1Trigger.toReplaceWith(l1TriggerOffline, Stage2l1TriggerOffline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOnline, Stage2l1TriggerEmulatorOnline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOffline, Stage2l1TriggerEmulatorOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOffline, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerEgDqmOffline, Stage2l1tEgDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerMuonDqmOffline, Stage2l1tMuonDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineClient, Stage2l1TriggerDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1TriggerEgDqmOfflineClient, Stage2l1tEgDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1TriggerMuonDqmOfflineClient, Stage2l1tMuonDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineCosmics, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineCosmicsClient, Stage2l1TriggerDqmOfflineClient) ############################################################################## #phase2 ##############################################################################
# ignore the main DT TP emulator warnings... (In future we'll override only # L1T emulator related conditions, so you can use a data GT) process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') # Note: For stage-2, all conditions are overriden by local config file. Use data tag: stage2L1Trigger.toReplaceWith(process.GlobalTag, #GlobalTag(process.GlobalTag, 'auto:run2_mc', '') GlobalTag(process.GlobalTag, 'auto:run2_data', '').clone( toGet = cms.VPSet( cms.PSet(record = cms.string("DTCCBConfigRcd"), tag = cms.string("DTCCBConfig_NOSingleL_V05_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), # cms.PSet(record = cms.string("DTKeyedConfigListRcd"), # tag = cms.string("DTKeyedConfigContainer_NOSingleL_V05_mc"), # connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") # ), cms.PSet(record = cms.string("DTT0Rcd"), tag = cms.string("DTt0_STARTUP_V02_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), cms.PSet(record = cms.string("DTTPGParametersRcd"), tag = cms.string("DTTPGParameters_V01_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), ) )) #### Sim L1 Emulator Sequence: process.load('Configuration.StandardSequences.RawToDigi_cff') #process.load('Configuration.StandardSequences.SimL1Emulator_cff') process.load('L1Trigger.Configuration.L1TReEmulateFromRAW_cff')
SimL1TMuonTask = cms.Task(SimL1TMuonCommonTask, simCsctfTrackDigis, simCsctfDigis, simDttfDigis, simRpcTriggerDigis, simGmtDigis) SimL1TMuon = cms.Sequence(SimL1TMuonTask) # # Stage-2 Trigger # from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import * from L1Trigger.L1TMuonBarrel.simBmtfDigis_cfi import * from L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi import * from L1Trigger.L1TMuonOverlap.simOmtfDigis_cfi import * from L1Trigger.L1TMuon.simGmtCaloSumDigis_cfi import * from L1Trigger.L1TMuon.simGmtStage2Digis_cfi import * from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger # # stage2L1Trigger.toReplaceWith(SimL1TMuonTask, cms.Task(SimL1TMuonCommonTask, simTwinMuxDigis, simBmtfDigis, simEmtfDigis, simOmtfDigis, simGmtCaloSumDigis, simGmtStage2Digis)) ## GEM TPs from L1Trigger.L1TGEM.simGEMDigis_cff import * _run3_SimL1TMuonTask = SimL1TMuonTask.copy() _run3_SimL1TMuonTask.add(simMuonGEMPadTask) from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM (stage2L1Trigger & run3_GEM).toReplaceWith( SimL1TMuonTask, _run3_SimL1TMuonTask ) ## ME0 TPs from L1Trigger.L1TGEM.me0TriggerDigis_cff import * _phase2_SimL1TMuonTask = SimL1TMuonTask.copy() _phase2_SimL1TMuonTask.add(me0TriggerAllDigiTask) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
# simCaloStage2Layer1Digis.ecalToken = 'simEcalTriggerPrimitiveDigis' # DEFAULT # simCaloStage2Layer1Digis.hcalToken = 'simHcalTriggerPrimitiveDigis' # DEFAULT # Finally, pack the new L1T output back into RAW from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose=0, RawCollectionList=[ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ]) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith( SimL1EmulatorTask, cms.Task(unpackEcal, unpackHcal, unpackCSC, unpackDT, unpackRPC, unpackEmtf, unpackCsctf, unpackBmtf, simEcalTriggerPrimitiveDigis, simHcalTriggerPrimitiveDigis, SimL1EmulatorCoreTask, packCaloStage2, packGmtStage2, packGtStage2, rawDataCollector)) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose=0, RawCollectionList=[ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ]) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith( SimL1EmulatorTask, cms.Task(unpackEcal, unpackHcal, unpackCSC, unpackDT, unpackRPC, unpackRPCTwinMux, unpackTwinMux, unpackOmtf, unpackEmtf, unpackCsctf, unpackBmtf, unpackLayer1, unpackTcds, SimL1EmulatorCoreTask, packCaloStage2, packGmtStage2, packGtStage2, rawDataCollector)) _SimL1EmulatorTaskWithGEM = SimL1EmulatorTask.copy() _SimL1EmulatorTaskWithGEM.add(unpackGEM) (stage2L1Trigger & run3_GEM).toReplaceWith(SimL1EmulatorTask, _SimL1EmulatorTaskWithGEM) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
CSCCandidates = 'simCsctfDigis:CSC', RPCbCandidates = 'simRpcTriggerDigis:RPCb', RPCfCandidates = 'simRpcTriggerDigis:RPCf', # Note: GMT requires input from calorimeter emulators, namely MipIsoData from GCT MipIsoData = 'simRctDigis' ) # # SimL1TMuon = cms.Sequence(SimL1TMuonCommon + simCsctfTrackDigis + simCsctfDigis + simDttfDigis + simRpcTriggerDigis + simGmtDigis) # # Stage-2 Trigger # from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import * from L1Trigger.L1TMuonBarrel.simBmtfDigis_cfi import * from L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi import * from L1Trigger.L1TMuonOverlap.simOmtfDigis_cfi import * from L1Trigger.L1TMuon.simGmtCaloSumDigis_cfi import * from L1Trigger.L1TMuon.simGmtStage2Digis_cfi import * from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger # # stage2L1Trigger.toReplaceWith(SimL1TMuon, cms.Sequence(SimL1TMuonCommon + simTwinMuxDigis + simBmtfDigis + simEmtfDigis + simOmtfDigis + simGmtCaloSumDigis + simGmtStage2Digis)) from L1Trigger.ME0Trigger.me0TriggerPseudoDigis_cff import * _phase2_SimL1TMuon = SimL1TMuon.copy() _phase2_SimL1TMuon += me0TriggerPseudoDigiSequence from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon (stage2L1Trigger & phase2_muon).toReplaceWith( SimL1TMuon, _phase2_SimL1TMuon )
simGtStage2Digis.EtSumInputTag = "unpackGtStage2:EtSum" simGtStage2Digis.ExtInputTag = "unpackGtStage2" # as in default # Finally, pack the new L1T output back into RAW # pack simulated uGT from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 packGtStage2.MuonInputTag = "unpackGtStage2:Muon" packGtStage2.EGammaInputTag = "unpackGtStage2:EGamma" packGtStage2.TauInputTag = "unpackGtStage2:Tau" packGtStage2.JetInputTag = "unpackGtStage2:Jet" packGtStage2.EtSumInputTag = "unpackGtStage2:EtSum" packGtStage2.GtInputTag = "simGtStage2Digis" # as in default packGtStage2.ExtInputTag = "unpackGtStage2" # as in default # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose=0, RawCollectionList=[ 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ]) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith( SimL1Emulator, cms.Sequence(unpackGtStage2 + unpackTcds + SimL1TechnicalTriggers + SimL1TGlobal + packGtStage2 + rawDataCollector))
) import L1Trigger.GlobalTrigger.convertObjectMapRecord_cfi as _converterModule l1L1GtObjectMap = _converterModule.convertObjectMapRecord.clone() L1Reco_L1Extra = cms.Sequence(l1extraParticles) L1Reco_L1Extra_L1GtRecord = cms.Sequence(l1extraParticles + l1GtRecord) L1Reco = cms.Sequence(l1extraParticles + l1GtTriggerMenuLite + conditionsInEdm + l1L1GtObjectMap) # # Stage-1 Trigger # from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger stage1L1Trigger.toReplaceWith(L1Reco_L1Extra, cms.Sequence()) stage1L1Trigger.toReplaceWith(L1Reco_L1Extra_L1GtRecord, cms.Sequence()) stage1L1Trigger.toReplaceWith(L1Reco, cms.Sequence(l1extraParticles)) # # Stage-2 Trigger: # from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger stage2L1Trigger.toReplaceWith(L1Reco_L1Extra, cms.Sequence()) stage2L1Trigger.toReplaceWith(L1Reco_L1Extra_L1GtRecord, cms.Sequence()) stage2L1Trigger.toReplaceWith(L1Reco, cms.Sequence()) # # l1L1GtObjectMap does not work properly with fastsim # from Configuration.Eras.Modifier_fastSim_cff import fastSim _L1Reco_modified = L1Reco.copyAndExclude([l1L1GtObjectMap]) fastSim.toReplaceWith(L1Reco, _L1Reco_modified)
# Finally, pack the new L1T output back into RAW from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith(SimL1Emulator, cms.Sequence(unpackRPC + unpackDT + unpackCSC + unpackEcal + unpackHcal #+ simEcalTriggerPrimitiveDigis + simHcalTriggerPrimitiveDigis + SimL1EmulatorCore + packCaloStage2 + packGmtStage2 + packGtStage2 + rawDataCollector))
) SimL1TCalorimeterTask = cms.Task(simRctDigis, simGctDigis) SimL1TCalorimeter = cms.Sequence(SimL1TCalorimeterTask) # # Stage-1 Trigger # # # - Stage-1 Layer-2 Calorimeter Trigger Emulator, with required converters (Stage-1 mixes legacy and upgrade) # from L1Trigger.L1TCalorimeter.simRctUpgradeFormatDigis_cfi import * from L1Trigger.L1TCalorimeter.simCaloStage1Digis_cfi import * from L1Trigger.L1TCalorimeter.simCaloStage1FinalDigis_cfi import * from L1Trigger.L1TCalorimeter.simCaloStage1LegacyFormatDigis_cfi import * from L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi import * from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger (stage1L1Trigger & ~stage2L1Trigger).toReplaceWith(SimL1TCalorimeterTask, cms.Task(simRctDigis, simRctUpgradeFormatDigis, simCaloStage1Digis, simCaloStage1FinalDigis, simCaloStage1LegacyFormatDigis)) # # Stage-2 Trigger # # select one of the following two options: # - layer1 from L1Trigger/L1TCalorimeter package #from L1Trigger.L1TCalorimeter.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis # - layer1 from L1Trigger/L1TCaloLayer1 package from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis stage2L1Trigger.toReplaceWith(SimL1TCalorimeterTask, cms.Task( simCaloStage2Layer1Digis, simCaloStage2Digis ))
L1TRawToDigi_Stage1.add(gtDigis, caloStage1Digis, caloStage1FinalDigis, caloStage1LegacyFormatDigis, gctDigis) (stage1L1Trigger & ~stage2L1Trigger).toReplaceWith( L1TRawToDigiTask, cms.Task(L1TRawToDigi_Stage1)) # # Stage-2 Trigger: fow now, unpack Stage 1 and Stage 2 (in case both available) # from EventFilter.RPCRawToDigi.rpcTwinMuxRawToDigi_cfi import rpcTwinMuxRawToDigi from EventFilter.RPCRawToDigi.RPCCPPFRawToDigi_cfi import rpcCPPFRawToDigi from EventFilter.L1TRawToDigi.bmtfDigis_cfi import bmtfDigis from EventFilter.L1TRawToDigi.omtfStage2Digis_cfi import omtfStage2Digis from EventFilter.L1TRawToDigi.emtfStage2Digis_cfi import emtfStage2Digis from EventFilter.L1TRawToDigi.caloLayer1Digis_cfi import caloLayer1Digis from EventFilter.L1TRawToDigi.caloStage2Digis_cfi import caloStage2Digis from EventFilter.L1TRawToDigi.gmtStage2Digis_cfi import gmtStage2Digis from EventFilter.L1TRawToDigi.gtStage2Digis_cfi import gtStage2Digis from EventFilter.L1TXRawToDigi.twinMuxStage2Digis_cfi import twinMuxStage2Digis # we only warn if it is stage-2 era and it is an essential, always present, stage-2 payload: stage2L1Trigger.toModify(caloStage2Digis, MinFeds=cms.uint32(1)) stage2L1Trigger.toModify(gmtStage2Digis, MinFeds=cms.uint32(1)) stage2L1Trigger.toModify(gtStage2Digis, MinFeds=cms.uint32(1)) L1TRawToDigi_Stage2 = cms.Task(rpcTwinMuxRawToDigi, twinMuxStage2Digis, bmtfDigis, omtfStage2Digis, rpcCPPFRawToDigi, emtfStage2Digis, caloLayer1Digis, caloStage2Digis, gmtStage2Digis, gtStage2Digis) stage2L1Trigger.toReplaceWith( L1TRawToDigiTask, cms.Task(L1TRawToDigi_Stage1, L1TRawToDigi_Stage2)) L1TRawToDigi = cms.Sequence(L1TRawToDigiTask)
# ignore the main DT TP emulator warnings... (In future we'll override only # L1T emulator related conditions, so you can use a data GT) process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') # Note: For stage-2, all conditions are overriden by local config file. Use data tag: stage2L1Trigger.toReplaceWith(process.GlobalTag, #GlobalTag(process.GlobalTag, 'auto:run2_mc', '') GlobalTag(process.GlobalTag, 'auto:run2_data', '').clone( toGet = cms.VPSet( cms.PSet(record = cms.string("DTCCBConfigRcd"), tag = cms.string("DTCCBConfig_NOSingleL_V05_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), # cms.PSet(record = cms.string("DTKeyedConfigListRcd"), # tag = cms.string("DTKeyedConfigContainer_NOSingleL_V05_mc"), # connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") # ), cms.PSet(record = cms.string("DTT0Rcd"), tag = cms.string("DTt0_STARTUP_V02_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), cms.PSet(record = cms.string("DTTPGParametersRcd"), tag = cms.string("DTTPGParameters_V01_mc"), connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") ), ) )) #### Sim L1 Emulator Sequence: process.load('Configuration.StandardSequences.RawToDigi_cff') #process.load('Configuration.StandardSequences.SimL1Emulator_cff') process.load('L1Trigger.Configuration.L1TReEmulateFromRAW_cff')
RPCbCandidates = 'simRpcTriggerDigis:RPCb', RPCfCandidates = 'simRpcTriggerDigis:RPCf', # Note: GMT requires input from calorimeter emulators, namely MipIsoData from GCT MipIsoData = 'simRctDigis' ) # # SimL1TMuonTask = cms.Task(SimL1TMuonCommonTask, simCsctfTrackDigis, simCsctfDigis, simDttfDigis, simRpcTriggerDigis, simGmtDigis) SimL1TMuon = cms.Sequence(SimL1TMuonTask) # # Stage-2 Trigger # from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import * from L1Trigger.L1TMuonBarrel.simBmtfDigis_cfi import * from L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi import * from L1Trigger.L1TMuonOverlap.simOmtfDigis_cfi import * from L1Trigger.L1TMuon.simGmtCaloSumDigis_cfi import * from L1Trigger.L1TMuon.simGmtStage2Digis_cfi import * from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger # # stage2L1Trigger.toReplaceWith(SimL1TMuonTask, cms.Task(SimL1TMuonCommonTask, simTwinMuxDigis, simBmtfDigis, simEmtfDigis, simOmtfDigis, simGmtCaloSumDigis, simGmtStage2Digis)) from L1Trigger.ME0Trigger.me0TriggerPseudoDigis_cff import * _phase2_SimL1TMuonTask = SimL1TMuonTask.copy() _phase2_SimL1TMuonTask.add(me0TriggerPseudoDigiTask) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon (stage2L1Trigger & phase2_muon).toReplaceWith( SimL1TMuonTask, _phase2_SimL1TMuonTask )
# Finally, pack the new L1T output back into RAW # pack simulated uGT from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 packGtStage2.MuonInputTag = "unpackGtStage2:Muon" packGtStage2.EGammaInputTag = "unpackGtStage2:EGamma" packGtStage2.TauInputTag = "unpackGtStage2:Tau" packGtStage2.JetInputTag = "unpackGtStage2:Jet" packGtStage2.EtSumInputTag = "unpackGtStage2:EtSum" packGtStage2.GtInputTag = "simGtStage2Digis" # as in default packGtStage2.ExtInputTag = "unpackGtStage2" # as in default # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packGtStage2'. cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith(SimL1Emulator, cms.Sequence(unpackGtStage2 +SimL1TGlobal +packGtStage2 +rawDataCollector))
from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackRPC , unpackDT , unpackCSC , unpackEcal , unpackHcal #, simEcalTriggerPrimitiveDigis , simHcalTriggerPrimitiveDigis , SimL1EmulatorCoreTask , packCaloStage2 , packGmtStage2 , packGtStage2 , rawDataCollector)) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
(stage1L1Trigger & ~stage2L1Trigger).toReplaceWith( SimL1TCalorimeter, cms.Sequence(simRctDigis + simRctUpgradeFormatDigis + simCaloStage1Digis + simCaloStage1FinalDigis + simCaloStage1LegacyFormatDigis)) # # Stage-2 Trigger # # select one of the following two options: # - layer1 from L1Trigger/L1TCalorimeter package #from L1Trigger.L1TCalorimeter.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis # - layer1 from L1Trigger/L1TCaloLayer1 package from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis stage2L1Trigger.toReplaceWith( SimL1TCalorimeter, cms.Sequence(simCaloStage2Layer1Digis + simCaloStage2Digis)) def _modifyStage2L1TriggerCaloParams(process): from CondCore.CondDB.CondDB_cfi import CondDB CondDB.connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") process.l1conddb = cms.ESSource( "PoolDBESSource", CondDB, toGet=cms.VPSet( cms.PSet( record=cms.string('L1TCaloParamsO2ORcd'), tag=cms.string( "L1TCaloParams_static_CMSSW_9_2_10_2017_v1_8_2_updateHFSF_v6MET" ))))
simCaloStage2Layer1Digis.ecalToken = 'unpackEcal:EcalTriggerPrimitives' simCaloStage2Layer1Digis.hcalToken = 'unpackLayer1' # Finally, pack the new L1T output back into RAW from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose=0, RawCollectionList=[ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ]) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith( SimL1Emulator, cms.Sequence(unpackEcal + unpackHcal + unpackCSC + unpackDT + unpackRPC + unpackRPCTwinMux + unpackTwinMux + unpackOmtf + unpackEmtf + unpackCsctf + unpackBmtf + unpackLayer1 + SimL1EmulatorCore + packCaloStage2 + packGmtStage2 + packGtStage2 + rawDataCollector))
# # All changes must be explicitly discussed with the L1T offline coordinator. # import FWCore.ParameterSet.Config as cms import sys # # Legacy Trigger: # # # - Global Trigger emulator # import L1Trigger.GlobalTrigger.gtDigis_cfi simGtDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone( GmtInputTag='simGmtDigis', GctInputTag='simGctDigis', TechnicalTriggersInputTags=[ 'simBscDigis', 'simRpcTechTrigDigis', 'simHcalTechTrigDigis', 'simCastorTechTrigDigis' ]) SimL1TGlobal = cms.Sequence(simGtDigis) # # Stage-2 Trigger # # # - Global Trigger emulator # from L1Trigger.L1TGlobal.simGtStage2Digis_cfi import * from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger stage2L1Trigger.toReplaceWith(SimL1TGlobal, cms.Sequence(simGtStage2Digis))
# simEmtfDigis.CSCInput = "simCscTriggerPrimitiveDigis" # DEFAULT simEmtfDigis.RPCInput = 'unpackRPC' # simCaloStage2Layer1Digis.ecalToken = 'simEcalTriggerPrimitiveDigis' # DEFAULT # simCaloStage2Layer1Digis.hcalToken = 'simHcalTriggerPrimitiveDigis' # DEFAULT # Finally, pack the new L1T output back into RAW from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1Emulator = cms.Sequence() stage2L1Trigger.toReplaceWith(SimL1Emulator, cms.Sequence(unpackEcal+unpackHcal+unpackCSC+unpackDT+unpackRPC+unpackEmtf+unpackCsctf+unpackBmtf +simEcalTriggerPrimitiveDigis +simHcalTriggerPrimitiveDigis +SimL1EmulatorCore+packCaloStage2 +packGmtStage2+packGtStage2+rawDataCollector))
import EventFilter.L1GlobalTriggerRawToDigi.conditionDumperInEdm_cfi conditionsInEdm = EventFilter.L1GlobalTriggerRawToDigi.conditionDumperInEdm_cfi.conditionDumperInEdm.clone() import L1Trigger.GlobalTrigger.convertObjectMapRecord_cfi as _converterModule l1L1GtObjectMap = _converterModule.convertObjectMapRecord.clone() L1Reco_L1Extra = cms.Sequence(l1extraParticles) L1Reco_L1Extra_L1GtRecord = cms.Sequence(l1extraParticles+l1GtRecord) L1Reco = cms.Sequence(l1extraParticles+l1GtTriggerMenuLite+conditionsInEdm+l1L1GtObjectMap) # # Stage-1 Trigger # from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger stage1L1Trigger.toReplaceWith(L1Reco_L1Extra,cms.Sequence()) stage1L1Trigger.toReplaceWith(L1Reco_L1Extra_L1GtRecord,cms.Sequence()) stage1L1Trigger.toReplaceWith(L1Reco, cms.Sequence(l1extraParticles)) # # Stage-2 Trigger: fow now, reco Stage-1 as before: # from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger stage2L1Trigger.toReplaceWith(L1Reco_L1Extra,cms.Sequence()) stage2L1Trigger.toReplaceWith(L1Reco_L1Extra_L1GtRecord,cms.Sequence()) stage2L1Trigger.toReplaceWith(L1Reco, cms.Sequence(l1extraParticles)) # # l1L1GtObjectMap does not work properly with fastsim # from Configuration.Eras.Modifier_fastSim_cff import fastSim _L1Reco_modified = L1Reco.copyAndExclude([l1L1GtObjectMap]) fastSim.toReplaceWith(L1Reco, _L1Reco_modified)
l1tTauOfflineDQMEmu ) # # DQM Offline Step 1 sequence Stage2l1TriggerDqmOffline = cms.Sequence( Stage2l1TriggerOffline # * l1tRate_Offline # * l1tSync_Offline * Stage2l1TriggerEmulatorOffline * l1tMuonDQMOffline ) # DQM Offline Step 2 sequence Stage2l1TriggerDqmOfflineClient = cms.Sequence( l1tStage2EmulatorMonitorClient * l1tStage2MonitorClient * DQMHarvestL1Trigger ) #replacements for stage2 stage2L1Trigger.toReplaceWith(l1TriggerOnline, Stage2l1TriggerOnline) stage2L1Trigger.toReplaceWith(l1TriggerOffline, Stage2l1TriggerOffline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOnline, Stage2l1TriggerEmulatorOnline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOffline, Stage2l1TriggerEmulatorOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOffline, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineClient, Stage2l1TriggerDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1EmulatorMonitorClient,l1tStage2EmulatorMonitorClient)
# pack simulated uGT from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 packGtStage2.MuonInputTag = "unpackGtStage2:Muon" packGtStage2.EGammaInputTag = "unpackGtStage2:EGamma" packGtStage2.TauInputTag = "unpackGtStage2:Tau" packGtStage2.JetInputTag = "unpackGtStage2:Jet" packGtStage2.EtSumInputTag = "unpackGtStage2:EtSum" packGtStage2.GtInputTag = "simGtStage2Digis" # as in default packGtStage2.ExtInputTag = "unpackGtStage2" # as in default # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackGtStage2 ,unpackTcds ,SimL1TechnicalTriggersTask ,SimL1TGlobalTask ,packGtStage2 ,rawDataCollector)) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
simGtStage2Digis.ExtInputTag = "unpackGtStage2" # as in default # Finally, pack the new L1T output back into RAW # pack simulated uGT from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 packGtStage2.MuonInputTag = "unpackGtStage2:Muon" packGtStage2.EGammaInputTag = "unpackGtStage2:EGamma" packGtStage2.TauInputTag = "unpackGtStage2:Tau" packGtStage2.JetInputTag = "unpackGtStage2:Jet" packGtStage2.EtSumInputTag = "unpackGtStage2:EtSum" packGtStage2.GtInputTag = "simGtStage2Digis" # as in default packGtStage2.ExtInputTag = "unpackGtStage2" # as in default # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose=0, RawCollectionList=[ 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ]) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith( SimL1EmulatorTask, cms.Task(unpackGtStage2, unpackTcds, SimL1TechnicalTriggersTask, SimL1TGlobalTask, packGtStage2, rawDataCollector)) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
stage2L1Trigger.toModify(simGtExtFakeStage2Digis, tcdsRecordLabel= cms.InputTag("unpackTcds","tcdsRecord") ) # Finally, pack the new L1T output back into RAW from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2 # combine the new L1 RAW with existing RAW for other FEDs import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone( verbose = 0, RawCollectionList = [ 'packCaloStage2', 'packGmtStage2', 'packGtStage2', cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()), ] ) SimL1EmulatorTask = cms.Task() stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackEcal,unpackHcal,unpackCSC,unpackDT,unpackRPC,unpackRPCTwinMux,unpackTwinMux,unpackOmtf,unpackEmtf,unpackCsctf,unpackBmtf ,unpackLayer1 ,unpackTcds ,SimL1EmulatorCoreTask,packCaloStage2 ,packGmtStage2,packGtStage2,rawDataCollector)) SimL1Emulator = cms.Sequence(SimL1EmulatorTask)
Stage2l1TriggerEmulatorOffline = cms.Sequence( Stage2l1TriggerEmulatorOnline + l1tStage2CaloLayer2OfflineDQMEmu + l1tEGammaOfflineDQMEmu + l1tTauOfflineDQMEmu) # # DQM Offline Step 1 sequence Stage2l1TriggerDqmOffline = cms.Sequence( Stage2l1TriggerOffline # * l1tRate_Offline # * l1tSync_Offline * Stage2l1TriggerEmulatorOffline * l1tMuonDQMOffline) # DQM Offline Step 2 sequence Stage2l1TriggerDqmOfflineClient = cms.Sequence(l1tStage2EmulatorMonitorClient * l1tStage2MonitorClient * DQMHarvestL1Trigger) #replacements for stage2 stage2L1Trigger.toReplaceWith(l1TriggerOnline, Stage2l1TriggerOnline) stage2L1Trigger.toReplaceWith(l1TriggerOffline, Stage2l1TriggerOffline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOnline, Stage2l1TriggerEmulatorOnline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOffline, Stage2l1TriggerEmulatorOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOffline, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineClient, Stage2l1TriggerDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1EmulatorMonitorClient, l1tStage2EmulatorMonitorClient)
from L1Trigger.L1TCalorimeter.simCaloStage1LegacyFormatDigis_cfi import * from L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi import * from Configuration.Eras.Modifier_stage1L1Trigger_cff import stage1L1Trigger from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger (stage1L1Trigger & ~stage2L1Trigger).toReplaceWith(SimL1TCalorimeterTask, cms.Task(simRctDigis, simRctUpgradeFormatDigis, simCaloStage1Digis, simCaloStage1FinalDigis, simCaloStage1LegacyFormatDigis)) # # Stage-2 Trigger # # select one of the following two options: # - layer1 from L1Trigger/L1TCalorimeter package #from L1Trigger.L1TCalorimeter.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis # - layer1 from L1Trigger/L1TCaloLayer1 package from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis stage2L1Trigger.toReplaceWith(SimL1TCalorimeterTask, cms.Task( simCaloStage2Layer1Digis, simCaloStage2Digis )) def _modifyStage2L1TriggerCaloParams(process): from CondCore.CondDB.CondDB_cfi import CondDB CondDB.connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") process.l1conddb = cms.ESSource("PoolDBESSource", CondDB, toGet = cms.VPSet( cms.PSet( record = cms.string('L1TCaloParamsO2ORcd'), tag = cms.string("L1TCaloParams_static_CMSSW_9_2_10_2017_v1_8_2_updateHFSF_v6MET") ) ) ) modifySimDigis_stage2L1TriggerCaloPArams = stage2L1Trigger.makeProcessModifier(_modifyStage2L1TriggerCaloParams)
Stage2l1TriggerDqmOfflineClient = cms.Sequence( l1tStage2EmulatorMonitorClient * l1tStage2MonitorClient ) # DQM Offline sequence for modules requiring an electron dataset Stage2l1tEgDqmOfflineClient = cms.Sequence( DQMHarvestL1TEg ) # DQM Offline sequence for modules requiring a muon dataset Stage2l1tMuonDqmOfflineClient = cms.Sequence( DQMHarvestL1TMuon ) #replacements for stage2 stage2L1Trigger.toReplaceWith(l1TriggerOnline, Stage2l1TriggerOnline) stage2L1Trigger.toReplaceWith(l1TriggerOffline, Stage2l1TriggerOffline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOnline, Stage2l1TriggerEmulatorOnline) stage2L1Trigger.toReplaceWith(l1TriggerEmulatorOffline, Stage2l1TriggerEmulatorOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOffline, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerEgDqmOffline, Stage2l1tEgDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerMuonDqmOffline, Stage2l1tMuonDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineClient, Stage2l1TriggerDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1TriggerEgDqmOfflineClient, Stage2l1tEgDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1TriggerMuonDqmOfflineClient, Stage2l1tMuonDqmOfflineClient) stage2L1Trigger.toReplaceWith(l1EmulatorMonitorClient,l1tStage2EmulatorMonitorClient) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineCosmics, Stage2l1TriggerDqmOffline) stage2L1Trigger.toReplaceWith(l1TriggerDqmOfflineCosmicsClient, Stage2l1TriggerDqmOfflineClient)
import sys # # Legacy Trigger: # # # - Global Trigger emulator # import L1Trigger.GlobalTrigger.gtDigis_cfi simGtDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone( GmtInputTag = 'simGmtDigis', GctInputTag = 'simGctDigis', TechnicalTriggersInputTags = [ 'simBscDigis', 'simRpcTechTrigDigis', 'simHcalTechTrigDigis', 'simCastorTechTrigDigis' ] ) SimL1TGlobalTask = cms.Task(simGtDigis) SimL1TGlobal = cms.Sequence(SimL1TGlobalTask) # # Stage-2 Trigger # # # - Global Trigger emulator # from L1Trigger.L1TGlobal.simGtStage2Digis_cfi import * from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger stage2L1Trigger.toReplaceWith(SimL1TGlobalTask, cms.Task(simGtStage2Digis))