Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-12 08:55:11

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 ## L1REPACK uGT : Re-Emulate L1 uGT and repack into RAW
0005 
0006 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
0007 
0008 (~stage2L1Trigger).toModify(None, lambda x:
0009     print("# L1T WARN:  L1REPACK:uGT only supports Stage-2 eras for now.\n# L1T WARN:  Use a legacy version of L1REPACK for now."))
0010 stage2L1Trigger.toModify(None, lambda x:
0011     print("# L1T INFO:  L1REPACK:uGT will unpack uGMT and CaloLayer2 outputs, and re-emulate uGT"))
0012 
0013 # First, inputs to uGT:
0014 import EventFilter.L1TRawToDigi.gtStage2Digis_cfi
0015 unpackGtStage2 = EventFilter.L1TRawToDigi.gtStage2Digis_cfi.gtStage2Digis.clone(
0016     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0017 
0018 import EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi
0019 unpackTcds = EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi.tcdsRawToDigi.clone(
0020     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0021 
0022 from L1Trigger.Configuration.SimL1Emulator_cff import *
0023 
0024 simGtExtFakeStage2Digis.tcdsRecordLabel= cms.InputTag("unpackTcds","tcdsRecord")
0025 
0026 simGtStage2Digis.MuonInputTag   = "unpackGtStage2:Muon"
0027 simGtStage2Digis.MuonShowerInputTag = "unpackGtStage2:MuonShower"
0028 simGtStage2Digis.EGammaInputTag = "unpackGtStage2:EGamma"
0029 simGtStage2Digis.TauInputTag    = "unpackGtStage2:Tau"
0030 simGtStage2Digis.JetInputTag    = "unpackGtStage2:Jet"
0031 simGtStage2Digis.EtSumInputTag  = "unpackGtStage2:EtSum"
0032 simGtStage2Digis.ExtInputTag    = "unpackGtStage2" # as in default
0033 
0034 
0035 # Finally, pack the new L1T output back into RAW
0036     
0037 # pack simulated uGT
0038 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2
0039 packGtStage2.MuonInputTag   = "unpackGtStage2:Muon"
0040 packGtStage2.ShowerInputLabel = "unpackGtStage2:MuonShower"
0041 packGtStage2.EGammaInputTag = "unpackGtStage2:EGamma"
0042 packGtStage2.TauInputTag    = "unpackGtStage2:Tau"
0043 packGtStage2.JetInputTag    = "unpackGtStage2:Jet"
0044 packGtStage2.EtSumInputTag  = "unpackGtStage2:EtSum"
0045 packGtStage2.GtInputTag     = "simGtStage2Digis" # as in default
0046 packGtStage2.ExtInputTag    = "unpackGtStage2" # as in default
0047     
0048 
0049 # combine the new L1 RAW with existing RAW for other FEDs
0050 import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
0051 rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
0052     verbose = 0,
0053     RawCollectionList = [
0054         'packGtStage2',
0055         cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()),
0056         ]
0057     )
0058 
0059 
0060 SimL1EmulatorTask = cms.Task()
0061 stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackGtStage2
0062                                                           ,unpackTcds
0063                                                           ,SimL1TechnicalTriggersTask
0064                                                           ,SimL1TGlobalTask
0065                                                           ,packGtStage2
0066                                                           ,rawDataCollector))
0067 SimL1Emulator = cms.Sequence(SimL1EmulatorTask)