Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-09 02:06:26

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